-
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
Revert "Revert "Displaying Clearpay instead of Afterpay for UK based stores"" #8046
Revert "Revert "Displaying Clearpay instead of Afterpay for UK based stores"" #8046
Conversation
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: +602 B (0%) Total Size: 1.27 MB
ℹ️ View Unchanged
|
@@ -267,13 +267,14 @@ public function __construct( | |||
$this->localization_service = $localization_service; | |||
$this->fraud_service = $fraud_service; | |||
|
|||
$account_country = $this->get_account_country(); |
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.
Noting that I reached out to the Architecture Team about this and they confirmed that this isn't the best way to go about this: p1705510123965239-slack-C0208C3BXHP
I think that if we need the account's country for something before the plugin is fully initialized, we should likely save the account's country in an option somewhere that would allow us to pull it with WP core functions that do not try to use services in the client plugin. The account country should be static, as it is not possible to change the country on an account, so if the value was saved on a previous load it would remain.
The woocommerce_payments_account_refreshed
hook could be used to call a method to save the country in its own option in the database.
We could also see if it's possible to set the country in the account object that's saved in the woocommerce_woocommerce_payments_settings
, and then that option could be pulled via a private method in this class to get the country.
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.
The changes look good, are identical to the changes in #7995. I went through the history of these changes and I understand that we are merging this back after improving logger class & dev tools in separate PRs.
I've also tested it, Clearpay/Afterpay show up correctly depending on the country. I also performed a successful purchase by using Clearpay.
Approving this PR with the assumption that the merge conflicts will be solved as well as #8046 (comment) should be still resolved, especially given there are some options available in that thread. Thanks @gpressutto5!
Reverts #8034
Fixes #6425
Changes proposed in this Pull Request
Based on the account country set in Stripe, we should display Clearpay instead of Afterpay everywhere.
Testing instructions
(clear)
from the latest devtools works as expectedUsing this branch and a Stripe account with a UK address access all pages that show payment methods and ensure Clearpay name and logo is used instead of Afterpay. Some pages you should check:
Then update to a Stripe account from the US and ensure we show Afterpay instead of Clearpay.
I recommend using the Jurassic Ninja link bellow twice and creating different stripe test accounts.
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