Pago
Esta casuística permite a los usuarios realizar un pago utilizando los datos de su tarjeta de crédito o débito. El usuario proporciona la información de la tarjeta, como el número, la fecha de vencimiento y el código de seguridad, para completar la transacción y procesar el pago.
Objetivo
Aprenderás a:
- Crear el objeto de configuración
- Inicializar el formulario de pago.
- Mostrar el Checkout.
- Ejemplo de respuesta.
1. Creando el objeto de configuración
const iziConfig = {
config: {
...,
action: 'pay',
...
}
};
2. Instanciando la clase
const checkout = new Izipay({ config: iziConfig });
3. Mostrando el 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. Respuesta
Cada método de pago cuenta con su propia respuesta y aquí te mostramos un ejemplo de cada uno, los cuales se enviarán al comercio después de completar el flujo.
- Tarjeta
- QR
- Apple Pay
- Yape
- Plin Interbank
{
"code": "00",
"message": "OK",
"messageUser": "Operación exitosa",
"messageUserEng": "Successful",
"response": {
"payMethod": "CARD",
"order": [
{
"payMethodAuthorization": "CARD",
"codeAuth": "812643",
"currency": "PEN",
"amount": "1.25",
"installment": "00",
"deferred": "0",
"orderNumber": "ONTEST170542360",
"stateMessage": "Autorizado",
"dateTransaction": "20240116",
"timeTransaction": "114711",
"uniqueId": "0116164711812643",
"referenceNumber": "6178410"
}
],
"card": {
"brand": "DN",
"pan": "361006**5158",
"save": "false"
},
"billing": {
"firstName": "Juan",
"lastName": "Wick",
"email": "jwick@izi.com",
"phoneNumber": "989339999",
"street": "calle el demo",
"city": "lima",
"state": "lima",
"country": "PE",
"postalCode": "00001",
"documentType": "DNI",
"document": "10252022",
"companyName": ""
},
"merchant": {
"merchantCode": "5498631",
"facilitatorCode": ""
},
"token": {
"merchantBuyerId": "mc1991",
"cardToken": "",
"alias": ""
},
"authentication": {
"result": ""
},
"customFields": [
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
]
},
"payloadHttp": "{\"code\":\"00\",\"message\":\"OK\",\"messageUser\":\"Operación exitosa\",\"messageUserEng\":\"Successful\",\"transactionId\":\"170542360395800\",\"response\":{\"payMethod\":\"CARD\",\"order\":[{\"payMethodAuthorization\":\"CARD\",\"codeAuth\":\"812643\",\"currency\":\"PEN\",\"amount\":\"1.25\",\"installment\":\"00\",\"deferred\":\"0\",\"orderNumber\":\"ONTEST170542360\",\"stateMessage\":\"Autorizado\",\"dateTransaction\":\"20240116\",\"timeTransaction\":\"114711\",\"uniqueId\":\"0116164711812643\",\"referenceNumber\":\"6178410\"}],\"card\":{\"brand\":\"DN\",\"pan\":\"361006**5158\",\"save\":\"false\"},\"billing\":{\"firstName\":\"Test\",\"lastName\":\"Test\",\"email\":\"jwick@izi.com\",\"phoneNumber\":\"989339999\",\"street\":\"calle el demo\",\"city\":\"lima\",\"state\":\"lima\",\"country\":\"PE\",\"postalCode\":\"00001\",\"documentType\":\"DNI\",\"document\":\"10252022\",\"companyName\":\"\"},\"merchant\":{\"merchantCode\":\"5498631\",\"facilitatorCode\":\"\"},\"token\":{\"merchantBuyerId\":\"mc1991\",\"cardToken\":\"\",\"alias\":\"\"},\"authentication\":{\"result\":\"\"},\"customFields\":[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]}}",
"signature": "x9SIjZIy1XeRjPDjiblsjtjR1tUyKpY6BCxCJsXWO1k=",
"transactionId": "170542360395800"
}
}
{
"code": "00",
"message": "Aprobado",
"messageUser": "Aprobado",
"messageUserEng": "Approved",
"response": {
"payMethod": "QR",
"order": [
{
"payMethodAuthorization": "QR",
"codeAuth": "S56392",
"currency": "PEN",
"amount": "1.00",
"installment": "",
"deferred": "",
"orderNumber": "1704990125",
"stateMessage": "Autorizado",
"dateTransaction": "20240111",
"timeTransaction": "112300",
"uniqueId": "1207657",
"referenceNumber": "1000000"
}
],
"card": {
"brand": "VS",
"pan": "405142*1115",
"save": "false"
},
"billing": {
"firstName": "Juan",
"lastName": "Wick quispe",
"email": "jwick@izi.com",
"phoneNumber": "989339999",
"street": "calle el demo",
"city": "lima",
"state": "lima",
"country": "PE",
"postalCode": "00001",
"documentType": "DNI",
"document": "10252022",
"companyName": ""
},
"merchant": {
"merchantCode": "5498633",
"facilitatorCode": ""
},
"token": {
"merchantBuyerId": "",
"cardToken": "",
"alias": ""
},
"authentication": {
"result": ""
},
"customFields": [
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
]
},
"payloadHttp": "{\"code\":\"00\",\"message\":\"Aprobado\",\"messageUser\":\"Aprobado\",\"messageUserEng\":\"Approved\",\"response\":{\"payMethod\":\"QR\",\"order\":[{\"payMethodAuthorization\":\"QR\",\"codeAuth\":\"S56392\",\"currency\":\"PEN\",\"amount\":\"1.00\",\"installment\":\"\",\"deferred\":\"\",\"orderNumber\":\"1704990125\",\"stateMessage\":\"Autorizado\",\"dateTransaction\":\"20240111\",\"timeTransaction\":\"112300\",\"uniqueId\":\"1207657\",\"referenceNumber\":\"1000000\"}],\"card\":{\"brand\":\"VS\",\"pan\":\"405142*1115\",\"save\":\"false\"},\"billing\":{\"firstname\":\"Juan\",\"lastName\":\"Wick quispe\",\"email\":\"jwick@izi.com\",\"phoneNumber\":\"989339999\",\"street\":\"calle el demo\",\"city\":\"lima\",\"state\":\"lima\",\"country\":\"PE\",\"postalCode\":\"00001\",\"documentType\":\"DNI\",\"document\":\"10252022\",\"companyName\":null},\"merchant\":{\"merchantCode\":\"5498633\",\"facilitatorCode\":\"\"},\"token\":{\"merchantBuyerId\":\"\",\"cardToken\":\"\",\"alias\":\"\"},\"authentication\":{\"result\":\"\"},\"customFields\":[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]},\"transactionId\":\"170499012316100\"}",
"signature": "Df8y1pD9Ngl0uuQkR70CPO5Csu2zOxC2Gdzps0jPbv4=",
"transactionId": "170499012316100",
"StatusCode": 0
}
{
"code": "00",
"message": "OK",
"messageUser": "Operación exitosa",
"messageUserEng": "Successful",
"response": {
"payMethod": "APPLE_PAY",
"order": [
{
"payMethodAuthorization": "APPLE_PAY",
"codeAuth": "S93925",
"currency": "PEN",
"amount": "1.00",
"installment": "00",
"deferred": "0",
"orderNumber": "7676794",
"stateMessage": "Autorizado",
"dateTransaction": "20240307",
"timeTransaction": "111451",
"uniqueId": "1286134",
"referenceNumber": "7000000"
}
],
"card": {
"brand": "VS",
"pan": "******1874",
"save": "false"
},
"billing": {
"firstName": "Juan",
"lastName": "Wick Quispe",
"email": "jwickq@izi.com",
"phoneNumber": "989339999",
"street": "calle el demo sdk",
"city": "lima",
"state": "lima",
"country": "PE",
"postalCode": "00001",
"documentType": "DNI",
"document": "12345678",
"companyName": ""
},
"merchant": {
"merchantCode": "4075169",
"facilitatorCode": ""
},
"token": {
"merchantBuyerId": "enriquepariascauser",
"cardToken": "",
"alias": ""
},
"authentication": {
"result": ""
},
"customFields": [
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
],
},
"payloadHttp": "{\"code\":\"00\",\"message\":\"OK\",\"messageUser\":\"Operación exitosa\",\"messageUserEng\":\"Successful\",\"transactionId\":\"557763479\",\"response\":{\"payMethod\":\"APPLE_PAY\",\"order\":[{\"payMethodAuthorization\":\"APPLE_PAY\",\"codeAuth\":\"S93925\",\"currency\":\"PEN\",\"amount\":\"1.00\",\"installment\":\"00\",\"deferred\":\"0\",\"orderNumber\":\"7676794\",\"stateMessage\":\"Autorizado\",\"dateTransaction\":\"20240307\",\"timeTransaction\":\"111451\",\"uniqueId\":\"1286134\",\"referenceNumber\":\"7000000\"}],\"card\":{\"brand\":\"VS\",\"pan\":\"******1874\",\"save\":\"false\"},\"billing\":{\"firstName\":\"Juan\",\"lastName\":\"Wick Quispe\",\"email\":\"jwickq@izi.com\",\"phoneNumber\":\"989339999\",\"street\":\"calle el demo sdk\",\"city\":\"lima\",\"state\":\"lima\",\"country\":\"PE\",\"postalCode\":\"00001\",\"documentType\":\"DNI\",\"document\":\"12345678\",\"companyName\":\"\"},\"merchant\":{\"merchantCode\":\"4075169\",\"facilitatorCode\":\"\"},\"token\":{\"merchantBuyerId\":\"enriquepariascauser\",\"cardToken\":\"\",\"alias\":\"\"},\"authentication\":{\"result\":\"\"},\"customFields\":[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]}}",
"signature": "0rlf7ASjgBBfVu1XB1PcnvMPvV6wFVEL/P8BgbbtRSY="
"transactionId": "557763479"
}
{
"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": "20.14",
"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": "TestOnce",
"lastName": "CaseOnce",
"email": "mgutierres@izipay.pe",
"phoneNumber": "963150123",
"street": "Jorge Chavez 256",
"city": "Lima",
"state": "Lima",
"country": "PE",
"postalCode": "15002",
"documentType": "DNI",
"document": "24010511",
"companyName": ""
},
"merchant": {
"merchantCode": "5599795",
"facilitatorCode": ""
},
"token": {
"merchantBuyerId": "GDTI4562_009",
"cardToken": "",
"alias": ""
},
"authentication": {
"result": ""
},
"customFields": [
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
]
},
"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\":\"20.14\",\"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\":\"TestOnce\",\"lastName\":\"CaseOnce\",\"email\":\"mgutierres@izipay.pe\",\"phoneNumber\":\"963150123\",\"street\":\"Jorge Chavez 256\",\"city\":\"Lima\",\"state\":\"Lima\",\"country\":\"PE\",\"postalCode\":\"15002\",\"documentType\":\"DNI\",\"document\":\"24010511\",\"companyName\":\"\"},\"merchant\":{\"merchantCode\":\"5599795\",\"facilitatorCode\":\"\"},\"token\":{\"merchantBuyerId\":\"GDTI4562_009\",\"cardToken\":\"\",\"alias\":\"\"},\"authentication\":{\"result\":\"\"},\"customFields\":[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]},\"transactionId\":\"170499542026900\"}",
"signature": "wXlqracZYHEtr0glhT8L9PxeSQjgupdiKJZ41zTnf0I=",
"transactionId": "170499542026900"
}
{
"code": "00",
"message": "OK",
"messageUser": "Operación exitosa",
"messageUserEng": "Successful",
"response": {
"payMethod": "PAGO_PUSH",
"order": [
{
"payMethodAuthorization": "PAGO_PUSH",
"codeAuth": "S44196",
"currency": "PEN",
"amount": "1.00",
"installment": "",
"deferred": "",
"orderNumber": "ONTEST171207000",
"stateMessage": "Autorizado",
"dateTransaction": "20240402",
"timeTransaction": "100130",
"uniqueId": "1308593",
"referenceNumber": "0209080"
}
],
"card": {
"brand": "VS",
"pan": "************6579"
},
"billing": {
"firstName": "Juan",
"lastName": "Wick quispe",
"email": "jwick@izi.com",
"phoneNumber": "989339999",
"street": "calle el demo",
"city": "lima",
"state": "lima",
"country": "PE",
"postalCode": "00001",
"documentType": "DNI",
"document": "10252022",
"companyName": ""
},
"merchant": {
"merchantCode": "4000011",
"facilitatorCode": ""
},
"token": {
"merchantBuyerId": "MC240402100004K33L5H",
"cardToken": "",
"alias": ""
},
"authentication": {
"result": ""
},
"customFields": [
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
],
"payloadHttp": "{\"code\":\"00\",\"message\":\"OK\",\"messageUser\":\"Operación exitosa\",\"messageUserEng\":\"Successful\",\"response\":{\"payMethod\":\"PAGO_PUSH\",\"order\":[{\"payMethodAuthorization\":\"PAGO_PUSH\",\"codeAuth\":\"S44196\",\"currency\":\"PEN\",\"amount\":\"1.00\",\"installment\":\"\",\"deferred\":\"\",\"orderNumber\":\"ONTEST171207000\",\"stateMessage\":\"Autorizado\",\"dateTransaction\":\"20240402\",\"timeTransaction\":\"100130\",\"uniqueId\":\"1308593\",\"referenceNumber\":\"0209080\"}],\"card\":{\"brand\":\"VS\",\"pan\":\"************6579\"},\"billing\":{\"firstName\":\"Juan\",\"lastName\":\"Wick quispe\",\"email\":\"jwick@izi.com\",\"phoneNumber\":\"989339999\",\"street\":\"calle el demo\",\"city\":\"lima\",\"state\":\"lima\",\"country\":\"PE\",\"postalCode\":\"00001\",\"documentType\":\"DNI\",\"document\":\"10252022\",\"companyName\":\"\"},\"merchant\":{\"merchantCode\":\"4000011\",\"facilitatorCode\":\"\"},\"token\":{\"merchantBuyerId\":\"MC240402100004K33L5H\",\"cardToken\":\"\",\"alias\":\"\"},\"authentication\":{\"result\":\"\"},\"customFields\":[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]},\"transactionId\":\"171207000314300\"}"
},
"transactionId": "171207000314300"
}
Importante
Demo
A continuación, te invitamos a explorar nuestra demo interactiva.
Editor en vivo
Resultado
Loading...