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

Amazon Pay ECE: fix payment method issues for subscriptions #4008

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

annemirasol
Copy link
Contributor

@annemirasol annemirasol commented Mar 4, 2025

Part of #3859
Fixes #3937
Fixes #3938

Changes proposed in this Pull Request:

This PR fixes subscription renewal issues for Amazon Pay, by adding logic to save payment method details in the subscription meta, and creating a payment token for the payment method.

Testing instructions

  1. Install Subscriptions, and add a simple subscription product.
  2. Turn on the feature flag for Amazon Pay by using the Stripe helper plugin or by setting _wcstripe_feature_amazon_pay to yes in wp_options.
  3. Enable Amazon Pay as a payment method.
  4. As a shopper, purchase a subscription using Amazon Pay.
  5. In My Account > Payment methods, verify that you can see the Amazon Pay saved payment method.
  6. In My Account > My Subscription, verify that you can see the subscription's payment info as "Via Amazon Pay (<your Amazon Pay email address>)"
  7. Go to the subscription page and process a renewal. Verify that the renewal order succeeds.
  8. As a shopper, add a product to cart and go to checkout.
  9. Use the Amazon Pay saved payment method to purchase the product.

  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Changelog entry

  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Comment

Comment

Post merge

@annemirasol annemirasol force-pushed the fix/amazon-pay-subscriptions branch from dc56c8f to 35e792a Compare March 14, 2025 17:30
@annemirasol annemirasol self-assigned this Mar 14, 2025
@annemirasol annemirasol force-pushed the fix/amazon-pay-subscriptions branch 3 times, most recently from f0ad153 to 822dc7f Compare March 14, 2025 21:37
@annemirasol annemirasol force-pushed the fix/amazon-pay-subscriptions branch 2 times, most recently from c6e7834 to 49a5b57 Compare March 18, 2025 20:12
@annemirasol annemirasol force-pushed the fix/amazon-pay-subscriptions branch 2 times, most recently from e88bc99 to fa2e30a Compare March 19, 2025 19:52
@annemirasol annemirasol force-pushed the fix/amazon-pay-subscriptions branch from fa2e30a to 2978d4a Compare March 19, 2025 19:59
@annemirasol annemirasol marked this pull request as ready for review March 19, 2025 20:37
@annemirasol annemirasol requested review from a team and malithsen and removed request for a team March 19, 2025 22:27
Copy link
Contributor

@malithsen malithsen left a comment

Choose a reason for hiding this comment

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

Great work here 👏

Tests well and the code looks great. I left a couple of comments mostly out of curiosity and not expecting changes.

Copy link
Contributor

@malithsen malithsen left a comment

Choose a reason for hiding this comment

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

The latest refactor looks great.

✅ Retested subscriptions with Amazon Pay
✅ Smoke tested some flows (Credit card payments, payment method updates)

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: Subscription renewal failure. Payment: N/A when purchasing subscription with Amazon Pay
2 participants