-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Hide payment methods with domestic transactions restrictions (Klarna, Affirm, Afterpay) when conditions are not met #8980
Fix: Hide payment methods with domestic transactions restrictions (Klarna, Affirm, Afterpay) when conditions are not met #8980
Conversation
…able countries for Klarna
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.25 MB ℹ️ View Unchanged
|
'UK account with EUR store currency' => [ | ||
'account_country' => Country_Code::UNITED_KINGDOM, | ||
'site_currency' => Currency_Code::EURO, | ||
'expected_result' => [ | ||
Country_Code::AUSTRIA, | ||
Country_Code::BELGIUM, | ||
Country_Code::FINLAND, | ||
Country_Code::GERMANY, | ||
Country_Code::IRELAND, | ||
Country_Code::ITALY, | ||
Country_Code::NETHERLANDS, | ||
Country_Code::SPAIN, | ||
], | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this is a valid scenario, currently there is not way to manually test it due to the limitations described here #8718 (comment) Which should be addressed as part of a new issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting this fixed!
Fixes #8718
Changes proposed in this Pull Request
This PR performs a similar fix as the one performed here woocommerce/woocommerce-gateway-stripe#3108, the same PR description also applies here:
The only significant difference in this PR, is that we also perform a currency check for Klarna and EEA/UK/CH purchases in order to validate that the presentment currency matches the customer's country. This prevents, for example, showing Klarna when the customer country is Spain (ES) but the currency is set to GBP, since Spain's domestic currency is EUR (even if both currencies are technically supported).
Testing instructions
Scenarios
Use these provided scenarios along with the instructions to validate the expected result. Please note that this list of scenarios is not exhaustive, but should cover the most significant combinations.
Account Country
checkout
*Note: You can replace Belgium (BE) with any of the countries in this list (except Spain) to achieve the same results.
?currency=<Store Currency>
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge