public void ListRefunds_Total_Success()
        {
            // Creates a payment
            PaymentCreateRequest request = BuildCreateRequest(true, "approved");
            Payment createdPayment       = client.Create(request);

            Thread.Sleep(7000);

            // Creates a refund
            PaymentRefund createdRefund =
                client.Refund(createdPayment.Id.GetValueOrDefault());

            Thread.Sleep(3000);

            // List the refund
            ResourcesList <PaymentRefund> refunds = client.ListRefunds(
                createdPayment.Id.GetValueOrDefault());

            Assert.NotNull(refunds);
            Assert.Equal(createdRefund.Id, refunds.First().Id);
        }
Пример #2
0
        public void ListCards_Success()
        {
            CustomerRequest request  = BuildCreateRequest();
            Customer        customer = client.Create(request);

            Thread.Sleep(1000);

            try
            {
                CustomerCardCreateRequest cardRequest = BuildCardCreateRequest();
                CustomerCard createdCard = client.CreateCard(customer.Id, cardRequest);

                ResourcesList <CustomerCard> results = client.ListCards(customer.Id);

                Assert.NotNull(results);
                Assert.Equal(createdCard.Id, results.First().Id);
            }
            finally
            {
                client.Delete(customer.Id);
            }
        }
        public async Task ListRefundsAsync_Total_Success()
        {
            // Creates a payment
            PaymentCreateRequest request = await BuildCreateRequestAsync(true, "approved");

            Payment createdPayment = await client.CreateAsync(request);

            await Task.Delay(7000);

            // Creates a refund
            PaymentRefund createdRefund =
                await client.RefundAsync(createdPayment.Id.GetValueOrDefault());

            await Task.Delay(3000);

            // List the refund
            ResourcesList <PaymentRefund> refunds = await client.ListRefundsAsync(
                createdPayment.Id.GetValueOrDefault());

            Assert.NotNull(refunds);
            Assert.Equal(createdRefund.Id, refunds.First().Id);
        }
Пример #4
0
        public async Task ListCardsAsync_Success()
        {
            CustomerRequest request  = BuildCreateRequest();
            Customer        customer = await client.CreateAsync(request);

            await Task.Delay(1000);

            try
            {
                CustomerCardCreateRequest cardRequest = await BuildCardCreateRequestAsync();

                CustomerCard createdCard = await client.CreateCardAsync(customer.Id, cardRequest);

                ResourcesList <CustomerCard> results = await client.ListCardsAsync(customer.Id);

                Assert.NotNull(results);
                Assert.Equal(createdCard.Id, results.First().Id);
            }
            finally
            {
                await client.DeleteAsync(customer.Id);
            }
        }