示例#1
0
        public IActionResult DccHpp()
        {
            // configure client & request settings
            var service = new HostedService(new GatewayConfig
            {
                MerchantId          = "addonnettest",
                AccountId           = "dcc",
                SharedSecret        = "secret",
                ServiceUrl          = "https://hpp.sandbox.addonpayments.com/pay",
                HostedPaymentConfig = new HostedPaymentConfig
                {
                    Version = "2",
                    DynamicCurrencyConversionEnabled = true
                }
            });

            try {
                // process an auto-capture authorization
                var hppJson = service.Charge(10.01m)
                              .WithCurrency("EUR")
                              .Serialize();


                return(Content(hppJson));
            }

            catch (ApiException exce) {
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }
        public IActionResult ResponseHpp()
        {
            // configure client & request settings
            var service = new HostedService(new GatewayConfig
            {
                MerchantId   = "addonnettest",
                AccountId    = "api",
                SharedSecret = "secret",
                ServiceUrl   = "https://hpp.sandbox.addonpayments.com/pay"
            });

            var responseJson = Request.Form["hppResponse"];

            try {
                // Obtenemos la respuesta
                Transaction response = service.ParseResponse(responseJson, true);

                var orderId           = response.OrderId;                         // GTI5Yxb0SumL_TkDMCAxQA
                var responseCode      = response.ResponseCode;                    // 00
                var responseMessage   = response.ResponseMessage;                 // [ test system ] Authorised
                var responseValues    = response.ResponseValues;                  // get values accessible by key
                var fraudFilterResult = responseValues["HPP_FRAUDFILTER_RESULT"]; // PASS


                return(Content(responseJson));
            }

            catch (ApiException exce) {
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }
        public IActionResult FraudHpp()
        {
            // configure client & request settings
            var service = new HostedService(new GatewayConfig
            {
                MerchantId          = "addonnettest",
                AccountId           = "api",
                SharedSecret        = "secret",
                ServiceUrl          = "https://hpp.sandbox.addonpayments.com/pay",
                HostedPaymentConfig = new HostedPaymentConfig
                {
                    Version         = "2",
                    FraudFilterMode = FraudFilterMode.PASSIVE
                }
            });

            // Datos que deben transferirseal servidor de Addon Payments junto con las opciones de nivel de transacción
            var hostedPaymentData = new HostedPaymentData
            {
                CustomerNumber = "E8953893489",
                ProductId      = "SID9838383"
            };

            var billingAddress = new Address
            {
                Country    = "726",
                PostalCode = "50001|Flat 123"
            };

            var shippingAddress = new Address
            {
                Country    = "726",
                PostalCode = "654|123"
            };

            var variableReference = "Car Part HV";

            try {
                // process an auto-capture authorization
                var hppJson = service.Charge(19.99m)
                              .WithCurrency("EUR")
                              .WithHostedPaymentData(hostedPaymentData)
                              .WithAddress(billingAddress, AddressType.Billing)
                              .WithAddress(shippingAddress, AddressType.Shipping)
                              .WithClientTransactionId(variableReference)
                              .Serialize();


                return(Content(hppJson));
            }

            catch (ApiException exce) {
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }
示例#4
0
        public IActionResult CustomerCreate(Datos detalles)
        {
            // configure client & request settings
            ServicesContainer.ConfigureService(new GatewayConfig {
                MerchantId   = "addonnettest",
                AccountId    = "api",
                SharedSecret = "secret",
                ServiceUrl   = "https://remote.sandbox.addonpayments.com/remote"
            });

            // Cliente
            var customer = new Customer
            {
                Key               = Guid.NewGuid().ToString(),
                Title             = detalles.Cliente.titulo,
                FirstName         = detalles.Cliente.nombre,
                LastName          = detalles.Cliente.apellidos,
                DateOfBirth       = detalles.Cliente.cumple,
                CustomerPassword  = detalles.Cliente.pass,
                Email             = detalles.Cliente.email,
                HomePhone         = detalles.Cliente.homephone,
                DeviceFingerPrint = detalles.Cliente.device,
                Fax               = detalles.Cliente.fax,
                WorkPhone         = detalles.Cliente.workphone,
                Comments          = detalles.Cliente.comments,
                Company           = detalles.Cliente.company,
                // Dirección de envío
                Address = new Address
                {
                    StreetAddress1 = detalles.Shipping.street1,
                    StreetAddress2 = detalles.Shipping.street2,
                    StreetAddress3 = detalles.Shipping.street3,
                    City           = detalles.Shipping.enviocity,
                    Province       = detalles.Shipping.envioprovince,
                    PostalCode     = detalles.Shipping.enviocode,
                    Country        = detalles.Shipping.enviocountry
                }
            };

            try {
                // Creamos el cliente
                var response = customer.Create();
                var payerRef = response.Key;

                Respuesta respuesta = new Respuesta {
                    result = response.Key
                };

                return(Ok(respuesta));
            }

            catch (ApiException exce) {
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }
        public IActionResult FraudstreetApi(Datos detalles)
        {
            // configure client & request settings
            ServicesContainer.ConfigureService(new GatewayConfig {
                MerchantId   = "addonnettest",
                AccountId    = "api",
                SharedSecret = "secret",
                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,
                Cvn            = detalles.Tarjeta.cvn,
                CardHolderName = detalles.Tarjeta.cardholderName
            };

            // Cliente
            var billingAddress = new Address
            {
                Country        = detalles.Fraud.billCo,
                StreetAddress1 = detalles.Fraud.billingstreet,
                PostalCode     = detalles.Fraud.billCp
            };

            try {
                // Procesamos una autorización
                Transaction response = card.Charge(detalles.Tarjeta.importe)
                                       .WithCurrency("EUR")
                                       .WithAddress(billingAddress, AddressType.Billing)
                                       .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
                var schemeReferenceData = response.SchemeId;          // MMC0F00YE4000000715

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

                return(Ok(respuesta));
            }

            catch (ApiException exce) {
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }
示例#6
0
        public IActionResult Auth(Tarjeta detalles)
        {
            // Configuramos los datos de nuestro comercio. Los datos son proporcionados por el equipo de Addon Payments,
            // en caso de duda debe llamar al 914 353 028 e indicar su número de comercio o Merchant ID
            ServicesContainer.ConfigureService(new GatewayConfig {
                MerchantId   = "addonnettest",
                AccountId    = "api",
                SharedSecret = "secret",
                ServiceUrl   = "https://remote.sandbox.addonpayments.com/remote"
            });

            // Creamos el objeto de la tarjeta
            var card = new CreditCardData {
                Number         = detalles.cardNumber,
                ExpMonth       = detalles.month,
                ExpYear        = detalles.year,
                Cvn            = detalles.cvn,
                CardHolderName = detalles.cardholderName
            };

            try {
                // Proceso de autorización automática
                Transaction response = card.Authorize(detalles.importe)
                                       .WithCurrency("EUR")
                                       .Execute();

                // Obtenemos la respuesta y la mostramos
                var result              = response.ResponseCode;      // 00 == Success
                var message             = response.ResponseMessage;   // [ test system ] AUTHORISED
                var orderId             = response.OrderId;           // ezJDQjhENTZBLTdCNzNDQw
                var authCode            = response.AuthorizationCode; // 12345
                var paymentsReference   = response.TransactionId;     // pasref 14622680939731425
                var schemeReferenceData = response.SchemeId;          // MMC0F00YE4000000715

                // Aconsejamos guardar los datos de la operacion en su base de datos en caso de querer gestionar de forma interna sus transacciones

                // Devolvemos el resultado de la operación al cliente
                Respuesta respuesta = new Respuesta {
                    result              = result,
                    message             = message,
                    orderId             = orderId,
                    authCode            = authCode,
                    paymentsReference   = paymentsReference,
                    schemeReferenceData = schemeReferenceData
                };

                return(Ok(respuesta));
            } catch (ApiException exce) {
                // En caso de error informamos al cliente
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }
        public IActionResult RebateApi(Datos detalles)
        {
            // configure client & request settings
            ServicesContainer.ConfigureService(new GatewayConfig {
                MerchantId     = "addonnettest",
                AccountId      = "api",
                SharedSecret   = "secret",
                RebatePassword = "******",
                ServiceUrl     = "https://remote.sandbox.addonpayments.com/remote"
            });

            // Identificador de la transacción que queremos capturar
            var orderId = detalles.Op.OrderID;

            // Referencia de la transacción original
            var paymentsReference = detalles.Op.pasref;

            // Código de autorización
            var authCode = detalles.Op.authCode;

            // create the refund transaction object
            var transaction = Transaction.FromId(paymentsReference, orderId);

            transaction.AuthorizationCode = authCode;

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

                var result              = response.ResponseCode;      // 00 == Success
                var message             = response.ResponseMessage;   // [ test system ] AUTHORISED
                var order               = response.OrderId;           // ezJDQjhENTZBLTdCNzNDQw
                var auth                = response.AuthorizationCode; // 12345
                var schemeReferenceData = response.SchemeId;          // MMC0F00YE4000000715

                // get the response details to save to the DB for future requests


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

                return(Ok(respuesta));
            }

            catch (ApiException exce)
            {
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }
        public IActionResult CreditstoreApi(Datos detalles)
        {
            // configure client & request settings
            ServicesContainer.ConfigureService(new GatewayConfig {
                MerchantId     = "addonnettest",
                AccountId      = "api",
                SharedSecret   = "secret",
                RefundPassword = "******",
                ServiceUrl     = "https://remote.sandbox.addonpayments.com/remote"
            });

            // Identificador del cliente
            var customerId = detalles.Cliente.payerref;

            // Identificador de la tarjeta
            var paymentId = detalles.Cliente.paymentmethod;

            // Asociamos la tarjeta al cliente
            var paymentMethod = new RecurringPaymentMethod(customerId, paymentId);


            try {
                // process an auto-capture authorization
                Transaction response = paymentMethod.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));
            }
        }
        public IActionResult EditcardApi(Datos detalles)
        {
            // configure client & request settings
            ServicesContainer.ConfigureService(new GatewayConfig {
                MerchantId   = "addonnettest",
                AccountId    = "api",
                SharedSecret = "secret",
                ServiceUrl   = "https://remote.sandbox.addonpayments.com/remote"
            });

            // Identificador del cliente
            var customerId = detalles.Cliente.payerref;

            // Identificador de la tarjeta
            var paymentId = detalles.Cliente.paymentmethod;

            // Asociamos la tarjeta al cliente
            var paymentMethod = new RecurringPaymentMethod(customerId, paymentId);


            // Creamos el objeto de la tarjeta
            var newCardDetails = new CreditCardData {
                Number         = detalles.Tarjeta.cardNumber,
                ExpMonth       = detalles.Tarjeta.month,
                ExpYear        = detalles.Tarjeta.year,
                CardHolderName = detalles.Tarjeta.cardholderName
            };

            // Añadimos los nuevos datos de tarjeta al objeto paymentMethod
            paymentMethod.PaymentMethod = newCardDetails;

            try {
                // process an auto-capture authorization
                paymentMethod.SaveChanges();

                Respuesta respuesta = new Respuesta {
                    result = "Tarjeta modificada correctamente."
                };

                return(Ok(respuesta));
            }

            catch (ApiException exce) {
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }
示例#10
0
        public IActionResult FraudholdApi(Datos detalles)
        {
            // configure client & request settings
            ServicesContainer.ConfigureService(new GatewayConfig {
                MerchantId   = "addonnettest",
                AccountId    = "api",
                SharedSecret = "secret",
                ServiceUrl   = "https://remote.sandbox.addonpayments.com/remote"
            });

            // a hold request requires the original order id
            var orderId = detalles.Fraud.orderID;

            // and the payments reference (pasref) from the authorization response
            var paymentsReference = detalles.Fraud.Pasref;

            // create the hold transaction object
            var transaction = Transaction.FromId(paymentsReference, orderId);

            try {
                // Procesamos una autorización
                Transaction response = transaction.Hold()
                                       .WithReasonCode(ReasonCode.FRAUD)
                                       .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 order               = response.OrderId;           // ezJDQjhENTZBLTdCNzNDQw
                var authCode            = response.AuthorizationCode; // 12345
                var paymentsRef         = response.TransactionId;     // pasref 14622680939731425
                var schemeReferenceData = response.SchemeId;          // MMC0F00YE4000000715

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

                return(Ok(respuesta));
            }

            catch (ApiException exce) {
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }
        public IActionResult StorecardApi(Datos detalles)
        {
            // configure client & request settings
            ServicesContainer.ConfigureService(new GatewayConfig {
                MerchantId   = "addonnettest",
                AccountId    = "api",
                SharedSecret = "secret",
                ServiceUrl   = "https://remote.sandbox.addonpayments.com/remote"
            });

            // ID del cliente
            var customer = new Customer
            {
                Key = detalles.Cliente.payerref
            };

            // Creamos un nuevo ID de tarjeta
            var paymentMethodRef = Guid.NewGuid().ToString();

            // Creamos el objeto de la tarjeta
            var card = new CreditCardData {
                Number         = detalles.Tarjeta.cardNumber,
                ExpMonth       = detalles.Tarjeta.month,
                ExpYear        = detalles.Tarjeta.year,
                CardHolderName = detalles.Tarjeta.cardholderName
            };

            // Asociamos el nuevo ID de tarjeta al cliente
            var paymentMethod = customer.AddPaymentMethod(paymentMethodRef, card);

            try {
                // process an auto-capture authorization
                var response = paymentMethod.Create();

                Respuesta respuesta = new Respuesta {
                    result = paymentMethodRef
                };

                return(Ok(respuesta));
            }

            catch (ApiException exce) {
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }
        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));
            }
        }
        public IActionResult CustomerHpp()
        {
            // configure client & request settings
            var service = new HostedService(new GatewayConfig
            {
                MerchantId          = "addonnettest",
                AccountId           = "api",
                SharedSecret        = "secret",
                ServiceUrl          = "https://hpp.sandbox.addonpayments.com/pay",
                HostedPaymentConfig = new HostedPaymentConfig
                {
                    Version            = "2",
                    CardStorageEnabled = true
                }
            });

            // Datos que deben transferirse a la HPP junto con las opciones de nivel de transacción
            var hostedPaymentData = new HostedPaymentData
            {
                OfferToSaveCard = true, // display the save card tick box
                CustomerExists  = false // new customer
                                        // supply your own references
                                        // CustomerKey = "a7960ada-3da9-4a5b-bca5-7942085b03c6",
                                        // PaymentKey = "48fa69fe-d785-4c27-876d-6ccba660fa2b"
            };

            try {
                // process an auto-capture authorization
                var hppJson = service.Charge(19.99m)
                              .WithHostedPaymentData(hostedPaymentData)
                              .WithCurrency("EUR")
                              .Serialize();


                return(Content(hppJson));
            }

            catch (ApiException exce) {
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }
示例#14
0
        public IActionResult CardHpp()
        {
            // configure client & request settings
            var service = new HostedService(new GatewayConfig
            {
                MerchantId          = "addonnettest",
                AccountId           = "api",
                SharedSecret        = "secret",
                ServiceUrl          = "https://hpp.sandbox.addonpayments.com/pay",
                HostedPaymentConfig = new HostedPaymentConfig
                {
                    Version           = "2",
                    DisplaySavedCards = true
                }
            });

            var hostedPaymentData = new HostedPaymentData
            {
                OfferToSaveCard = true,
                CustomerExists  = true,
                CustomerKey     = "3e3b6f0b-3fde-441d-b1e6-32ce927b0ad9"
                                  // supply your own reference for any new card saved
                                  // PaymentKey = "48fa69fe-d785-4c27-876d-6ccba660fa2b"
            };

            try {
                // process an auto-capture authorization
                var hppJson = service.Charge(19.99m)
                              .WithHostedPaymentData(hostedPaymentData)
                              .WithCurrency("EUR")
                              .Serialize();


                return(Content(hppJson));
            }

            catch (ApiException exce) {
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }
        public IActionResult DeletecardApi(Datos detalles)
        {
            // configure client & request settings
            ServicesContainer.ConfigureService(new GatewayConfig {
                MerchantId   = "addonnettest",
                AccountId    = "api",
                SharedSecret = "secret",
                ServiceUrl   = "https://remote.sandbox.addonpayments.com/remote"
            });

            // Identificador del cliente
            var customerId = detalles.Cliente.payerref;

            // Identificador de la tarjeta
            var paymentId = detalles.Cliente.paymentmethod;

            // Asociamos la tarjeta al cliente
            var paymentMethod = new RecurringPaymentMethod(customerId, paymentId);

            try {
                // process an auto-capture authorization
                paymentMethod.Delete();

                Respuesta respuesta = new Respuesta {
                    result = "Tarjeta eliminada correctamente."
                };

                return(Ok(respuesta));
            }

            catch (ApiException exce) {
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }
示例#16
0
        public IActionResult Authhpp()
        {
            // configure client & request settings
            var service = new HostedService(new GatewayConfig {
                MerchantId          = "addonnettest",
                AccountId           = "api",
                SharedSecret        = "secret",
                ServiceUrl          = "https://hpp.sandbox.addonpayments.com/pay",
                HostedPaymentConfig = new HostedPaymentConfig {
                    Version = "2"
                }
            });

            // Add 3D Secure 2 Mandatory and Recommended Fields
            var hostedPaymentData = new HostedPaymentData
            {
                CustomerEmail       = "*****@*****.**",
                CustomerPhoneMobile = "914353028",
                AddressesMatch      = false
            };

            var billingAddress = new Address
            {
                StreetAddress1 = "Dirección de facturación 1",
                StreetAddress2 = "Dirección de facturación 2",
                StreetAddress3 = "Dirección de facturación 3",
                City           = "Elche",
                PostalCode     = "03201",
                Country        = "826"
            };

            var shippingAddress = new Address
            {
                StreetAddress1 = "Dirección de envío 1",
                StreetAddress2 = "Dirección de envío 2",
                StreetAddress3 = "Dirección de envío 3",
                City           = "Elche",
                State          = "ES",
                PostalCode     = "03201",
                Country        = "724",
            };

            try {
                // Lanzamos la operación al servidor de Addon Payments
                var hppJson = service.Charge(19.99m)
                              .WithCurrency("EUR")
                              .WithHostedPaymentData(hostedPaymentData)
                              .WithAddress(billingAddress, AddressType.Billing)
                              .WithAddress(shippingAddress, AddressType.Shipping)
                              .Serialize();


                return(Content(hppJson));
            }

            catch (ApiException exce) {
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }
        public IActionResult DetallesAuth(Datos detalles)
        {
            // configure client & request settings
            ServicesContainer.ConfigureService(new GatewayConfig {
                MerchantId   = "addonnettest",
                AccountId    = "api",
                SharedSecret = "secret",
                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,
                Cvn            = detalles.Tarjeta.cvn,
                CardHolderName = detalles.Tarjeta.cardholderName
            };

            // Cliente
            var customer = new Customer
            {
                FirstName         = detalles.Cliente.nombre,
                LastName          = detalles.Cliente.apellidos,
                DateOfBirth       = detalles.Cliente.cumple,
                CustomerPassword  = detalles.Cliente.pass,
                Email             = detalles.Cliente.email,
                HomePhone         = detalles.Cliente.homephone,
                DeviceFingerPrint = detalles.Cliente.device
            };

            // Dirección de facturación
            var facturacion = new Address
            {
                StreetAddress1 = detalles.Billing.billing1,
                StreetAddress2 = detalles.Billing.billing2,
                StreetAddress3 = detalles.Billing.billing3,
                City           = detalles.Billing.billingcity,
                Province       = detalles.Billing.billingprovince,
                State          = detalles.Billing.billingstate,
                PostalCode     = detalles.Billing.billingcode,
                Country        = detalles.Billing.billingcountry
            };

            // Dirección de envío
            var envio = new Address
            {
                StreetAddress1 = detalles.Shipping.street1,
                StreetAddress2 = detalles.Shipping.street2,
                StreetAddress3 = detalles.Shipping.street3,
                City           = detalles.Shipping.enviocity,
                Province       = detalles.Shipping.envioprovince,
                State          = detalles.Shipping.enviostate,
                PostalCode     = detalles.Shipping.enviocode,
                Country        = detalles.Shipping.enviocountry
            };

            try {
                // process an auto-capture authorization
                Transaction response = card.Charge(detalles.Tarjeta.importe)
                                       .WithCurrency("EUR")
                                       .WithAddress(facturacion, AddressType.Billing)
                                       .WithAddress(envio, AddressType.Shipping)
                                       .WithCustomerData(customer)
                                       .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
                var schemeReferenceData = response.SchemeId;          // MMC0F00YE4000000715

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

                return(Ok(respuesta));
            }

            catch (ApiException exce) {
                RespuestaError respuesta = new RespuestaError {
                    resultado = "Error en el envío de datos <br><br>" + exce
                };
                return(BadRequest(respuesta));
            }
        }