In Offsite.php, if the webhook is enabled then we manually add the error message to the log and message manager which shows the message to the cart page, and redirect to cart page. The process of cancelling the order and restoring the product quantity is handled by webhook.
If the webhook is not enabled then we use LocalizedException which handles all of the above plus cancels the order and restores the product quantity automatically.
3. Quality assurance
Turn on Webhook in Magento admin
Setup webhook in Omise dashboard
Open product page and look at the quantity
Checkout with Online FPX
On reaching payment provider page, open product page and look at the quantity. It should be down by the number of quantity in the cart.
Cancel the payment.
Open product page and look at the quantity. It should be restored to the original quantity.
Open order page. It should have only one cancel event under Comments history.
1. Objective
Fixed the issue of duplicate cancelled event.
Jira Ticket: #446
2. Description of change
In
Offsite.php
, if the webhook is enabled then we manually add the error message to the log and message manager which shows the message to the cart page, and redirect to cart page. The process of cancelling the order and restoring the product quantity is handled by webhook.If the webhook is not enabled then we use
LocalizedException
which handles all of the above plus cancels the order and restores the product quantity automatically.3. Quality assurance
Comments history
.Before
After
🔧 Environments: