omise / omise-magento

Omise Magento Plugin
https://docs.opn.ooo/magento-plugin
MIT License
34 stars 19 forks source link

[ENGA3-446]: Issue of duplicate cancelled event has been fixed. #384

Closed aashishgurung closed 2 years ago

aashishgurung commented 2 years ago

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

Before

Screen Shot 2565-09-26 at 11 09 31 Screen Shot 2565-09-26 at 11 09 22

After

Screen Shot 2565-09-26 at 11 07 50 Screen Shot 2565-09-26 at 11 07 38

🔧 Environments:

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication