Pay with Plin Interbank
This case allows users to make a payment using the Interbank application. The user enters his cell phone number, receives a notification on his cell phone and makes the payment from the Interbank application.
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',
order: {
...,
payMethod: 'PAGO_PUSH',
},
billing:{
firstName: 'Juan',
lastName: 'Wick Quispe',
email: 'jwickq@izi.com',
phoneNumber: '958745896',
street: 'Av. Jorge Chávez 275',
city: 'Lima',
state: 'Lima',
country: 'PE',
postalCode: '15038',
documentType: 'DNI',
document: '21458796',
},
...
}
};
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);
}
Important
- If the merchant only has
PAGO_PUSH
configured as a payment method and the amount exceeds the established limit, an error screen will be displayed. - If the merchant has several payment methods configured, including
PAGO_PUSH
, and the amount exceeds the established limit, the payment slip will not be displayed.
4. Response
At the end of the transaction, our checkout will send the response in JSON format to the merchant.
- SUCCESSFUL
- ERROR
{
"code": "00",
"message": "Operación exitosa",
"messageUser": "Operación exitosa",
"messageUserEng": "Successful",
"response": {
"payMethod": "PAGO_PUSH",
"order": [
{
"payMethodAuthorization": "PAGO_PUSH",
"codeAuth": "S44196",
"currency": "PEN",
"amount": "149.00",
"installment": "",
"deferred": "",
"orderNumber": "ONTEST171207000",
"stateMessage": "Autorizado",
"dateTransaction": "20240402",
"timeTransaction": "100130",
"uniqueId": "1308593",
"referenceNumber": "0209080"
}
],
"card": {
"brand": "VS",
"pan": "************6579"
},
"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": "4000011",
"facilitatorCode": ""
},
"token": {
"merchantBuyerId": "MC240402100004K33L5H",
"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": ""
}
]
},
"signature": "wXlqracZYHEtr0glhT8L9PxeSQjgupdiKJZ41zTnf0I=",
"payloadHttp": "{\"code\":\"00\",\"message\":\"Operación exitosa\",\"messageUser\":\"Operación exitosa\",\"messageUserEng\":\"Successful\",\"response\":{\"payMethod\":\"PAGO_PUSH\",\"order\":[{\"payMethodAuthorization\":\"PAGO_PUSH\",\"codeAuth\":\"S44196\",\"currency\":\"PEN\",\"amount\":\"149.00\",\"installment\":\"\",\"deferred\":\"\",\"orderNumber\":\"ONTEST171207000\",\"stateMessage\":\"Autorizado\",\"dateTransaction\":\"20240402\",\"timeTransaction\":\"100130\",\"uniqueId\":\"1308593\",\"referenceNumber\":\"0209080\"}],\"card\":{\"brand\":\"VS\",\"pan\":\"************6579\"},\"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\":\"4000011\",\"facilitatorCode\":\"\"},\"token\":{\"merchantBuyerId\":\"MC240402100004K33L5H\",\"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\":\"\"}]},\"transactionId\":\"171207000314300\"}",
"transactionId": "171207000314300"
}
- INCORRECT DATA
- NO PERMISSION
- FOR ATTEMPTS
- FOR LIMIT
- FOR TIME
{
"code": "007",
"message": "Tiempo de espera vencido. Por favor, vuelva ha realizar el proceso de pago.",
"messageUser": "Tiempo de espera vencido. Por favor, vuelva ha realizar el proceso de pago.",
"messageUserEng": "Timeout has expired. Please try the payment process again.",
"response": {
"payloadHttp": "{\"code\":\"007\",\"message\":\"Tiempo de espera vencido. Por favor, vuelva ha realizar el proceso de pago.\", \"messageUser\":\"Tiempo de espera vencido. Por favor, vuelva ha realizar el proceso de pago.\",\"messageUserEng\":\"Timeout has expired. Please try the payment process again.\",\"response\":{}}"
}
}
{
"code": "006",
"message": "Límite de pago es incorrecto. Los montos máximos de pago son S/5,000 y US$ 1,500",
"messageUser": "Límite de pago es incorrecto. Los montos máximos de pago son S/5,000 y US$ 1,500",
"messageUserEng": "Payment limit is incorrect. The maximum payment amounts are S/5,000 and US$ 1,500",
"response": {
"payloadHttp": "{\"code\":\"006\",\"message\":\"Límite de pago es incorrecto. Los montos máximos de pago son S/5,000 y US$ 1,500\",\"messageUser\":\"Límite de pago es incorrecto. Los montos máximos de pago son S/5,000 y US$ 1,500\",\"messageUserEng\":\"Payment limit is incorrect. The maximum payment amounts are S/5,000 and US$ 1,500\",\"response\":{}"
}
}
{
"code": "004",
"message": "Excediste el número de intentos permitidos. Por favor vuelva a intentarlo más tarde.",
"messageUser": "Excediste el número de intentos permitidos. Por favor vuelva a intentarlo más tarde.",
"messageUserEng": "You have exceeded the allowed number of attempts. Please try again later.",
"header": {
"transactionStartDatetime": "2024-04-26 15:42:29.964",
"transactionEndDatetime": "2024-04-26 15:42:55.814",
"millis": "25849.9155"
},
"response": {
"payloadHttp": "{\"code\":\"004\",\"message\":\"Excediste el número de intentos permitidos. Por favor vuelva a intentarlo más tarde.\",\"messageUser\":\"Excediste el número de intentos permitidos. Por favor vuelva a intentarlo más tarde.\",\"messageUserEng\":\"You have exceeded the allowed number of attempts. Please try again later.\",\"header\":{\"transactionStartDatetime\":\"2024-04-26 15:42:29.964\",\"transactionEndDatetime\":\"2024-04-26 15:42:55.814\",\"millis\":\"25849.9155\"},\"response\":{}}"
}
}
{
"code": "002",
"message": "Los datos del cliente son incorrectos. Por favor, verifica la información.",
"messageUser": "Los datos del cliente son incorrectos. Por favor, verifica la información.",
"messageUserEng": "The customer data is incorrect. Please verify the information.",
"header": {
"transactionStartDatetime": "2024-04-02 14:58:26.971",
"transactionEndDatetime": "2024-04-02 14:58:30.452",
"millis": "3480.9098"
},
"response": {
"payloadHttp": "{\"code\":\"002\",\"message\":\"Los datos del cliente son incorrectos. Por favor, verifica la información.\",\"messageUser\":\"Los datos del cliente son incorrectos. Por favor, verifica la información.\",\"messageUserEng\":\"The customer data is incorrect. Please verify the information.\",\"header\":{\"transactionStartDatetime\":\"2024-04-02 14:58:26.971\",\"transactionEndDatetime\":\"2024-04-02 14:58:30.452\",\"millis\":\"3480.9098\"},\"response\":{}}"
}
}
{
"code": "003",
"message": "Las notificaciones no están activadas en tu Interbank App. Actívalas siguiendo estos pasos:",
"messageUser": "Las notificaciones no están activadas en tu Interbank App. Actívalas siguiendo estos pasos:",
"messageUserEng": "Notifications are not activated in your Interbank App. Activate them by following these steps:",
"header": {
"transactionStartDatetime": "2024-04-02 14:57:28.529",
"transactionEndDatetime": "2024-04-02 14:57:56.864",
"millis": "28334.7644"
},
"response": {
"payloadHttp": "{\"code\":\"003\",\"message\":\"Las notificaciones no están activadas en tu Interbank App. Actívalas siguiendo estos pasos:\",\"messageUser\":\"Las notificaciones no están activadas en tu Interbank App. Actívalas siguiendo estos pasos:\",\"messageUserEng\":\"Notifications are not activated in your Interbank App. Activate them by following these steps:\",\"header\":{\"transactionStartDatetime\":\"2024-04-02 14:57:28.529\",\"transactionEndDatetime\":\"2024-04-02 14:57:56.864\",\"millis\":\"28334.7644\"},\"response\":{}}"
}
}
Demo
Next, we invite you to explore our interactive demo.
Live editor
Result
Loading...