Exemplo n.º 1
0
        public static TransactionDetail Retrieve(RetrieveTransactionDetailRequest request, Options options)
        {
            String url = options.BaseUrl
                         + "/v2/reporting/payment/details?paymentConversationId="
                         + request.PaymentConversationId;

            return(RestHttpClientV2.Create().Get <TransactionDetail>(url, GetHttpHeadersWithUrlParams(request, url, options)));
        }
Exemplo n.º 2
0
        public static async Task <TransactionDetail> RetrieveAsync(RetrieveTransactionDetailRequest request, Options options)
        {
            string url = options.BaseUrl
                         + "/v2/reporting/payment/details?paymentConversationId="
                         + request.PaymentConversationId;

            return(await RestHttpClient.Instance.GetAsync <TransactionDetail>(url, GetHttpHeadersWithUrlParams(request, url, options)));
        }
        public void Should_Retrieve_Transaction()
        {
            RetrieveTransactionDetailRequest request = new RetrieveTransactionDetailRequest()
            {
                PaymentConversationId = "payment123456789x"
            };
            TransactionDetail transactionDetail = TransactionDetail.Retrieve(request, options);

            PrintResponse <TransactionDetail>(transactionDetail);
            Assert.AreEqual(Status.SUCCESS.ToString(), transactionDetail.Status);
            Assert.IsNotNull(transactionDetail.SystemTime);
            Assert.IsNull(transactionDetail.ErrorMessage);
        }
        public async Task Should_Retrieve_TransactionDetail()
        {
            RetrieveTransactionDetailRequest request = RetrieveTransactionDetailRequestBuilder.Create().Build();

            TransactionDetail transactionDetail = await TransactionDetail.RetrieveAsync(request, Options);

            PrintResponse(transactionDetail);

            Assert.AreEqual(Status.SUCCESS.ToString(), transactionDetail.Status);
            Assert.AreEqual(0, transactionDetail.StatusCode);
            Assert.IsNotNull(transactionDetail.Payments);
            Assert.IsNotEmpty(transactionDetail.Payments);
            Assert.IsNull(transactionDetail.ConversationId);
            Assert.IsNotNull(transactionDetail.SystemTime);
            Assert.IsNull(transactionDetail.ErrorMessage);
        }