-
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
Add support for allowedShippingCountries in Express Checkout Element #9592
Add support for allowedShippingCountries in Express Checkout Element #9592
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: +44 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
Don’t send the full country list in the two cases where all countries would be sent
f3552d8
to
606ec49
Compare
includes/express-checkout/class-wc-payments-express-checkout-button-handler.php
Outdated
Show resolved
Hide resolved
…ries-in-express-checkout-element
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.
LGTM!
✅ Verified checkout functionality across all specified shipping and selling location configurations (product, cart, and checkout pages—blocks and shortcode). All cases functioned as expected.
Implements #9104
Changes proposed in this Pull Request
Adds support for specifying allowed shipping countries (
allowedShippingCountries
) in the Express Checkout Element.Testing instructions
Tip
If you want to test with multiple addresses from different countries, you can add yourself to the Google test card suite group. In test mode, you’ll have access to a set of test cards, rather than the cards associated with your production account.
https://developers.google.com/pay/api/web/guides/resources/test-card-suite
Note
To test the changes introduced here, we first need to create shipping options for at least two countries. In this case the countries will be USA and Brazil. You can create a "Flat rate" shipping method for both countries. That will be sufficient.
Note
The test results should be the same for all the pages affected by this PR: Product Page, Cart Page, Checkout Page, Cart shortcode, and Checkout shortcode. (Does not apply to the "Pay for Order" page.)
Note
All cases should be tested in the same way:
Note
Since this PR includes many combinations to test, and given that ECE has two different implementations, I would suggest testing at least the Checkout (block) page and the Shortcode Checkout page. That would cover both ECE implementations currently in WooPayments.
Important
Test with Apple Pay on at least the pages mentioned above. The results should be the same for each test.
Case 1: "Shipping location(s)" is set to "Ship to all countries you sell to"
Case 2: "Shipping location(s)" is set to "Ship to all countries"
This option ignores the value set in "Selling location(s)", therefore:
Case 3: "Shipping location(s)" is set to "Ship to specific countries only" and "Ship to specific countries" is set to "Brazil"
Potential Issues:
If, during testing, you find that you can’t open the payment sheet and see the following error in the browser console:
This is a known issue and has been reported here. One way to fix it is by clearing all cookies and starting again. Another way is to go to the checkout page and change the shipping address to a country with shipping options, such as the USA or Brazil.
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