Skip to content
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 currency restriction pill on Amazon Pay #3856

Merged
merged 3 commits into from
Feb 7, 2025

Conversation

hsingyuc
Copy link
Contributor

@hsingyuc hsingyuc commented Feb 7, 2025

Fixes #3834

Changes proposed in this Pull Request:

With Amazon Pay being restricted to USD, we need to either hide Amazon Pay in settings if store currency is not USD, or similar to other payment methods, display a "Requires currency" notice beside it. For consistency and future implementation, this PR chose to follow other payment methods, adding a currency restriction pill and rendering next to the payment method in the settings when the shop's currency is not supported.

Screenshot 2025-02-06 at 9 08 14 PM

Testing instructions

  1. With the feature flag off -- this is the default -- verify that Amazon Pay is not available in Stripe settings or in any store page.
  2. Turn the feature flag on, by setting the _wcstripe_feature_amazon_pay option to yes.
  3. Verify that Amazon Pay is now available in Stripe settings.
  4. Go to WC->Settings->General->Currency options
  5. Set the currency to a non-USD currency
  6. Go to WC->Settings->Payments->Stripe->Express checkouts section
  7. See Requires currency pill next to Amazon Pay
  8. Confirm Amazon Pay button doesn't show on the product, cart, checkout pages
  9. Go back to WC->Settings->General->Currency options
  10. Set the currency to USD
  11. Go back to WC->Settings->Payments->Stripe->Express checkouts section
  12. Should not see the Requires currency pill next to Amazon Pay

  • Covered with tests (or have a good reason not to test in description ☝️)
  • Added changelog entry in both changelog.txt and readme.txt (or does not apply)
  • Tested on mobile (or does not apply)

Post merge

@hsingyuc hsingyuc self-assigned this Feb 7, 2025
@hsingyuc hsingyuc requested review from a team and diegocurbelo and removed request for a team February 7, 2025 02:58
Copy link
Member

@diegocurbelo diegocurbelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes look good, and it tests well 🚢

@hsingyuc hsingyuc merged commit 344996f into develop Feb 7, 2025
37 checks passed
@hsingyuc hsingyuc deleted the add/add-currency-restriction-pill-on-amazon-pay branch February 7, 2025 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Amazon Pay: enforce or notify merchants of presentment currency
2 participants