TransbankDevelopers / transbank-plugin-prestashop-webpay-rest

Prestashop Webpay REST Plugin
BSD 3-Clause "New" or "Revised" License
8 stars 5 forks source link

Error Fatal Prestashop #100

Closed msaustral closed 2 days ago

msaustral commented 3 months ago

Al retornar de Transbank, arroja el texto Error Fatal

image

La URL es xxxx.com/module/webpay/webpaypluspaymentvalidate?token_ws=1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c

En el JSON de respuesta llega como AUTHORIZED, en portal de Transbank se encuentra aprobado, pero en el Prestashop no crea el pedido.

En la tabla del módulo tenemos status 2 y en transbank_rest:

{"vci":"TSY","status":"AUTHORIZED","responseCode":0,"amount":5940,"authorizationCode":"xxxxx","paymentTypeCode":"VN","accountingDate":"0730","installmentsNumber":0,"installmentsAmount":null,"sessionId":"ps:sessionId:rvy1x8n7in:372497","buyOrder":"ps:rvy1x8n7in:372497","cardNumber":"xxxxxx","cardDetail":{"card_number":"xxxxx"},"transactionDate":"2024-07-30T21:24:55.357Z","balance":null}

En el log del módulo tenemos:

2024-07-30 17:24:54 > INFO > createTransaction : amount: 5940, sessionId: ps:sessionId:rvy1x8n7in:372497, buyOrder: ps:rvy1x8n7in:372497, txDate: 30-07-2024, txTime: 17:24:54 [] []
2024-07-30 17:24:55 > INFO > createTransaction.result: {"token":"1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c","url":"https:\/\/webpay3g.transbank.cl:443\/webpayserver\/initTransaction"} [] []

