예제 #1
0
        public void GetRefund()
        {
            PaymillList <Refund> refunds = _paymill.RefundService.ListAsync().Result;
            Refund refund = _paymill.RefundService.GetAsync(refunds.Data[0].Id).Result;

            Assert.IsFalse(String.IsNullOrEmpty(refund.Id));
        }
예제 #2
0
        public void GetPreauthorization()
        {
            PaymillList <Preauthorization> lstPreauthorizations = _paymill.PreauthorizationService.ListAsync().Result;
            Preauthorization preauthorization = _paymill.PreauthorizationService.GetAsync(lstPreauthorizations.Data[0].Id).Result;

            Assert.IsFalse(String.IsNullOrEmpty(preauthorization.Id), "Create Preauthorization Failed");
        }
예제 #3
0
        public void GetWebhooks()
        {
            Webhook.WebhookEventType[] eventTypes = { Webhook.WebhookEventType.SUBSCRIPTION_SUCCEEDED, Webhook.WebhookEventType.SUBSCRIPTION_FAILED };
            Webhook webhook = _paymill.WebhookService.CreateEmailWebhookAsync("*****@*****.**", eventTypes).Result;

            Assert.IsTrue(webhook.Id != String.Empty, "CreateEmailWebhook Fail");
            PaymillList <Webhook> resultList = _paymill.WebhookService.ListAsync().Result;

            Assert.IsTrue(resultList.DataCount > 0, "Get Webhooks failed");
        }
예제 #4
0
        public void ListFilterByAmount()
        {
            Offer newOffer = createOffer();

            Offer.Filter filter = Offer.CreateFilter().ByAmount(offerAmount);

            PaymillList <Offer> wrapper = _paymill.OfferService.ListAsync(filter, null).Result;
            List <Offer>        offers  = wrapper.Data;

            Assert.IsNotNull(offers);
            Assert.IsFalse(offers.Count == 0);
        }
예제 #5
0
        public void ListOfferByAmountDesc()
        {
            Offer newOffer = createOffer();

            Offer.Order order = Offer.CreateOrder().ByCreatedAt().Desc();

            PaymillList <Offer> wrapper = _paymill.OfferService.ListAsync(null, order).Result;
            List <Offer>        offers  = wrapper.Data;

            Assert.IsNotNull(offers);
            Assert.IsFalse(offers.Count == 0);
            Assert.AreEqual(offers[0].Amount, offerAmount);
        }
예제 #6
0
        public void ListFilterByCardType()
        {
            Payment.Filter filter = Payment.createFilter().ByCardType(Payment.CardTypes.VISA);

            PaymillList <Payment> wrapper  = _paymill.PaymentService.ListAsync(filter, null).Result;
            List <Payment>        payments = wrapper.Data;

            Assert.IsNotNull(payments);
            Assert.IsFalse(payments.Count == 0);
            foreach (var paym in payments)
            {
                Assert.IsTrue(paym.CardType == Payment.CardTypes.VISA);
            }
        }
예제 #7
0
        public void ListFilterByEmail()
        {
            _paymill.ClientService.CreateWithEmailAsync("*****@*****.**").Wait();
            Client.Filter filter = Client.CreateFilter().ByEmail("*****@*****.**");

            PaymillList <Client> wrapper = _paymill.ClientService.ListAsync(filter, null).Result;
            List <Client>        clients = wrapper.Data;

            Assert.IsNotNull(clients);
            Assert.IsFalse(clients.Count == 0);

            Assert.AreEqual(clients[0].Email, "*****@*****.**");
            foreach (var client in clients)
            {
                ValidateClient(client);
            }
        }
예제 #8
0
        public void GetPayments()
        {
            PaymillList <Payment> lstPayments = _paymill.PaymentService.ListAsync().Result;

            Assert.IsFalse(lstPayments.DataCount == 0, "GetPayments Fail");
        }
예제 #9
0
        public void ListRefunds()
        {
            PaymillList <Refund> refund = _paymill.RefundService.ListAsync().Result;

            Assert.IsTrue(refund.DataCount > 0);
        }
예제 #10
0
        public void GetRefunds()
        {
            PaymillList <Refund> lstRefunds = _paymill.RefundService.ListAsync().Result;

            Assert.IsTrue(lstRefunds.DataCount > 0, "List Refunds failed");
        }
예제 #11
0
        public void GetPreauthorizations()
        {
            PaymillList <Preauthorization> lstPreauthorizations = _paymill.PreauthorizationService.ListAsync().Result;

            Assert.IsFalse(lstPreauthorizations.DataCount == 0, "Get Preauthorization Failed");
        }
예제 #12
0
 public void GetTransactions()
 {
     PaymillList<Transaction> lstTransactions = _paymill.TransactionService.ListAsync().Result;
     Assert.IsTrue(lstTransactions.DataCount > 0);
 }