Pay with Yape
This case allows users to make a payment using the Yape code. The user enters an OTP code generated from Yape's APP and this is validated in our checkout 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',
order: {
...,
payMethod: 'YAPE_CODE',
},
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',
},
shipping: {
firstName: 'Juan Sh',
lastName: 'Wick Quispe Sh',
email: 'jwickqsh@izi.com',
phoneNumber: '958745897',
street: 'Av. Jorge Chávez 275',
city: 'Lima',
state: 'Lima',
country: 'PE',
postalCode: '15038',
documentType: 'DNI',
document: '21458798',
}
...
}
};
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
YAPE
configured as a payment method and the amount exceeds the established limit, the checkout will not be shown. - If the merchant has several payment methods configured, including
YAPE
, 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
- YAPE RESTRICTION
- DAILY LIMIT
- ACCOUNT BLOCKED BY OTP
- ISSUER RESTRICTION
- OTP EXPIRED
- INVALID OTP
{
"code": "00",
"message": "Operación exitosa",
"messageUser": "Operación exitosa",
"messageUserEng": "Successful",
"response": {
"payMethod": "YAPE_CODE",
"order": [
{
"payMethodAuthorization": "YAPE_CODE",
"codeAuth": "000500",
"currency": "PEN",
"amount": "149.00",
"installment": "00",
"deferred": "0",
"orderNumber": "1704995421",
"stateMessage": "Autorizado",
"dateTransaction": "20240111",
"timeTransaction": "125141",
"uniqueId": "0111175141811583",
"referenceNumber": "1177350"
}
],
"card": {
"brand": "VS",
"pan": "449577******9759",
"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": "5599795",
"facilitatorCode": ""
},
"token": {
"merchantBuyerId": "GDTI4562_009",
"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\",\"response\":{\"payMethod\":\"YAPE_CODE\",\"order\":[{\"payMethodAuthorization\":\"YAPE_CODE\",\"codeAuth\":\"000500\",\"currency\":\"PEN\",\"amount\":\"149.00\",\"installment\":\"00\",\"deferred\":\"0\",\"orderNumber\":\"1704995421\",\"stateMessage\":\"Autorizado\",\"dateTransaction\":\"20240111\",\"timeTransaction\":\"125141\",\"uniqueId\":\"0111175141811583\",\"referenceNumber\":\"1177350\"}],\"card\":{\"brand\":\"VS\",\"pan\":\"449577******9759\",\"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\":\"5599795\",\"facilitatorCode\":\"\"},\"token\":{\"merchantBuyerId\":\"GDTI4562_009\",\"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\":\"170499542026900\"}",
"signature": "wXlqracZYHEtr0glhT8L9PxeSQjgupdiKJZ41zTnf0I=",
"transactionId": "170499542026900"
}
{
"code": "Y06",
"message": "Encontramos restricciones para completar el yapeo.",
"messageUser": "Encontramos restricciones para completar el yapeo.",
"messageUserEng": "We found restrictions to complete the Yapeo",
"response": {
"merchantCode": "4001834",
"orderNumber": "ONTEST174535547",
"amount": "149.00",
"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": ""
},
"currency": "PEN",
"dateTransaction": "20250422",
"timeTransaction": "155806",
"payMethod": "Yape",
"card": {
"save": false
},
"signature": "Okq9IaaIxxJ/2onuCWkRGCGpDaz5SqttZIYKdSpvlXA=",
"payloadHttp": "{\"code\":\"Y06\",\"message\":\"Encontramos restricciones para completar el yapeo.\",\"messageUser\":\"Encontramos restricciones para completar el yapeo.\",\"messageUserEng\":\"We found restrictions to complete the Yapeo\",\"response\":{\"merchantCode\":\"4001834\",\"orderNumber\":\"ONTEST174535547\",\"amount\":\"149.00\",\"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\":\"\"},\"currency\":\"PEN\",\"dateTransaction\":\"20250422\",\"timeTransaction\":\"155806\",\"payMethod\":\"Yape\",\"card\":{\"save\":false}}}"
}
}
{
"code": "Y07",
"message": "Esta operación excede tu monto límite diario para comprar por internet.",
"messageUser": "Esta operación excede tu monto límite diario para comprar por internet.",
"messageUserEng": "This operation exceeds your daily limit amount for online purchases",
"response": {
"merchantCode": "4001834",
"orderNumber": "ONTEST174535589",
"amount": "980.00",
"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": ""
},
"currency": "PEN",
"dateTransaction": "20250422",
"timeTransaction": "161021",
"payMethod": "Yape",
"card": {
"save": false
},
"signature": "nE54Yj2rH81XOsLzTa+Lf9f86CfT7VGvSAjDU7ZCB6Q=",
"payloadHttp": "{\"code\":\"Y07\",\"message\":\"Esta operación excede tu monto límite diario para comprar por internet.\",\"messageUser\":\"Esta operación excede tu monto límite diario para comprar por internet.\",\"messageUserEng\":\"This operation exceeds your daily limit amount for online purchases\",\"response\":{\"merchantCode\":\"4001834\",\"orderNumber\":\"ONTEST174535589\",\"amount\":\"980.00\",\"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\":\"\"},\"currency\":\"PEN\",\"dateTransaction\":\"20250422\",\"timeTransaction\":\"161021\",\"payMethod\":\"Yape\",\"card\":{\"save\":false}}}"
}
}
{
"code": "Y08",
"message": "Tu cuenta está bloqueada temporalmente.",
"messageUser": "Tu cuenta está bloqueada temporalmente.",
"messageUserEng": "Your account is temporarily blocked",
"response": {
"merchantCode": "4001834",
"orderNumber": "ONTEST174535662",
"amount": "149.00",
"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": ""
},
"currency": "PEN",
"dateTransaction": "20250422",
"timeTransaction": "161710",
"payMethod": "Yape",
"card": {
"save": false
},
"signature": "Zi9HXqyzHkQ/SkO76wo2ZF9WAtlfGlwKjSxpF/pQD4g=",
"payloadHttp": "{\"code\":\"Y08\",\"message\":\"Tu cuenta está bloqueada temporalmente.\",\"messageUser\":\"Tu cuenta está bloqueada temporalmente.\",\"messageUserEng\":\"Your account is temporarily blocked\",\"response\":{\"merchantCode\":\"4001834\",\"orderNumber\":\"ONTEST174535662\",\"amount\":\"149.00\",\"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\":\"\"},\"currency\":\"PEN\",\"dateTransaction\":\"20250422\",\"timeTransaction\":\"161710\",\"payMethod\":\"Yape\",\"card\":{\"save\":false}}}"
}
}
{
"code": "Y09",
"message": "Opción válida solo para Yape con BCP.",
"messageUser": "Opción válida solo para Yape con BCP.",
"messageUserEng": "Option valid only for Yape with BCP.",
"response": {
"merchantCode": "4001834",
"orderNumber": "ONTEST174535511",
"amount": "149.00",
"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": ""
},
"currency": "PEN",
"dateTransaction": "20250422",
"timeTransaction": "155248",
"payMethod": "Yape",
"card": {
"save": false
},
"signature": "lBWh6R24TP6bcOu4Hsi5QsDK8I/jGO6Y4sQUXUPr/+4=",
"payloadHttp": "{\"code\":\"Y09\",\"message\":\"Opción válida solo para Yape con BCP.\",\"messageUser\":\"Opción válida solo para Yape con BCP.\",\"messageUserEng\":\"Option valid only for Yape with BCP.\",\"response\":{\"merchantCode\":\"4001834\",\"orderNumber\":\"ONTEST174535511\",\"amount\":\"149.00\",\"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\":\"\"},\"currency\":\"PEN\",\"dateTransaction\":\"20250422\",\"timeTransaction\":\"155248\",\"payMethod\":\"Yape\",\"card\":{\"save\":false}}}"
}
}
{
"code": "Y12",
"message": "El código está vencido o es incorrecto.",
"messageUser": "El código está vencido o es incorrecto.",
"messageUserEng": "The code is expired or incorrect.",
"response": {
"merchantCode": "4001834",
"orderNumber": "ONTEST174535640",
"amount": "149.00",
"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": ""
},
"currency": "PEN",
"dateTransaction": "20250422",
"timeTransaction": "161440",
"payMethod": "Yape",
"card": {
"save": false
},
"signature": "Y59ppgFmBUGoOL9vTFojNVuw7IZAd5U6TGotJ8bVc1U=",
"payloadHttp": "{\"code\":\"Y12\",\"message\":\"El código está vencido o es incorrecto.\",\"messageUser\":\"El código está vencido o es incorrecto.\",\"messageUserEng\":\"The code is expired or incorrect.\",\"response\":{\"merchantCode\":\"4001834\",\"orderNumber\":\"ONTEST174535640\",\"amount\":\"149.00\",\"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\":\"\"},\"currency\":\"PEN\",\"dateTransaction\":\"20250422\",\"timeTransaction\":\"161440\",\"payMethod\":\"Yape\",\"card\":{\"save\":false}}}"
}
}
{
"code": "Y13",
"message": "El código es incorrecto.",
"messageUser": "El código es incorrecto.",
"messageUserEng": "The code is incorrect.",
"response": {
"merchantCode": "4001834",
"orderNumber": "ONTEST174535560",
"amount": "149.00",
"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": ""
},
"currency": "PEN",
"dateTransaction": "20250422",
"timeTransaction": "160018",
"payMethod": "Yape",
"card": {
"save": false
},
"signature": "z10oTk9R/etmPUvRpdWjvgLX+NEvZaIG9qgJyU+HqBA=",
"payloadHttp": "{\"code\":\"Y13\",\"message\":\"El código es incorrecto.\",\"messageUser\":\"El código es incorrecto.\",\"messageUserEng\":\"The code is incorrect.\",\"response\":{\"merchantCode\":\"4001834\",\"orderNumber\":\"ONTEST174535560\",\"amount\":\"149.00\",\"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\":\"\"},\"currency\":\"PEN\",\"dateTransaction\":\"20250422\",\"timeTransaction\":\"160018\",\"payMethod\":\"Yape\",\"card\":{\"save\":false}}}"
}
}
Next, we invite you to explore our interactive demo.
Live editor
Result
Loading...