Beispiel #1
0
        public void GetPaymentInfoTest()
        {
            DecidirConnector       decidir               = new DecidirConnector(Ambiente.AMBIENTE_SANDBOX, "566f2c897b5e4bfaa0ec2452f5d67f13", "b192e4cb99564b84bf5db5550112adea");
            CardData               data                  = GetCardData();
            CardTokenResponse      resultCardData        = new CardTokenResponse();
            PaymentResponse        resultPaymentResponse = new PaymentResponse();
            PaymentResponse        paymentInfoResponse   = new PaymentResponse();
            GetAllPaymentsResponse pagos                 = new GetAllPaymentsResponse();

            try
            {
                resultCardData = decidir.GetToken(data);

                Payment payment = GetPayment(resultCardData.id);

                resultPaymentResponse = decidir.Payment(payment);

                Assert.AreEqual(resultPaymentResponse.bin, payment.bin);
                Assert.AreEqual(resultPaymentResponse.amount, payment.amount * 100);
                Assert.AreEqual(resultPaymentResponse.site_transaction_id, payment.site_transaction_id);

                Thread.Sleep(4000);

                paymentInfoResponse = decidir.GetPaymentInfo(resultPaymentResponse.id);

                Assert.AreEqual(true, pagos.results.Count >= 0);
            }
            catch (ResponseException)
            {
                Assert.AreEqual(true, false);
            }
        }
Beispiel #2
0
        public void PaymentCSRetailTest()
        {
            DecidirConnector       decidir               = new DecidirConnector(Ambiente.AMBIENTE_SANDBOX, "566f2c897b5e4bfaa0ec2452f5d67f13", "b192e4cb99564b84bf5db5550112adea");
            CardDataCyberSource    data                  = GetCardDataCyberSource();
            CardTokenResponse      resultCardData        = new CardTokenResponse();
            PaymentResponse        resultPaymentResponse = new PaymentResponse();
            GetAllPaymentsResponse pagos                 = new GetAllPaymentsResponse();

            try
            {
                resultCardData = decidir.GetToken(data);

                Payment payment = GetPayment(resultCardData.id);
                payment.fraud_detection = GetRetailFraudDetection();

                resultPaymentResponse = decidir.Payment(payment);

                Assert.AreEqual(resultPaymentResponse.bin, payment.bin);
                Assert.AreEqual(resultPaymentResponse.amount, payment.amount * 100);
                Assert.AreEqual(resultPaymentResponse.site_transaction_id, payment.site_transaction_id);

                pagos = decidir.GetAllPayments(null, null, null, "00030118");

                Assert.AreEqual(true, pagos.results.Count >= 0);
            }
            catch (ResponseException ex)
            {
                Assert.AreEqual(true, false);
            }
        }
Beispiel #3
0
        public void PartialRefundTest()
        {
            DecidirConnector       decidir               = new DecidirConnector(Ambiente.AMBIENTE_SANDBOX, "566f2c897b5e4bfaa0ec2452f5d67f13", "b192e4cb99564b84bf5db5550112adea");
            CardData               data                  = GetCardData();
            CardTokenResponse      resultCardData        = new CardTokenResponse();
            PaymentResponse        resultPaymentResponse = new PaymentResponse();
            GetAllPaymentsResponse pagos                 = new GetAllPaymentsResponse();
            RefundResponse         refund                = new RefundResponse();

            try
            {
                resultCardData = decidir.GetToken(data);

                Payment payment = GetPayment(resultCardData.id);

                resultPaymentResponse = decidir.Payment(payment);

                Assert.AreEqual(resultPaymentResponse.bin, payment.bin);
                Assert.AreEqual(resultPaymentResponse.amount, payment.amount * 100);
                Assert.AreEqual(resultPaymentResponse.site_transaction_id, payment.site_transaction_id);

                //Wait for Refund
                Thread.Sleep(5000);
                refund = decidir.PartialRefund(resultPaymentResponse.id, 1000);

                Assert.AreEqual(1000 * 100, refund.amount);
                Assert.AreEqual("approved", refund.status);
            }
            catch (Exception)
            {
                Assert.AreEqual(true, false);
            }
        }
Beispiel #4
0
        public ActionResult GetTokenBSA(CardTokenBsaDTO cardTokenBsaDTO)
        {
            DecidirConnector decidir = new DecidirConnector(cardTokenBsaDTO.AmbienteId, cardTokenBsaDTO.privateApiKey, cardTokenBsaDTO.publicApiKey);

            GetTokenResponse respuesta = decidir.GetToken(cardTokenBsaDTO.cardTokenBsa);

            return(Json(respuesta));
        }
Beispiel #5
0
        public void GetTokenTest()
        {
            DecidirConnector decidir = new DecidirConnector(Ambiente.AMBIENTE_SANDBOX, "566f2c897b5e4bfaa0ec2452f5d67f13", "b192e4cb99564b84bf5db5550112adea");
            CardData         data    = new CardData();

            data.card_number                       = "4507990000004905";
            data.card_expiration_month             = "08";
            data.card_expiration_year              = "20";
            data.security_code                     = "123";
            data.card_holder_name                  = "John Doe";
            data.card_holder_identification.type   = "dni";
            data.card_holder_identification.number = "25123456";

            CardTokenResponse result = decidir.GetToken(data);

            Assert.AreEqual("450799", result.bin);
        }