Link de Pago
Crea un link de pago fácilmente a través de API en 4 simples pasos y compártelo con tus clientes.
Es una solución de cobro práctica y rápida que te permite vender online, ofreciendo todos los medios de pago disponibles, incluso Meses Sin interés, sin necesidad de tener una tienda en línea ni conocimientos técnicos o de programación.
Puedes crear:
- Link Único -> Para un sólo cobro con producto, monto e información de cliente definida.
- Link Múltiple -> Para utilizar y compartir las veces que sea necesario, con monto y producto definidos.
Puedes crearlos tanto desde tu Panel de Conekta como por API.
En el siguiente paso a paso te mostraremos como puedes hacerlo utilizando las APIs de Conekta. A su vez, te compartimos un video explicativo del proceso a continuación.
En caso de que necesites ayuda creando un link de pago desde tu cuenta de Conekta, puedes ingresar al siguiente link para ver un video explicativo.
Paso a paso
Paso 1 - Obtén tus API Keys
Dentro de la sección "Desarrolladores" del panel de tu cuenta de Conekta, encontrarás dos sets de credenciales que te serán útiles a la hora de comenzar tu desarrollo.
API Keys de prueba: Puedes utilizarlas para las pruebas a medida que llevas a cabo tu integración.
API Keys de producción: Utilizando estas credenciales, comenzarás a recibir pagos reales con tus links de pago.
Recomendamos realizar la integración y pruebas con las "API Keys de prueba", y una vez se haya corroborado el buen funcionamiento de todo el flujo cambiarlas por las de producción.
Para la creación de Link de pago solamente será necesario que utilices tu llave privada.
Paso 2 - Decide cómo te comunicarás con nuestras APIs
Para comunicarte con nuestras APIs e integrar el Link de pago de Conekta tienes dos opciones distintas:
-
Vía SDK: Puedes utilizar uno de nuestros distintos SDKs (Software Developer Kits) con nuestros métodos predefinidos.
-
Por API: En caso de que tu integración no sea compatible con uno de nuestros SDKs, o prefieras hacer la conexión directa, puedes definir llamados directamente contra nuestras APIs.
En caso de que desees ir por la opción 1 deberás instalar uno de los SDK antes de continuar, caso contrario, puedes seguir avanzando con el instructivo. Igualmente a continuación te mostraremos ejemplos para que puedas integrarlo de la manera que desees.
Paso 3 - Crea tu link de pago
Link de uso múltiple
Si deseas que tu link pueda ser utilizado más de una vez para múltiples usuarios, la bandera de recurrent debería estar en true y el número máximo de pagos permitidos. Como se muestra a continuación.
curl --request POST \
--url https://api.conekta.io/checkouts \
--header 'accept: application/vnd.conekta-v2.0.0+json' \
-u key_eYvWV7gSDkNYXsmr: \
--header 'content-type: application/json' \
--data '{
"name": "Payment Link Name",
"type": "PaymentLink",
"recurrent": true,
"payments_limit_count": 3,
"expired_at": 1590882634,
"allowed_payment_methods": ["cash", "card", "bank_transfer"],
"needs_shipping_contact": true,
"monthly_installments_enabled": true,
"monthly_installments_options": [3, 6, 9, 12],
"order_template": {
"line_items": [{
"name": "Red Wine",
"unit_price": 1000,
"quantity": 10
}],
"metadata": {
"mycustomkey": "12345",
"othercustomkey": "abcd"
},
"currency": "MXN"
}
}'
<?php
$validCheckout = [
'name' => "Payment Link Name",
'type' => "PaymentLink",
'recurrent' => true,
'payments_limit_count' => 3,
'expired_at' => 1600882634,
'allowed_payment_methods' => ["cash", "card", "bank_transfer"],
'needs_shipping_contact' => true,
'monthly_installments_enabled' => true,
'monthly_installments_options' => [3, 6, 9, 12],
'order_template' => [
'line_items' => [[
'name' => "Red Wine",
'unit_price' => 1000,
'quantity' => 10
]],
'metadata' => [
'mycustomkey' => "12345",
'othercustomkey' => "abcd"
],
'currency' => "MXN",
'customer_info' => [
'name' => "Juan Perez",
'email' => "[email protected]",
'phone' => "5566982090"
]
]
];
$checkout = Checkout::create($validCheckout);
valid_checkout = {
name: "Payment Link Name",
type: "PaymentLink",
recurrent: true,
payments_limit_count: 3,
expired_at: 1607848572,
allowed_payment_methods: ["cash", "card", "bank_transfer"],
needs_shipping_contact: true,
monthly_installments_enabled: true,
monthly_installments_options: [3, 6, 9, 12],
order_template: {
line_items: [{
name: "Red Wine",
unit_price: 200000,
quantity: 1
}],
metadata: {
mycustomkey: "12345",
othercustomkey: "abcd"
},
currency: "MXN"
}
}
checkout = Conekta::Checkout.create(valid_checkout)
checkout = conekta.Checkout.create({
"name": "Payment Link Name",
"type": "PaymentLink",
"recurrent": True,
"expired_at": 1590882634,
"payments_limit_count": 3,
"allowed_payment_methods": ["cash", "card", "bank_transfer"],
"needs_shipping_contact": True,
"monthly_installments_enabled": False,
"monthly_installments_options": [3, 6, 9, 12],
"order_template": {
"line_items": [{
"name": "Red Wine",
"unit_price": 1000,
"quantity": 10
}],
"currency": "MXN",
"customer_info": {
"customer_id": "cus_2oAokFrKM7CyVxGJm"
},
"metadata": {
"mycustomkey": "12345",
"othercustomkey": "abcd"
}
}
})
conekta.Checkout.create({
"name": "Payment Link Name",
"type": "PaymentLink",
"recurrent": true,
"expired_at": 1590882634,
"payments_limit_count": 3,
"allowed_payment_methods": ["cash", "card", "bank_transfer"],
"needs_shipping_contact": true,
"monthly_installments_enabled": false,
"monthly_installments_options": [3, 6, 9, 12],
"order_template": {
"line_items": [{
"name": "Red Wine",
"unit_price": 1000,
"quantity": 10
}],
"currency": "MXN",
"customer_info": {
"customer_id": "cus_2oAokFrKM7CyVxGJm"
},
"metadata": {
"mycustomkey": "12345"
}
}
}, function(err, res) {
if(err){
console.log(err);
return;
}
console.log(res.toObject());
});
using Newtonsoft.Json;
var validCheckout = new
{
checkout = new
{
name = "Payment Link Name",
type = "PaymentLink",
recurrent = true,
expired_at = 1607848572,
allowed_payment_methods = new string[]
{
"cash",
"card",
"bank_transfer"
},
payments_limit_count = 3,
needs_shipping_contact = true,
monthly_installments_enabled = true,
monthly_installments_options = new int[]
{
3,
6,
9,
12
},
order_template: new
{
line_items = new
[
new
{
name = "Red Wine",
unit_price = 200000,
quantity = 1
}
],
metadata: new
{
mycustomkey = "12345",
othercustomkey = "abcd"
},
currency: "MXN",
customer_info = new
{
name = "Juan Perez",
email = "[email protected]",
phone = "5566982090"
}
}
}
};
var checkout = new Checkout()
.create(JsonConvert.SerializeObject(validCheckout));
checkoutParams := &conekta.Checkout{
AllowedPaymentMethods: []string{"cash", "card", "bank_transfer"},
ExpiredAt: time.Now().Unix() + int64(259200) + int64(rand.Float64()*3600),
MonthlyInstallmentsEnabled: false,
MonthlyInstallmentsOptions: []int64{3, 6, 9, 12},
Name: "Payment Link Name",
NeedsShippingContact: true,
OrderTemplate: &OrderParams{
Currency: "MXN",
LineItems: []*LineItemsParams{
{
Name: "Red Wine",
UnitPrice: 1000,
Quantity: 10,
},
},
CustomerInfo: &CustomerParams{
ID: "cus_2oAokFrKM7CyVxGJm",
},
},
PaymentsLimitCount: 3,
Recurrent: true,
Type: "PaymentLink",
}
checkout.Create(checkoutParams)
try {
Checkout checkout = Checkout.create(
new JSONObject("{" +
" 'name': 'Payment Link Name'," +
" 'type': 'PaymentLink'," +
" 'recurrent': true," +
" 'expired_at': " + Long.toString(System.currentTimeMillis() / 1000L + 259200L) + "," +
" 'allowed_payment_methods': ['cash', 'card', 'bank_transfer']," +
" 'monthly_installments_enabled': false," +
" 'monthly_installments_options': [3, 6, 9, 12]," +
" 'needs_shipping_contact': true," +
" 'order_template': {" +
" 'line_items': [{" +
" 'name': 'Red Wine'," +
" 'unit_price': 1000," +
" 'quantity': 10" +
" }]," +
" 'currency': 'MXN'," +
" 'customer_info': {" +
" 'customer_id': 'cus_2oAokFrKM7CyVxGJm'",
" }," +
" 'metadata': {" +
" 'mycustomkey': '12345'",
" }" +
" }," +
" 'payments_limit_count': 3" +
" }")
);
} catch (Conekta::Error e) {
System.out.println(e.details.get(0).message);
}
Link de único uso
Para un sólo cobro con producto, monto e información de cliente definida. El siguiente snippet incorpora todas las partes del paso 1. Copia y pega el siguiente fragmento de código en tu sandbox y corre el código para crear a un checkout object y opcionalmente también puedes enviarlo por correo electrónico ó SMS.
Para más información sobre las diferentes partes del snippet favor de seguir el resto del tutorial.
curl --request POST \
--url https://api.conekta.io/checkouts \
--header 'accept: application/vnd.conekta-v2.0.0+json' \
-u key_eYvWV7gSDkNYXsmr: \
--header 'content-type: application/json' \
--data '{
"name": "Payment Link Name",
"type": "PaymentLink",
"recurrent": false,
"expires_at": 1590882634,
"allowed_payment_methods": ["cash", "card", "bank_transfer"],
"needs_shipping_contact": true,
"monthly_installments_enabled": true,
"monthly_installments_options": [3, 6, 9, 12],
"order_template": {
"line_items": [{
"name": "Red Wine",
"unit_price": 1000,
"quantity": 10
}],
"metadata": {
"mycustomkey": "12345",
"othercustomkey": "abcd"
},
"currency": "MXN",
"customer_info": {
"name": "Juan Perez",
"email": "[email protected]",
"phone": "5566982090"
}
}
}'
<?php
$validCheckout = [
'name' => "Payment Link Name",
'type' => "PaymentLink",
'recurrent' => false,
'expires_at' => 1600882634,
'allowed_payment_methods' => ["cash", "card", "bank_transfer"],
'needs_shipping_contact' => true,
'monthly_installments_enabled' => true,
'monthly_installments_options' => [3, 6, 9, 12],
'order_template' => [
'line_items' => [[
'name' => "Red Wine",
'unit_price' => 1000,
'quantity' => 10
]],
'metadata' => [
'mycustomkey' => "12345",
'othercustomkey' => "abcd"
],
'currency' => "MXN",
'customer_info' => [
'name' => "Juan Perez",
'email' => "[email protected]",
'phone' => "5566982090"
]
]
];
$checkout = Checkout::create($validCheckout);
valid_checkout = {
name: "Payment Link Name",
type: "PaymentLink",
recurrent: false,
expires_at: 1607848572,
allowed_payment_methods: ["cash", "card", "bank_transfer"],
needs_shipping_contact: true,
monthly_installments_enabled: true,
monthly_installments_options: [3, 6, 9, 12],
order_template: {
line_items: [{
name: "Red Wine",
unit_price: 200000,
quantity: 1
}],
metadata: {
mycustomkey: "12345",
othercustomkey: "abcd"
},
currency: "MXN",
customer_info: {
name: "Juan Perez",
email: "[email protected]",
phone: "5566982090"
}
}
}
checkout = Conekta::Checkout.create(valid_checkout)
checkout = conekta.Checkout.create({
{
"name": "Payment Link Name",
"type": "PaymentLink",
"recurrent": False,
"expires_at": 1590882634,
"allowed_payment_methods": ["cash", "card", "bank_transfer"],
"needs_shipping_contact": True,
"monthly_installments_enabled": False,
"monthly_installments_options": [3, 6, 9, 12],
"order_template": {
"line_items": [{
"name": "Red Wine",
"unit_price": 1000,
"quantity": 10
}],
"currency": "MXN",
"customer_info": {
"customer_id": "cus_2oAokFrKM7CyVxGJm"
},
"metadata": {
"mycustomkey": "12345",
"othercustomkey": "abcd"
}
}
}
})
conekta.Checkout.create({
{
"name": "Payment Link Name",
"type": "PaymentLink",
"recurrent": false,
"expires_at": 1590882634,
"allowed_payment_methods": ["cash", "card", "bank_transfer"],
"needs_shipping_contact": true,
"monthly_installments_enabled": false,
"monthly_installments_options": [3, 6, 9, 12],
"order_template": {
"line_items": [{
"name": "Red Wine",
"unit_price": 1000,
"quantity": 10
}],
"currency": "MXN",
"customer_info": {
"customer_id": "cus_2oAokFrKM7CyVxGJm"
},
"metadata": {
"mycustomkey": "12345"
}
}
}
}, function(err, res) {
if(err){
console.log(err);
return;
}
console.log(res.toObject());
});
using Newtonsoft.Json;
var validCheckout = new
{
checkout = new
{
name = "Payment Link Name",
type = "PaymentLink",
recurrent = false,
expires_at = 1607848572,
allowed_payment_methods = new string[]
{
"cash",
"card",
"bank_transfer"
},
needs_shipping_contact = true,
monthly_installments_enabled = true,
monthly_installments_options = new int[]
{
3,
6,
9,
12
},
order_template: new
{
line_items = new
[
new
{
name = "Red Wine",
unit_price = 200000,
quantity = 1
}
],
metadata: new
{
mycustomkey = "12345",
othercustomkey = "abcd"
},
currency: "MXN",
customer_info = new
{
name = "Juan Perez",
email = "[email protected]",
phone = "5566982090"
}
}
}
};
var checkout = new Checkout()
.create(JsonConvert.SerializeObject(validCheckout));
import (
conekta "github.com/conekta/conekta-go"
"github.com/conekta/conekta-go/checkout"
)
conekta.APIKey = "key_pMcnDF4zFyWKyLG15LuqwA"
checkoutParams := &conekta.Checkout{
Name: "Payment Link Name",
Type: "PaymentLink",
Recurrent: false,
ExpiresAt: time.Now().Unix() + int64(259200) + int64(rand.Float64()*3600),
AllowedPaymentMethods: []string{"cash", "card", "bank_transfer"},
NeedsShippingContact: true,
MonthlyInstallmentsEnabled: false,
MonthlyInstallmentsOptions: []int64{3, 6, 9, 12},
OrderTemplate: &OrderParams{
Currency: "MXN",
LineItems: []*LineItemsParams{
{
Name: "Red Wine",
UnitPrice: 1000,
Quantity: 10,
},
},
CustomerInfo: &CustomerParams{
ID: "cus_2oAokFrKM7CyVxGJm",
},
},
}
checkout.Create(checkoutParams)
try {
Checkout checkout = Checkout.create(
new JSONObject("{" +
" 'name': 'Payment Link Name'," +
" 'type': 'PaymentLink'," +
" 'recurrent': false," +
" 'expires_at': " + Long.toString(System.currentTimeMillis() / 1000L + 259200L) + "," +
" 'allowed_payment_methods': ['cash', 'card', 'bank_transfer']," +
" 'needs_shipping_contact': true," +
" 'monthly_installments_enabled': false," +
" 'monthly_installments_options': [3, 6, 9, 12]," +
" 'order_template': {" +
" 'line_items': [{" +
" 'name': 'Red Wine'," +
" 'unit_price': 1000," +
" 'quantity': 10" +
" }]," +
" 'currency': 'MXN'," +
" 'customer_info': {" +
" 'customer_id': 'cus_2oAokFrKM7CyVxGJm'",
" }," +
" 'metadata': {" +
" 'mycustomkey': '12345'",
" }" +
" }" +
" }")
);
} catch (Conekta::Error e) {
System.out.println(e.details.get(0).message);
}
Notas.
La fecha de expiración puede ser un timestamp comprendido entre 2 a 365 días (el rango válido se tomará a partir del siguiente día de fecha de creación a las 00:01 hrs)
El campo de metadata sirve para ingresar información custom. Máximo 100 elementos y permite caracteres especiales en el valor.
En caso de que quieras guardar la información de tu cliente para futuros links, puedes hacer una llamada a nuestra API de customers con la información del usuario para obtener el id del mismo y enviarlo con la creación del link.
curl -H "Accept: application/vnd.conekta-v2.0.0+json"\
-H "Content-type: application/json" \
-u key_XXXXXXXXX: \
-X POST -d '{
"name": "Juan Perez",
"email": "[email protected]",
"phone": "5566982093",
"shipping_contacts": [{
"phone": "+5566982090",
"receiver": "Juan Perez",
"address": {
"street1": "Nuevo Leon 254",
"country": "MX",
"postal_code": "06100"
}
}]
}' https://api.conekta.io/customers
<?php
$customer = \Conekta\Customer::create(
[
'name' => "Juan Perez",
'email' => "[email protected]",
'phone' => "5566982093",
'shipping_contacts' => [
[
'phone' => "+5566982090",
'receiver' => "Juan Perez",
'address' => [
'street1' => "Nuevo Leon 254",
'country' => "MX",
'postal_code' => "06100"
]
]
]
]
);
customer = Conekta::Customer.create(
{
name: "Juan Perez",
email: "[email protected]",
phone: "5566982093",
shipping_contacts: [
{
phone: "+5566982090",
receiver: "Juan Perez",
address: {
street1: "Nuevo Leon 254",
country: "MX",
postal_code: "06100"
}
}
]
}
)
customer = Conekta.Customer.create(
{
name: "Juan Perez",
email: "[email protected]",
phone: "5566982093",
shipping_contacts: [
{
phone: "+5566982090",
receiver: "Juan Perez",
address: {
street1: "Nuevo Leon 254",
country: "MX",
postal_code: "06100"
}
}
]
}
)
conekta.Customer.create(
{
name: "Juan Perez",
email: "[email protected]",
phone: "5566982093",
shipping_contacts: [
{
phone: "+5566982090",
receiver: "Juan Perez",
address: {
street1: "Nuevo Leon 254",
country: "MX",
postal_code: "06100"
}
}
]
}, function(err, res) {
if(err){
console.log(err);
return;
}
console.log(res.toObject());
});
using Newtonsoft.Json;
var validCustomer = new
{
name = "Payment Link Name",
email = "[email protected]",
phone = "5566982093",
shipping_contacts: new
[
new
{
phone = "+5566982090",
receiver = "Juan Perez",
address = new
{
street1 = "Nuevo Leon 254",
country = "MX",
postal_code = "06100"
}
}
]
};
var customer = new Customer().create(validCustomer);
customerParams := &conekta.CustomerParams{
Name: "Juan Perez",
Email: "[email protected]",
Phone: "5566982093",
ShippingContacts: [](*ShippingContactParams){
{
Phone: "5566982093",
Receiver: "Juan Perez",
Address: &Address{
Street1: "Nuevo Leon 254",
Country: "MX",
PostalCode: "06100",
},
},
}
}
customerResponse, err := customer.Create(customerParams)
Customer customer = Customer.create(
new JSONObject("{"
+ "'name': 'Fulanito Pérez', "
+ "'email': '[email protected]'"
+ "}"
)
);
Cuando crees el próximo link sólo tendrás que cambiar la sección de customer info y enviar el customer_id (obtenido con la llamada que se muestra arriba) en lugar de toda la info del cliente. Ejemplo:
"customer_info": {
"customer_id": "cus_2rAaKde2wPBczbX8u"
}
Puedes ver más info de nuestros recursos de customers en nuestra API Reference
Paso 4 - Comparte tu link de pago con tus customers
Una vez creado el link de pago, recibirás la url a compartir con tus clientes en la respuesta. Puedes compartirla de la manera que desees.
{
"id": "42a4c95e-0db2-4ae8-9bb3-ea681acc8281",
"object": "checkout",
"name": "Payment Link Name",
"url": "https://pay.conekta.com/link/42a4c95e0db24ae89bb3ea681acc8281",
"slug": "42a4c95e0db24ae89bb3ea681acc8281",
"status": "Issued",
"type": "PaymentLink",
"expired_at": 1590882634,
"allowed_payment_methods": ["cash", "card", "bank_transfer"],
"needs_shipping_contact": true,
"monthly_installments_options": [3, 6, 9, 12],
"monthly_installments_enabled": true,
"livemode": true
}
<?Php
echo $checkout->id;
echo $checkout->object;
echo $checkout->name;
echo $checkout->url;
echo $checkout->slug;
echo $checkout->livemode;
echo $checkout->monthly_installments_enabled;
var_dump((array) $checkout->monthly_installments_options);
puts checkout.id
puts checkout.object
puts checkout.name
puts checkout.url
puts checkout.slug
puts checkout.livemode
puts checkout.monthly_installments_enabled
puts checkout.monthly_installments_options.inspect
print(checkout.id)
print(checkout.object)
print(checkout.name)
print(checkout.url)
print(checkout.slug)
print(checkout.livemode)
print(checkout.monthly_installments_enabled)
print(checkout.monthly_installments_options.inspect)
console.log(checkout.id)
console.log(checkout.object)
console.log(checkout.name)
console.log(checkout.url)
console.log(checkout.slug)
console.log(checkout.livemode)
console.log(checkout.monthly_installments_enabled)
console.log(checkout.monthly_installments_options)
Console.WriteLine(checkout.id);
Console.WriteLine(checkout._object);
Console.WriteLine(checkout.name);
Console.WriteLine(checkout.url);
Console.WriteLine(checkout.slug);
Console.WriteLine(checkout.livemode);
Console.WriteLine(checkout.monthly_installments_enabled);
Console.WriteLine(checkout.monthly_installments_options.Length);
fmt.Println("Id: %v\n", checkoutResponse.ID)
fmt.Println("Object: %v\n", checkoutResponse.Object)
fmt.Println("Name: %v\n", checkoutResponse.Name)
fmt.Println("Url: %v\n", checkoutResponse.Url)
fmt.Println("Slug: %v\n", checkoutResponse.Slug)
fmt.Println("Livemode: %v\n", checkoutResponse.Live)
fmt.Println("MonthlyInstallmentsEnabled: %v\n", checkoutResponse.MonthlyInstallmentsEnabled)
fmt.Println("MonthlyInstallmentOptions: %v\n", checkoutResponse.MonthlyInstallmentsOptions)
System.out.println(checkout.allowed_payment_methods);
System.out.println(checkout.monthly_installments_enabled);
System.out.println(checkout.monthly_installments_options);
System.out.println(checkout.object);
System.out.println(checkout.type);
System.out.println(checkout.slug);
System.out.println(checkout.url);
Te ofrecemos la posibilidad de enviar un email con el link de pago a través de nuestros sistemas. A su vez, desde tu panel de Conekta, ingresando al detalle del link creado, podrás enviarlo por Whatsapp y otros medios desde tu celular.
curl --request POST \
--url https://api.conekta.io/checkouts/42a4c95e-0db2-4ae8-9bb3-ea681acc8281/email \
--header 'accept: application/vnd.conekta-v2.0.0+json' \
-u key_eYvWV7gSDkNYXsmr: \
--header 'content-type: application/json' \
--data '{
"email": "[email protected]"
}'
<?php
$checkout->sendEmail(['email' => '[email protected]']);
checkout.send_email(email: '[email protected]')
Checkout.sendEmail({
"id": "05b25724-df59-4925-8762-105d627875fd"
"name": "Payment Link Name",
"type": "checkout",
"recurrent": True,
"expired_at": 1590882634,
"allowed_payment_methods": ["cash", "card", "bank_transfer"],
"needs_shipping_contact": True,
"monthly_installments_enabled": True,
"monthly_installments_options": [3, 6, 9, 12],
"order_template": {
"line_items": [{
"name": "Red Wine",
"unit_price": 1000,
"quantity": 10
}],
"currency": "MXN",
"customer_info": {
"name": "Juan Perez",
"email": "[email protected]",
"phone": "5566982090"
}
}
})
checkout.sendEmail({email: "[email protected]"}, function(err, res) {
if(err){
console.log(err);
return;
}
console.log(res.toObject());
});
using Newtonsoft.Json;
var parameters = new
{
email = "[email protected]'"
};
checkout.send_email(JsonConvert.SerializeObject(parameters));
checkout.SendEmail(checkoutResponse.ID, "[email protected]")
checkout.send_email('[email protected]');
Anexo
Configuración de Meses sin interés
Puedes configurar el link para que pueden funcionar con meses sin intereses si en las peticiones agregas estas dos variables: monthly_installments_enabled para activarlo y monthly_installments_options con los meses habilitados, dentro del objeto de "Checkout"
Ejemplo:
"monthly_installments_enabled": true, "monthly_installments_options": [3, 6, 9, 12, 18] Consideraciones para MSI. * Monto mínimo para meses sin intereses es $300 MXN
Toma en cuenta la siguiente tabla:
Umbral de Monto (MXN) | MSI |
---|---|
$300-$599 | Permite 3 MSI (todos los bancos) |
$600-$899 | Permite hasta 6 MSI (todos los bancos) |
$900-$1199 | Permite hasta 9 MSI (todos los bancos) |
$1200-$1790 | Permite hasta 12 MSI (todos los bancos) |
$1800-En adelante | Permite hasta 18 MSI (Solo Citibanamex) |
Notificaciones de los cobros
Si tienes configurado un webhook tu puedes recibir el evento charge.paid cada que se reciba un pago exitoso.
# N/A
<?php
$body = @file_get_contents('php://input');
$data = json_decode($body);
http_response_code(200); // Return 200 OK
if ($data->type == 'charge.paid'){
$msg = "Tu pago ha sido comprobado.";
mail("[email protected]","Pago confirmado",$msg);
}
//Using nodemailer
var data = typeof req.body == 'string' ? JSON.parse(req.body) : req.body;
if (data.type == 'order.paid') {
var mail = {
from: me,
to: you,
subject: 'Pago comprobado',
text: 'Tu pago ha sido confirmado.'
};
transporter.sendMail(mail, function(error, info){
if(error){ return console.log(error); }
});
}
import (
"json"
"log"
"net/http"
)
func notificationHandler(w http.ResponseWriter, r *http.Request) {
var objmap map[string]json.RawMessage
err := json.Unmarshal(data, &objmap)
if (objmap["type"] == "order.paid"){
//Do something
}
w.Write([]byte("OK"))
}
func main() {
http.HandleFunc("/my-notification-endpoint", notificationHandler)
err := http.ListenAndServe(":9090", nil)
if err != nil {
log.Fatal("ListenAndServe: ", err)
}
}
import org.json.JSONObject;
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
BufferedReader get_body = request.getReader();
//Parse JSON
}
Botón de pago
¿No eres desarrollador y quieres agregar un botón de pago en tu sitio/landing de ventas?
En Conekta te facilitamos la posibilidad de agregar tus links de pago como botones en tu sitio.
Para los links de pago múltiples proporcionamos un HTML predefinido para que puedas utilizar los mismos en tu sitio web. Para más información ir a la sección de botón de pago .
Si tienes alguna duda sobre el producto puedes visitar nuestras FAQS.
Cancelaciones
Si necesitas cancelar un link previamente creado, se puede hacer a través de nuestra API.
curl --request PUT \
--url https://apipp.conekta.io/checkouts/019b2693-18e6-4094-8bd1-5530bcad5906/cancel \
--header 'accept: application/vnd.conekta-v2.0.0+json' \
-u key_eYvWV7gSDkNYXsmr: \
--header 'content-type: application/json' \
--data '{}'
<?php
$checkout->cancel();
checkout.cancel()
Checkout.cancel()
checkout.cancel(function(err, res) {
if(err){
console.log(err);
return;
}
console.log(res.toObject());
});
checkout.cancel();
checkout.Cancel(checkoutResponse.ID)
checkout.cancel();