public void Test_002b_EditPaymentMethod() { var paymentMethod = new RecurringPaymentMethod(CustomerId, PaymentId("Credit")); paymentMethod.PaymentMethod = new CreditCardData { Number = "5425230000004415", ExpMonth = 10, ExpYear = DateTime.Now.AddYears(2).Year, CardHolderName = "Philip Marlowe" }; paymentMethod.SaveChanges("test"); }
public void Test_002c_EditPaymentMethodExpOnly() { var paymentMethod = new RecurringPaymentMethod(CustomerId, PaymentId("Credit")); paymentMethod.PaymentMethod = new CreditCardData { CardType = "MC", ExpMonth = 10, ExpYear = DateTime.Now.AddYears(2).Year, CardHolderName = "Philip Marlowe" }; paymentMethod.SaveChanges("test"); }
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)); } }
public void Test_005b_EditPaymentMethodBadData() { var paymentMethod = new RecurringPaymentMethod("000000", "000000"); paymentMethod.SaveChanges(); }