2024-07-30 17:26:39 > INFO > commitTransaction : tokenWs: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:41 > INFO > C.4. Transacción con commit en Transbank => token: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:41 > INFO > {"vci":"TSY","status":"AUTHORIZED","responseCode":0,"amount":5940,"authorizationCode":"xxxxx","paymentTypeCode":"VN","accountingDate":"0730","installmentsNumber":0,"installmentsAmount":null,"sessionId":"ps:sessionId:rvy1x8n7in:372497","buyOrder":"ps:rvy1x8n7in:372497","cardNumber":"xxxx","cardDetail":{"card_number":"xxxxx"},"transactionDate":"2024-07-30T21:24:55.357Z","balance":null} [] []
2024-07-30 17:26:41 > INFO > ***** COMMIT TBK OK ***** [] []
2024-07-30 17:26:41 > INFO > TRANSACCION VALIDADA POR TBK => TOKEN: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:41 > INFO > SI NO SE ENCUENTRA VALIDACION POR PRESTASHOP DEBE ANULARSE [] []
2024-07-30 17:26:46 > ERROR > C.3. Transacción se encuentra en estado rechazado o cancelado => token: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:46 > ERROR > {"id":"59168","cart_id":"372497","order_id":null,"buy_order":"ps:rvy1x8n7in:372497","token":"1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c","session_id":"ps:sessionId:rvy1x8n7in:372497","status":"2","response_code":null,"transbank_response":"{\"vci\":\"TSY\",\"status\":\"AUTHORIZED\",\"responseCode\":0,\"amount\":5940,\"authorizationCode\":\"xxxxx\",\"paymentTypeCode\":\"VN\",\"accountingDate\":\"0730\",\"installmentsNumber\":0,\"installmentsAmount\":null,\"sessionId\":\"ps:sessionId:rvy1x8n7in:372497\",\"buyOrder\":\"ps:rvy1x8n7in:372497\",\"cardNumber\":\"xxxxx\",\"cardDetail\":{\"card_number\":\"xxxxxx\"},\"transactionDate\":\"2024-07-30T21:24:55.357Z\",\"balance\":null}","currency_id":"1","amount":"5940","vci":"","created_at":"2024-07-30 17:24:55","environment":"LIVE","commerce_code":"xxxxxx","child_commerce_code":null,"product":"webpay_plus","card_number":"xxxx","id_shop_list":[],"force_id":false} [] []
2024-07-30 17:26:46 > ERROR > Esta compra se encuentra en estado rechazado o cancelado y no se puede aceptar el pago [] []
2024-07-30 17:26:46 > INFO > commitTransaction : tokenWs: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:47 > INFO > C.4. Transacción con commit en Transbank => token: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:47 > INFO > {"vci":"TSY","status":"AUTHORIZED","responseCode":0,"amount":5940,"authorizationCode":"xxxxx","paymentTypeCode":"VN","accountingDate":"0730","installmentsNumber":0,"installmentsAmount":null,"sessionId":"ps:sessionId:rvy1x8n7in:372497","buyOrder":"ps:rvy1x8n7in:372497","cardNumber":"xxxx","cardDetail":{"card_number":"xxxx"},"transactionDate":"2024-07-30T21:24:55.357Z","balance":null} [] []
2024-07-30 17:26:47 > INFO > ***** COMMIT TBK OK ***** [] []
2024-07-30 17:26:47 > INFO > TRANSACCION VALIDADA POR TBK => TOKEN: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:47 > INFO > SI NO SE ENCUENTRA VALIDACION POR PRESTASHOP DEBE ANULARSE [] []
2024-07-30 17:26:48 > ERROR > C.3. Transacción se encuentra en estado rechazado o cancelado => token: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:48 > ERROR > {"id":"59168","cart_id":"372497","order_id":null,"buy_order":"ps:rvy1x8n7in:372497","token":"1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c","session_id":"ps:sessionId:rvy1x8n7in:372497","status":"2","response_code":null,"transbank_response":"{\"vci\":\"TSY\",\"status\":\"AUTHORIZED\",\"responseCode\":0,\"amount\":5940,\"authorizationCode\":\"xxxxxx\",\"paymentTypeCode\":\"VN\",\"accountingDate\":\"0730\",\"installmentsNumber\":0,\"installmentsAmount\":null,\"sessionId\":\"ps:sessionId:rvy1x8n7in:372497\",\"buyOrder\":\"ps:rvy1x8n7in:372497\",\"cardNumber\":\"xxxx\",\"cardDetail\":{\"card_number\":\"xxxxx\"},\"transactionDate\":\"2024-07-30T21:24:55.357Z\",\"balance\":null}","currency_id":"1","amount":"5940","vci":"","created_at":"2024-07-30 17:24:55","environment":"LIVE","commerce_code":"xxxxxx","child_commerce_code":null,"product":"webpay_plus","card_number":"xxxxx","id_shop_list":[],"force_id":false} [] []
2024-07-30 17:26:48 > ERROR > Esta compra se encuentra en estado rechazado o cancelado y no se puede aceptar el pago [] []
2024-07-30 17:26:48 > ERROR > C.3. Transacción se encuentra en estado rechazado o cancelado => token: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:48 > ERROR > {"id":"59168","cart_id":"372497","order_id":null,"buy_order":"ps:rvy1x8n7in:372497","token":"1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c","session_id":"ps:sessionId:rvy1x8n7in:372497","status":"2","response_code":null,"transbank_response":"{\"vci\":\"TSY\",\"status\":\"AUTHORIZED\",\"responseCode\":0,\"amount\":5940,\"authorizationCode\":\"xxxxx\",\"paymentTypeCode\":\"VN\",\"accountingDate\":\"0730\",\"installmentsNumber\":0,\"installmentsAmount\":null,\"sessionId\":\"ps:sessionId:rvy1x8n7in:372497\",\"buyOrder\":\"ps:rvy1x8n7in:372497\",\"cardNumber\":\"xxxx\",\"cardDetail\":{\"card_number\":\"xxxxx\"},\"transactionDate\":\"2024-07-30T21:24:55.357Z\",\"balance\":null}","currency_id":"1","amount":"5940","vci":"","created_at":"2024-07-30 17:24:55","environment":"LIVE","commerce_code":"xxxxxx","child_commerce_code":null,"product":"webpay_plus","card_number":"xxxxx","id_shop_list":[],"force_id":false} [] []
2024-07-30 17:26:48 > ERROR > Esta compra se encuentra en estado rechazado o cancelado y no se puede aceptar el pago [] []
2024-07-30 17:26:48 > INFO > commitTransaction : tokenWs: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:48 > INFO > commitTransaction : tokenWs: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:49 > INFO > C.4. Transacción con commit en Transbank => token: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:49 > INFO > {"vci":"TSY","status":"AUTHORIZED","responseCode":0,"amount":5940,"authorizationCode":"xxxxx","paymentTypeCode":"VN","accountingDate":"0730","installmentsNumber":0,"installmentsAmount":null,"sessionId":"ps:sessionId:rvy1x8n7in:372497","buyOrder":"ps:rvy1x8n7in:372497","cardNumber":"xxxx","cardDetail":{"card_number":"xxxxxx"},"transactionDate":"2024-07-30T21:24:55.357Z","balance":null} [] []
2024-07-30 17:26:49 > INFO > ***** COMMIT TBK OK ***** [] []
2024-07-30 17:26:49 > INFO > TRANSACCION VALIDADA POR TBK => TOKEN: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:49 > INFO > SI NO SE ENCUENTRA VALIDACION POR PRESTASHOP DEBE ANULARSE [] []
2024-07-30 17:26:49 > ERROR > Client error response [url] https://webpay3g.transbank.cl/rswebpaytransaction/api/webpay/v1.2/transactions/1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [status code] 422 [reason phrase] Unknown [] []
2024-07-30 17:26:49 > INFO > C.4. Transacción con commit en Transbank => token: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:49 > INFO > null [] []
2024-07-30 17:26:49 > ERROR > C.5. Respuesta de tbk commit fallido => token: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:49 > ERROR > null [] []
2024-07-30 17:26:49 > ERROR > Error en el pago [] []
2024-07-30 17:26:58 > ERROR > C.3. Transacción se encuentra en estado rechazado o cancelado => token: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:58 > ERROR > {"id":"59168","cart_id":"372497","order_id":null,"buy_order":"ps:rvy1x8n7in:372497","token":"1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c","session_id":"ps:sessionId:rvy1x8n7in:372497","status":"2","response_code":null,"transbank_response":"null","currency_id":"1","amount":"5940","vci":"","created_at":"2024-07-30 17:24:55","environment":"LIVE","commerce_code":"xxxxxxxxxx","child_commerce_code":null,"product":"webpay_plus","card_number":null,"id_shop_list":[],"force_id":false} [] []
2024-07-30 17:26:58 > ERROR > Esta compra se encuentra en estado rechazado o cancelado y no se puede aceptar el pago [] []
2024-07-30 17:26:58 > INFO > commitTransaction : tokenWs: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:59 > INFO > C.4. Transacción con commit en Transbank => token: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []
2024-07-30 17:26:59 > INFO > {"vci":"TSY","status":"AUTHORIZED","responseCode":0,"amount":5940,"authorizationCode":"xxxxx","paymentTypeCode":"VN","accountingDate":"0730","installmentsNumber":0,"installmentsAmount":null,"sessionId":"ps:sessionId:rvy1x8n7in:372497","buyOrder":"ps:rvy1x8n7in:372497","cardNumber":"xxxxx","cardDetail":{"card_number":"xxxxx"},"transactionDate":"2024-07-30T21:24:55.357Z","balance":null} [] []
2024-07-30 17:26:59 > INFO > ***** COMMIT TBK OK ***** [] []
2024-07-30 17:26:59 > INFO > TRANSACCION VALIDADA POR TBK => TOKEN: 1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [] []

Vemos este error en la API:

2024-07-30 17:26:49 > ERROR > Client error response [url] https://webpay3g.transbank.cl/rswebpaytransaction/api/webpay/v1.2/transactions/1131dc4dbf194ad98baafa213a5d6ec8f8fe7ad2cdc27376508949d2e76fe65c [status code] 422 [reason phrase] Unknown [] []

Prestashop ver: 1.7.8.7 PHP: 7.4 Módulo: 2.1.0

La transacción no se reversa luego de las 48 horas y se le cobra doble al cliente

No sabemos si es coincidencia pero las compras con falla son por dispositivos mobile

msaustral commented 3 months ago

El error se presenta si el código de comercio es webpayplus Mall

Al ser mall ejecuta la función $response = $transaction->status($token); que valida por API el estado de la orden.

mastudillot commented 2 days ago

Se realizaron mejoras en el flujo de pago que debería eliminar este comportamiento, en la última versión ya no debería pasar.