Skip to main content

Card register

In this case, users are offered the option of registering their credit or debit card in the payment gateway for future transactions. for future transactions. This involves tokenizing the card data, i.e. converting it into a unique identifier called a token. called a token. In this way, users can make subsequent payments without having to provide full card details again. card details again.

Objective

You will learn how to:

  • Create the configuration object.
  • Initialize the payment form.
  • Display the Checkout.
  • Sample response.

1. Creating the configuration object

const iziConfig = {
config: {
...,
action: 'register',
...
}
};

2. Instantiating the class

const checkout = new Izipay({config: iziConfig});

3. Displaying the checkout

const callbackResponsePayment = (response) => console.log(response);

try {
checkout &&
checkout.LoadForm({
authorization: 'TU_TOKEN_SESSION',
keyRSA: 'TU_KEY_RSA',
callbackResponse: callbackResponsePayment
});
} catch (error) {
console.log(error.message, error.Errors, error.date);
}

4. Response

  • This is an example of a response that will be sent to the merchant after the flow is completed
{
"code": "00",
"message": "Operación exitosa",
"messageUser": "Operación exitosa",
"messageUserEng": "Successful",
"response": {
"payMethod": "CARD",
"order": [
{
"payMethodAuthorization": "CARD",
"codeAuth": "",
"currency": "PEN",
"amount": "149.00",
"installment": "",
"deferred": "",
"orderNumber": "1719866030",
"stateMessage": "Autorizado",
"dateTransaction": "20240701",
"timeTransaction": "153351",
"uniqueId": "",
"referenceNumber": ""
}
],
"card": {
"brand": "VS",
"pan": "476134******0019",
"save": "true"
},
"billing": {
"firstName": "Luis",
"lastName": "Quispe",
"email": "luisquispetaquire@gmail.com",
"phoneNumber": "989339999",
"street": "calle el demo",
"city": "lima",
"state": "lima",
"country": "PE",
"postalCode": "00001",
"documentType": "DNI",
"document": "10252022",
"companyName": ""
},
"merchant": {
"merchantCode": "4001061",
"facilitatorCode": ""
},
"token": {
"merchantBuyerId": "MC2407011533571D8KA6",
"cardToken": "f2fb3565d76df7c0c850c01b94d147a9cd986f1496527411102ea63155a384d9",
"alias": ""
},
"authentication": {
"result": ""
},
"customFields": [
{
"name": "field1",
"value": ""
},
{
"name": "field2",
"value": ""
},
{
"name": "field3",
"value": ""
},
{
"name": "field4",
"value": ""
},
{
"name": "field5",
"value": ""
},
{
"name": "field6",
"value": ""
},
{
"name": "field7",
"value": ""
},
{
"name": "field8",
"value": ""
},
{
"name": "field9",
"value": ""
},
{
"name": "field10",
"value": ""
}
]
},
"payloadHttp": "{\"code\":\"00\",\"message\":\"Operación exitosa\",\"messageUser\":\"Operación exitosa\",\"messageUserEng\":\"Successful\",\"transactionId\":\"171986603174100\",\"response\":{\"payMethod\":\"CARD\",\"order\":[{\"payMethodAuthorization\":\"CARD\",\"codeAuth\":\"\",\"currency\":\"PEN\",\"amount\":\"149.00\",\"installment\":\"\",\"deferred\":\"\",\"orderNumber\":\"1719866030\",\"stateMessage\":\"Autorizado\",\"dateTransaction\":\"20240701\",\"timeTransaction\":\"153351\",\"uniqueId\":\"\",\"referenceNumber\":\"\"}],\"card\":{\"brand\":\"VS\",\"pan\":\"476134******0019\",\"save\":\"true\"},\"billing\":{\"firstName\":\"Luis\",\"lastName\":\"Quispe\",\"email\":\"luisquispetaquire@gmail.com\",\"phoneNumber\":\"989339999\",\"street\":\"calle el demo\",\"city\":\"lima\",\"state\":\"lima\",\"country\":\"PE\",\"postalCode\":\"00001\",\"documentType\":\"DNI\",\"document\":\"10252022\",\"companyName\":\"\"},\"merchant\":{\"merchantCode\":\"4001061\",\"facilitatorCode\":\"\"},\"token\":{\"merchantBuyerId\":\"MC2407011533571D8KA6\",\"cardToken\":\"f2fb3565d76df7c0c850c01b94d147a9cd986f1496527411102ea63155a384d9\",\"alias\":\"\"},\"authentication\":{\"result\":\"\"},\"customFields\":[{\"name\":\"field1\",\"value\":\"\"},{\"name\":\"field2\",\"value\":\"a\"},{\"name\":\"field3\",\"value\":\"\"},{\"name\":\"field4\",\"value\":\"\"},{\"name\":\"field5\",\"value\":\"\"},{\"name\":\"field6\",\"value\":\"\"},{\"name\":\"field7\",\"value\":\"\"},{\"name\":\"field8\",\"value\":\"\"},{\"name\":\"field9\",\"value\":\"\"},{\"name\":\"field10\",\"value\":\"\"}]}}",
"signature": "PgIinGqUyI/XKLcB49v22gFe8Pt9djk6EG/QETMYChg=",
"transactionId": "171986603174100"
}

Demo

Next, we invite you to explore our interactive demo.

Live editor
Result
Loading...