-
Notifications
You must be signed in to change notification settings - Fork 213
Restrict Affirm and Klarna to domestic and cross EEA border transactions #3108
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
Restrict Affirm and Klarna to domestic and cross EEA border transactions #3108
Conversation
Placing this one on-hold as I think there's a better way to approach this and it will fix it for the Block checkout too. |
*/ | ||
public function get_countries() { |
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.
This function was only used to populate the JS data with a list of eligible countries. Given I've changed it's purpose to return billing countries, I changed the name. Because this function is unreleased, there are no backwards compatibility concerns here.
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 tackling this, @james-allan ! Things look good to me 👍
I tested the following scenarios:
US Stripe account
✅ Domestic country - US
✅ Non-domestic, Klarna-supported country - AU
✅ Non-supported country - MX
France Stripe account
✅ Domestic country - FR
✅ Country from within the EEA - ES
✅ Non-domestic, Klarna-supported country - AU
✅ Non-supported country - MX
UK Stripe account
✅ Domestic country - UK
✅ Non-domestic, Klarna-supported country - AU
✅ Non-supported country - MX
🟡 Cross-border transactions where the currency of the Stripe account and the customer billing country don't match are failing. We could address that separately - #3118
This PR also fixed a console error we were getting when changing the billing country from a non-supported to a supported one 🎉
Glad to see this merged. Thanks again!
Merging this PR to create the test package! |
Fixes #3096
Changes proposed in this Pull Request:
Customers paying with Klarna, Affirm and Afterpay/Clearpay have specific cross border restrictions they must adhere to. ie Customers can only purchase from the same country the Stripe account is located. eg AU to AU. The one exception to this is Klarna where customers and merchants located in the European Economic Area (EEA) + the UK and Switzerland can also transact. eg a customer in the UK can transact with a merchant in Germany.
This is documented in Stripe docs:
This PR implements this restriction by ensuring that the payment method is only enabled on checkout if the transaction is considered domestic using their respective ruleset.
Testing instructions
Strictly Domestic - eg US.
EEA
changelog.txt
andreadme.txt
(or does not apply)Post merge