Пример #1
0
        public void GetPaymentInfoTest()
        {
            DecidirConnector       decidir = new DecidirConnector(Ambiente.AMBIENTE_SANDBOX, "566f2c897b5e4bfaa0ec2452f5d67f13", "b192e4cb99564b84bf5db5550112adea");
            CardData               data    = GetCardData();
            PaymentResponse        resultPaymentResponse = new PaymentResponse();
            PaymentResponse        paymentInfoResponse   = new PaymentResponse();
            GetAllPaymentsResponse pagos = new GetAllPaymentsResponse();

            try
            {
                Payment payment = GetPayment();

                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);
            }
        }
        public ActionResult GetPaymentInfo(int ambienteId, string privateApiKey, string publicApiKey, long paymentId)
        {
            DecidirConnector decidir = new DecidirConnector(ambienteId, privateApiKey, publicApiKey);

            PaymentResponse respuesta = decidir.GetPaymentInfo(paymentId);

            return(Json(respuesta));
        }
Пример #3
0
        public void GetPaymentInfoExampleTest()
        {
            string privateApiKey = "92b71cf711ca41f78362a7134f87ff65";
            string publicApiKey  = "e9cdb99fff374b5f91da4480c8dca741";
            long   paymentId     = 0;

            //Para el ambiente de desarrollo
            DecidirConnector decidir = new DecidirConnector(Ambiente.AMBIENTE_SANDBOX, privateApiKey, publicApiKey);

            PaymentResponse paymentInfoResponse = decidir.GetPaymentInfo(paymentId);
        }