Correctly update a status of PrestaShop order when checkout with Omise internet banking payment.
Note:
To complete the checkout with Omise internet banking payment, the payer need to be redirected off the PrestaShop website to the bank website. After the payer completed their payment on bank website, bank will,
Redirect the payer back to PrestaShop website.
Send the notification of payment result to Omise.
Sometimes the notification is delayed or slower than the redirection. This situation causes the Omise can not sure the result of payment.
This problem can be solved by using Omise webhooks. Whenever bank sent the notification of payment result to Omise, Omise will send the notification to the PrestaShop website.
Related information:
Related issue: -
Related ticket: -
2. Description of change
Add a logger class, OmiseLogger, to write log message to PrestaShop database.
Develop the mechanism to handle an Omise event, charge.complete.
3. Quality assurance
Environments:
Platform: PrestaShop 1.7.2.4
Omise plugin: Omise PrestaShop 1.3
PHP: 5.6.31
Details:
It has 2 test cases.
The event is charge.complete, status of charge is successful. Expect the status PrestaShop order has been updated to be Payment accepted (success).
The event is charge.complete, status of charge is failed. Expect the status PrestaShop order has been updated to be Canceled.
Steps before test.
Configure the Omise Webhooks. By copy the URL from Webhooks endpoint that appeared in PrestaShop back office, Omise setting page, and paste it in Omise dashboard, Webhooks Endpoint.
Go to PrestaShop front office and process checkout, at the payment step, select any bank from Omise internet banking payment.
The screenshot below shows the configuration for Omise Webhooks endpoint.
Test case 1:
The screenshot below shows Omise dashboard, webhooks detail. In the red boxes, there are show the event is charge.complete and charge status is successful.
The screenshot below shows PrestaShop back office, order detail. In the red box, it shows order status is payment accepted.
The screenshot below shows PrestaShop back office, logs page. In the red box, it shows log message that the module, Omise PrestaShop, has caught Omise webhooks event and updated PrestaShop order status to be payment accepted.
Test case 2:
The screenshot below shows Omise dashboard, webhooks detail. In the red boxes, they show the event is charge.complete and charge status is failed.
The screenshot below shows PrestaShop back office, order detail. In the red box, it shows order status is canceled.
The screenshot below shows PrestaShop back office, logs page. In the red box, it shows log message that the module, Omise PrestaShop, has caught Omise webhooks event and updated PrestaShop order status to be canceled.
1. Objective
Correctly update a status of PrestaShop order when checkout with Omise internet banking payment.
Note: To complete the checkout with Omise internet banking payment, the payer need to be redirected off the PrestaShop website to the bank website. After the payer completed their payment on bank website, bank will,
Sometimes the notification is delayed or slower than the redirection. This situation causes the Omise can not sure the result of payment.
This problem can be solved by using Omise webhooks. Whenever bank sent the notification of payment result to Omise, Omise will send the notification to the PrestaShop website.
Related information:
2. Description of change
3. Quality assurance
Environments:
Details:
It has 2 test cases.
The event is charge.complete, status of charge is successful. Expect the status PrestaShop order has been updated to be Payment accepted (success).
The event is charge.complete, status of charge is failed. Expect the status PrestaShop order has been updated to be Canceled.
Steps before test.
Configure the Omise Webhooks. By copy the URL from Webhooks endpoint that appeared in PrestaShop back office, Omise setting page, and paste it in Omise dashboard, Webhooks Endpoint.
Go to PrestaShop front office and process checkout, at the payment step, select any bank from Omise internet banking payment.
The screenshot below shows the configuration for Omise Webhooks endpoint.
Test case 1:
The screenshot below shows Omise dashboard, webhooks detail. In the red boxes, there are show the event is charge.complete and charge status is successful.
The screenshot below shows PrestaShop back office, order detail. In the red box, it shows order status is payment accepted.
The screenshot below shows PrestaShop back office, logs page. In the red box, it shows log message that the module, Omise PrestaShop, has caught Omise webhooks event and updated PrestaShop order status to be payment accepted.
Test case 2:
The screenshot below shows Omise dashboard, webhooks detail. In the red boxes, they show the event is charge.complete and charge status is failed.
The screenshot below shows PrestaShop back office, order detail. In the red box, it shows order status is canceled.
The screenshot below shows PrestaShop back office, logs page. In the red box, it shows log message that the module, Omise PrestaShop, has caught Omise webhooks event and updated PrestaShop order status to be canceled.
4. Impact of the change
-
5. Priority of change
Normal
6. Additional notes
List of Omise events.
The HTML comments appeared in response body, Omise dashboard, webhooks detail, if PrestaShop is run on debug mode.