Suscripciones con wallet
El módulo de suscripciones permite guardar y vincular las tarjetas a nivel suscriptor mediante la funcionalidad "Wallet".
De esta forma, al crear diferentes suscriptores con el mismo valor de referencia "customerReference", es posible seleccionar y modificar las tarjetas compartidas entre los mismos.
Ejemplo: Creación de Suscripción con Wallet
Cuando se crea una suscripción con Wallet se debe enviar el parámetro adicional walleten "true":
{
"total": 1000,
"currency": "ARS",
"name": "Suscripción con wallet",
"description": "Mobbex.dev",
"interval": "1m",
"trial": 0,
"reference": "subscription_A00111223",
"type": "manual",
"test": true,
"return_url": " https://mobbex.com",
"webhook": "https://webhook.com",
"wallet": true
}
Respuesta
{
"result": true,
"data": {
"uid": "H4QAGHOPE9QW6CUKVO",
"name": "Suscripción con wallet",
"description": "Mobbex.dev",
"interval": "1m",
"initialDay": -1,
"total": 1000,
"trial": 0,
"setupFee": 0,
"charge": "total",
"ccCutoffDay": -1,
"url": "https://mobbex.com/p/subscriptions/subscribe/H4QAGHOPE9QW6CUKVO",
"return_url": " https://mobbex.com",
"webhook": "https://webhook.com",
"shorten_url": "https://mobbex.com/p/subscriptions/subscribe/H4QAGHOPE9QW6CUKVO",
"test": true
}
}Ejemplo: Crear Suscriptor con Wallet
Llamando a la API de crear suscriptor, se debe agregar el parámetro "customerReference" válido que será la referencia del cliente en la wallet. Múltiples Suscriptores podrán hacer referencia al mismo Customer en la Wallet.
{
"customer":{
"email":"[email protected]",
"identification":"12123123",
"name":"Test Mobbex"
},
"reference": "R2332112121234",
"customerReference": "CR2332112121234",
"startDate":{
"day": 4,
"month": 2
}
}Respuesta
{
"result": true,
"data": {
"uid": "4QRF2DC5L8YUPIYQGY",
"reference": "R2332112121234",
"sourceUrl": "https://mobbex.com/p/subscriptions/H4QAGHOPE9QW6CUKVO/subscriber/4QRF2DC5L8YUPIYQGY/source",
"secondarySourceUrl": "https://mobbex.com/p/subscriptions/H4QAGHOPE9QW6CUKVO/subscriber/4QRF2DC5L8YUPIYQGY/source/secondary",
"subscriberUrl": "https://mobbex.com/p/subscriptions/H4QAGHOPE9QW6CUKVO/subscriber/4QRF2DC5L8YUPIYQGY",
"subscription": {
"uid": "H4QAGHOPE9QW6CUKVO"
}
}
}Obtener información con Wallet
var data = JSON.stringify({
"customer":{
"email":"[email protected]",
"identification":"12123123",
"name":"Test Mobbex"
},
"startDate":{
"day":27,
"month":3,
"year":2021
},
"reference":"233211212"});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.mobbex.com/p/subscriptions/T691POMK62SGC7CHAK/subscriber");
xhr.setRequestHeader("x-api-key", "zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj");
xhr.setRequestHeader("x-access-token", "d31f0721-2f85-44e7-bcc6-15e19d1a53cc");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);Ejemplo Obtener información con Wallet
GET https://api.mobbex.com/p/wallet/REF:CR2332112121234
Respuesta
{
"result": true,
"data": {
"uid": "4MR1URZ4D8FILOMNPU",
"reference": "CR2332112121234",
"test": true,
"customerData": {
"email": "[email protected]",
"identification": "12123123",
"name": "Test Demo"
},
"features": [],
"status": "active",
"sources": [
{
"uid": "W:T3J9TBMJFLVKU846WE",
"name": "Tarjeta terminada en 6691",
"type": "card",
"priority": "primary",
"card": {
"number": "47654068****6691",
"bin": "47654068",
"last4": "6691"
}
},
{
"uid": "W:36IXF2D0GYABJJYKXP",
"name": "Tarjeta terminada en 1008",
"type": "card",
"priority": "secondary",
"card": {
"number": "53236299****1008",
"bin": "53236299",
"last4": "1008"
}
}
],
"updated": "2025-02-04T17:40:14.689Z",
"created": "2025-02-04T17:40:14.689Z"
}
}Cambio de método de pago via Wallet
var data = JSON.stringify({
"customer":{
"email":"[email protected]",
"identification":"12123123",
"name":"Test Mobbex"
},
"startDate":{
"day":27,
"month":3,
"year":2021
},
"reference":"233211212"});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.mobbex.com/p/subscriptions/T691POMK62SGC7CHAK/subscriber");
xhr.setRequestHeader("x-api-key", "zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj");
xhr.setRequestHeader("x-access-token", "d31f0721-2f85-44e7-bcc6-15e19d1a53cc");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);Ejemplo Cambio de método de pago via Wallet
POST https://api.mobbex.com/p/subscriptions/H4QAGHOPE9QW6CUKVO/subscriber/5H1LBRT4WNGYFX3PUF/source
{
"token": "W:T3J9TBMJFLVKU846WE",
"securityCode": "200"
}Respuesta
{
"result": true,
"data": {
"status": "success",
"code": "200",
"text": "Operación Exitosa!",
"operation": {
"view": "default",
"options": {},
"id": "3EQRSGW7OJXHJDGADHN631",
"status": {
"code": "200",
"text": "Aprobado",
"message": "Transacción Aprobada",
"data": {},
"view": "default"
},
"total": 30.78,
"currency": {
"value": "TEST",
"label": "Test Money",
"symbol": "T$",
"locale": "es",
"isoCode": "000",
"exponent": 2,
"hidden": false
},
"data": [],
"actions": []
}
}
}