Crea un nuevo Método de Pago
Argumentos
Tipo | Descripción | |
---|---|---|
type | string | Tipo del método de pago. Por el momento los único tipos permitido son "card" y "oxxo_recurrent". |
token_id | string | Id de token que será utilizado para crear un método de pago de tipo "card". Ve el tutorial de suscripciones para más información sobre cómo tokenizar tarjetas. |
customer = Conekta::Customer.find("cus_zzmjKsnM9oacyCwV3")
source = customer.create_payment_source(type: "card", token_id: "tok_test_visa_4242")
curl -H "Accept: application/vnd.conekta-v2.0.0+json" \
-H "Content-type: application/json" \
-u key_eYvWV7gSDkNYXsmr: \
-X POST -d '{
"type": "card",
"token_id":"tok_test_visa_4242"
}' https://api.conekta.io/customers/cus_zzmjKsnM9oacyCwV3/payment_sources/
$customer = \Conekta\Customer::find("cus_zzmjKsnM9oacyCwV3");
$source = $customer->createPaymentSource([
'token_id' => 'tok_test_visa_4242',
'type' => 'card'
]);
conekta.Customer.find('cus_zzmjKsnM9oacyCwV3', function(err, customer) {
customer.createPaymentSource({
type: "card",
token_id: "tok_test_visa_4242"
}, function(err, res) {
console.log(res.toObject());
});
});
customer = conekta.Customer.find("cus_zzmjKsnM9oacyCwV3")
source = customer.createPaymentSource({
"type": "card",
"token_id": "tok_test_visa_4242"
})
Customer customer = Customer.find("cus_zzmjKsnM9oacyCwV3");
JSONObject paymentSourceJSON = new JSONObject("{"
+ "'token_id': 'tok_test_visa_4242',"
+ "'type': 'card'"
+ "}");
PaymentSource paymentSource = customer.createPaymentSource(paymentSourceJSON);
Customer customer = new conekta.Customer().find("cus_zzmjKsnM9oacyCwV3");
PaymentSource payment_source = customer.createPaymentSource(@"{
""type"": ""card"",
""token_id"": ""tok_test_visa_4242""
}");
import (
conekta "github.com/conekta/conekta-go"
"github.com/conekta/conekta-go/paymentsource"
)
paymentSourceParams := &conekta.PaymentSourceCreateParams{
TokenID: "tok_test_mastercard_4444",
PaymentType: "card",
}
paymentsource.Create("cus_zzmjKsnM9oacyCwV3", paymentSourceParams)