Skip to main content

Pay

This case allows users to make a payment using their credit or debit card information. The user provides the card information, such as the card number, expiration date and security code, to complete the transaction and process the payment.

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: 'pay',
...
}
};

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

Each payment method has its own response and here is an example of each, which will be sent to the merchant after completing the flow.

{
"code": "00",
"message": "Operación exitosa",
"messageUser": "Operación exitosa",
"messageUserEng": "Successful",
"response": {
"payMethod": "CARD",
"order": [
{
"payMethodAuthorization": "CARD",
"codeAuth": "831000",
"currency": "PEN",
"amount": "149.00",
"installment": "00",
"deferred": "0",
"orderNumber": "1737067728",
"stateMessage": "Autorizado",
"dateTransaction": "20250116",
"timeTransaction": "174837",
"uniqueId": "1429383",
"referenceNumber": "6330602"
}
],
"card": {
"brand": "MC",
"pan": "511842******6017",
"save": "false"
},
"billing": {
"firstName": "Lucho",
"lastName": "Torres",
"email": "luchotorres@gmail.com",
"phoneNumber": "989897960",
"street": "Av. Jorge Chávez 275",
"city": "Lima",
"state": "Lima",
"country": "PE",
"postalCode": "15000",
"documentType": "DNI",
"document": "12345678",
"companyName": ""
},
"merchant": {
"merchantCode": "4001061",
"facilitatorCode": ""
},
"token": {
"merchantBuyerId": "MC20250101",
"cardToken": "",
"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\":\"17370677285350\",\"response\":{\"payMethod\":\"CARD\",\"order\":[{\"payMethodAuthorization\":\"CARD\",\"codeAuth\":\"831000\",\"currency\":\"PEN\",\"amount\":\"149.00\",\"installment\":\"00\",\"deferred\":\"0\",\"orderNumber\":\"1737067728\",\"stateMessage\":\"Autorizado\",\"dateTransaction\":\"20250116\",\"timeTransaction\":\"174837\",\"uniqueId\":\"1429383\",\"referenceNumber\":\"6330602\"}],\"card\":{\"brand\":\"MC\",\"pan\":\"511842******6017\",\"save\":\"false\"},\"billing\":{\"firstName\":\"Lucho\",\"lastName\":\"Torres\",\"email\":\"luchotorres@gmail.com\",\"phoneNumber\":\"989897960\",\"street\":\"Av. Jorge Chávez 275\",\"city\":\"Lima\",\"state\":\"Lima\",\"country\":\"PE\",\"postalCode\":\"15000\",\"documentType\":\"DNI\",\"document\":\"12345678\",\"companyName\":\"\"},\"merchant\":{\"merchantCode\":\"4001061\",\"facilitatorCode\":\"\"},\"token\":{\"merchantBuyerId\":\"MC20250101\",\"cardToken\":\"\",\"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": "ddAlW9dl2/t5D3LwG3DpiWZPLmnowunw2XLo5MkxV9s=",
"transactionId": "17370677285350"
}
Important

Yape

  • The maximum amount of transactions with Yape must be less than or equal to S/ 2000.

  • Learn more about the integration here

Plin Interbank

  • The maximum amount of transactions with Plin Interbank must be less than or equal to S/ 5000 or $ 1500.

  • Learn more about the integration here

Demo

Next, we invite you to explore our interactive demo.

Live editor
Result
Loading...