omise / omise-prestashop

Omise PrestaShop Plugin
https://docs.opn.ooo/prestashop-plugin
MIT License
4 stars 7 forks source link

Correctly handle the Omise charge, paid status, when redirect back to PrestaShop site #48

Closed nimid closed 6 years ago

nimid commented 6 years ago

1. Objective

Solve the situation that the payment result notification from bank server to Omise server is slower than the redirection of payer from bank site back to PrestaShop site.

In this situation, the status of Omise charge is pending and unpaid.

In other words, when the payer has been redirected back to PrestaShop site but Omise server is not received the payment result from bank, this situation causes the incorrect payment result display at order confirmation page.

Related information:

2. Description of change

Change the step of condition that checked the Omise paid status.

3. Quality assurance

Environments:

Details:

Before change:

The screenshot below shows the incorrect result of order confirmation page. From the screenshot, the error message box has been displayed but it has no any error message. This situation, payment has no error. The Omise charge status is just pending which Omise can not sure the result of payment from bank but the PrestaShop system display the error.

prestashop-1 7 2 4-omise-prestashop

The screenshot below shows the PrestaShop back office, order detail page. The order status is processing.

prestashop-1 7 2 4-back-office-order-detail-before-change

The screenshot below shows the Omise dashboard, charge detail page. The charge status is pending and unpaid.

omise-dashboard-charge-detail-before-change

After change:

The screenshot below shows the correct result of order confirmation page.

prestashop-order-confirmation-page-order-is-confirmed

The PrestaShop order status is processing and Omise charge status is pending and unpaid same as the before change.

prestashop-1 7 2 4-back-office-order-detail-after-change

omise-dashboard-charge-detail-after-change

4. Impact of the change

-

5. Priority of change

Normal

6. Additional notes

Steps to reproduce are:

  1. Proceed checkout
  2. At the payment step, pay by Omise internet banking
  3. Refresh on the Omise internet banking testing page

After submit payment, the system will redirect payer to the Omise internet banking testing page.

From the screenshot below, refresh the page.

omise-internet-banking-testing-page

According to the situation that the notification of payment result from bank to Omise server is slower than the redirection of payer from bank site back to PrestaShop site, this situation is not easy to test or simulate without any additional configuration or software such as proxy or mocking.

The steps above can be used to closely simulate this situation without any additional configuration or software.