Ejemplo n.º 1
0
        public void AnulacionRefundTest()
        {
            DecidirConnector       decidir = new DecidirConnector(Ambiente.AMBIENTE_SANDBOX, "566f2c897b5e4bfaa0ec2452f5d67f13", "b192e4cb99564b84bf5db5550112adea");
            PaymentResponse        resultPaymentResponse = new PaymentResponse();
            GetAllPaymentsResponse pagos        = new GetAllPaymentsResponse();
            RefundResponse         refund       = new RefundResponse();
            DeleteRefundResponse   deleteRefund = new DeleteRefundResponse();

            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);

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

                Assert.AreEqual(payment.amount * 100, refund.amount);
                Assert.AreEqual("approved", refund.status);

                deleteRefund = decidir.DeleteRefund(resultPaymentResponse.id, refund.id);
            }
            catch (Exception)
            {
                Assert.AreEqual(true, false);
            }
        }
Ejemplo n.º 2
0
        public ActionResult DeleteRefund(int ambienteId, string privateApiKey, string publicApiKey, long paymentId, long refundId)
        {
            DecidirConnector decidir = new DecidirConnector(ambienteId, privateApiKey, publicApiKey);

            DeleteRefundResponse respuesta = decidir.DeleteRefund(paymentId, refundId);

            return(Json(respuesta));
        }
Ejemplo n.º 3
0
        public void DeleteRefundExampleTest()
        {
            string privateApiKey = "92b71cf711ca41f78362a7134f87ff65";
            string publicApiKey  = "e9cdb99fff374b5f91da4480c8dca741";
            long   paymentId     = 0;
            long   refundId      = 0;

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

            DeleteRefundResponse deleteRefund = decidir.DeleteRefund(paymentId, refundId);
        }