Ejemplo n.º 1
0
        public void PaymentCSDigitalGoodsTest()
        {
            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 = GetDigitalGoodsFraudDetection();

                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 (Exception)
            {
                Assert.AreEqual(true, false);
            }
        }
Ejemplo n.º 2
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", "450799");
        }