コード例 #1
0
        public void CreditRefund()
        {
            var response = card.Refund(16m)
                           .WithCurrency("USD")
                           .WithAllowDuplicates(true)
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
コード例 #2
0
        public void CreditRefund()
        {
            var response = card.Refund(AMOUNT)
                           .WithCurrency(CURRENCY)
                           .Execute();

            AssertTransactionResponse(response, TransactionStatus.Captured);
        }
コード例 #3
0
        public void Test_006_credit_manual_refund()
        {
            Transaction response = card.Refund(10m)
                                   .WithCurrency("USD")
                                   .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("000", response.ResponseCode);
        }
コード例 #4
0
        public void CreditRefund()
        {
            var response = card.Refund(16m)
                           .WithCurrency("USD")
                           .WithAllowDuplicates(true)
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual(SUCCESS, response?.ResponseCode);
            Assert.AreEqual(GetMapping(TransactionStatus.Captured), response?.ResponseMessage);
        }
コード例 #5
0
        public void Refund_Encrypted_Keyed()
        {
            var response = encryptedCard.Refund(4.01m)
                           .WithCurrency("USD")
                           .WithInvoiceNumber("1701")
                           .WithClientTransactionId("165901")
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
コード例 #6
0
        public void Test_006_credit_manual_refund()
        {
            Transaction response = card.Refund(10m)
                                   .WithCurrency("USD")
                                   .Execute();

            Assert.IsNotNull(response);
            System.Diagnostics.Debug.WriteLine(response.HostResponseDate);
            System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber);
            Assert.AreEqual("000", response.ResponseCode);
        }
コード例 #7
0
        public void Refund_Keyed()
        {
            // TODO: There is some weirdness around adding the client transaction id to a refund by card.
            var response = card.Refund(4.01m)
                           .WithCurrency("USD")
                           .WithInvoiceNumber("1701")
                           //.WithClientTransactionId("165901")
                           .WithAddress(address)
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
コード例 #8
0
        public IActionResult CreditApi(Datos detalles)
        {
            // configure client & request settings
            ServicesContainer.ConfigureService(new GatewayConfig {
                MerchantId     = "addonnettest",
                AccountId      = "api",
                SharedSecret   = "secret",
                RefundPassword = "******",
                ServiceUrl     = "https://remote.sandbox.addonpayments.com/remote"
            });

            // create the card object
            var card = new CreditCardData {
                Number         = detalles.Tarjeta.cardNumber,
                ExpMonth       = detalles.Tarjeta.month,
                ExpYear        = detalles.Tarjeta.year,
                CardHolderName = detalles.Tarjeta.cardholderName
            };

            try {
                // process an auto-capture authorization
                Transaction response = card.Refund(detalles.Tarjeta.importe)
                                       .WithCurrency("EUR")
                                       .Execute();

                var result  = response.ResponseCode;    // 00 == Success
                var message = response.ResponseMessage; // [ test system ] AUTHORISED

                // get the response details to save to the DB for future requests
                var orderId           = response.OrderId;           // ezJDQjhENTZBLTdCNzNDQw
                var authCode          = response.AuthorizationCode; // 12345
                var paymentsReference = response.TransactionId;     // pasref 14622680939731425

                Respuesta respuesta = new Respuesta {
                    result = result, message = message, orderId = orderId, authCode = authCode, paymentsReference = paymentsReference
                };

                return(Ok(respuesta));
            }

            catch (ApiException exce) {
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }
コード例 #9
0
        public void CreditDccRateRefundStandalone()
        {
            var dccDetails = card.GetDccRate()
                             .WithAmount(Amount)
                             .WithCurrency(CURRENCY)
                             .Execute();
            var expectedDccAmountValue = GetDccAmount(dccDetails);

            AssertDccInfoResponse(dccDetails, expectedDccAmountValue);

            waitForGpApiReplication();
            var response = card.Refund(Amount)
                           .WithCurrency(CURRENCY)
                           .WithDccRateData(dccDetails.DccRateData)
                           .Execute();

            AssertTransactionResponse(response, TransactionStatus.Captured, expectedDccAmountValue);
        }
コード例 #10
0
        public void Refund_Vault()
        {
            // TODO: There is some weirdness around adding the client transaction id to a refund by card.
            var response = tokenizedCard.Refund(1.83m)
                           .WithCurrency("USD")
                           .WithCashBack(0m)
                           .WithConvenienceAmount(0m)
                           //.WithTaxAmount(0m)
                           .WithInvoiceNumber("1559")
                           //PoNumber
                           //CustomerCode
                           //.WithClientTransactionId("166909")
                           .WithAllowPartialAuth(false)
                           .WithAllowDuplicates(false)
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }