omise / omise-woocommerce

Omise WooCommerce Plugin
https://docs.opn.ooo/woocommerce-plugin
MIT License
47 stars 27 forks source link

[ENGA3-447]: Added a delay of 0.5 seconds before calling the charge A… #321

Closed aashishgurung closed 2 years ago

aashishgurung commented 2 years ago

1. Objective

Added a delay of 0.5 seconds before calling the charge API in callback class so that we can fetch correct charge status.

Jira Ticket: #447

2. Description of change

With RMS payment method, when customer cancels the transaction and redirect back to the plugin, sometimes, randomly, the charge it fetches from API has the status value as pending instead of cancelled . This will redirect customer to success page instead of back to checkout page.

To fix this, we have added a delay of 0.5 secs before calling the charge API.

3. Quality assurance

Note: You have to try multiple cancel transaction as this issue occurs in random.

You should see the following page, not the success page.

Screen Shot 2565-10-12 at 17 13 09

🔧 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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication