示例#1
0
        public TransactionInfoResponse GetTransactionInfo(TransactionInfoRequest request, out int status, out string message)
        {
            status  = 0;
            message = string.Empty;
            var response = new TransactionInfoResponse();

            try
            {
                IHttpOrderClient client = new HttpOrderClient(Publickey, true);
                var dic    = new Dictionary <string, string>();
                var url    = GetUrl(BusinessObjectPublicUser.RequestFunction.GetTransactionInfo);
                var result = client.Post(request, url, dic, Appid, Uid);

                if (result != null && result.ResponseData != null)
                {
                    status          = result.Status;
                    message         = result.Message;
                    ResponseMessage = result.Message;
                    Status          = result.Status;
                    return(SerializerObject.ProtoBufDeserialize <TransactionInfoResponse>(result.ResponseData, client.Saltkey));
                }
                return(null);
            }
            catch (Exception exception)
            {
                status          = 0;
                message         = "Lỗi từ user api";
                ResponseMessage = SetResponseMessage(exception);
                return(null);
            }
        }
示例#2
0
        public TransactionInfoResponse GetTransactionInfo(TransactionInfoRequest request, out int status, out string message)
        {
            status = 0;
            message = string.Empty;
            var response = new TransactionInfoResponse();
            try
            {
                IHttpOrderClient client = new HttpOrderClient(Publickey, true);
                var dic = new Dictionary<string, string>();
                var url = GetUrl(BusinessObjectPublicUser.RequestFunction.GetTransactionInfo);
                var result = client.Post(request, url, dic, Appid, Uid);

                if (result != null && result.ResponseData != null)
                {
                    status = result.Status;
                    message = result.Message;
                    ResponseMessage = result.Message;
                    Status = result.Status;
                    return SerializerObject.ProtoBufDeserialize<TransactionInfoResponse>(result.ResponseData, client.Saltkey);
                }
                return null;
            }
            catch (Exception exception)
            {
                status = 0;
                message = "Lỗi từ user api";
                ResponseMessage = SetResponseMessage(exception);
                return null;
            }
        }
示例#3
0
 /// <summary>
 /// Get list of user's rejected transactions
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='getTransactionsRejectedRequest'>
 /// Data for Transactions Rejected Request
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> GetTransactionsRejectedAsync(this IPolishAPI operations, TransactionInfoRequest getTransactionsRejectedRequest, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetTransactionsRejectedWithHttpMessagesAsync(getTransactionsRejectedRequest, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#4
0
 /// <summary>
 /// Get list of user's rejected transactions
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='getTransactionsRejectedRequest'>
 /// Data for Transactions Rejected Request
 /// </param>
 public static object GetTransactionsRejected(this IPolishAPI operations, TransactionInfoRequest getTransactionsRejectedRequest)
 {
     return(operations.GetTransactionsRejectedAsync(getTransactionsRejectedRequest).GetAwaiter().GetResult());
 }