omise / omise-woocommerce

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

[ENGA3-438]: Mobile banking redirect URI not working in Andoird Chrome. #309

Closed aashishgurung closed 2 years ago

aashishgurung commented 2 years ago

1. Objective

Fix the issue of mobile banking redirect URI not working in Android chrome.

Jira Ticket: #438

2. Description of change

The HTTP_SEC_FETCH_SITE header returned none which indicates that the request is user originated even though it was originated from the mobile banking app. This caused the site to redirect to checkout page.

In this PR, we created a random unique token, saved it as a metadata to the order and added it to the return URI. When the site gets the redirect URI request, if the token is present, we check the token with the token saved in the order. If it matches we continue the process and show the success/failed page else we redirect to checkout page.

For now, it is just in mobile banking payment to solve the redirect URI issue. In the future we will implement this in all other payment methods as relying on HEADERs is not reliable.

3. Quality assurance

Use UAT testing mobile app and checkout with mobile banking payment. If it is not available then use the production keys and test in production environment.

🔧 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 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication