public void AnulacionPartialRefundTest() { DecidirConnector decidir = new DecidirConnector(Ambiente.AMBIENTE_SANDBOX, "566f2c897b5e4bfaa0ec2452f5d67f13", "b192e4cb99564b84bf5db5550112adea"); CardData data = GetCardData(); 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.PartialRefund(resultPaymentResponse.id, 1000); Assert.AreEqual(1000 * 100, refund.amount); Assert.AreEqual("approved", refund.status); deleteRefund = decidir.DeletePartialRefund(resultPaymentResponse.id, refund.id); } catch (Exception) { Assert.AreEqual(true, false); } }
public ActionResult PartialRefund(int ambienteId, string privateApiKey, string publicApiKey, long paymentId, double amount) { DecidirConnector decidir = new DecidirConnector(ambienteId, privateApiKey, publicApiKey); RefundResponse respuesta = decidir.PartialRefund(paymentId, amount); return(Json(respuesta)); }
public void PartialRefundExampleTest() { string privateApiKey = "92b71cf711ca41f78362a7134f87ff65"; string publicApiKey = "e9cdb99fff374b5f91da4480c8dca741"; long paymentId = 0; double refundId = 10.55; //Para el ambiente de desarrollo DecidirConnector decidir = new DecidirConnector(Ambiente.AMBIENTE_SANDBOX, privateApiKey, publicApiKey); RefundResponse refund = decidir.PartialRefund(paymentId, refundId); }