Skip to main content

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.

{
"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"
}

Demo

Next, we invite you to explore our interactive demo.

Live editor
Result
Loading...