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: update selected payment method #4082

Merged
merged 6 commits into from
Mar 18, 2025

Conversation

annemirasol
Copy link
Contributor

@annemirasol annemirasol commented Mar 17, 2025

Part of #3859
Builds on changes introduced in #4015 and #4022
Prerequisite for #4008

Changes proposed in this Pull Request:

As part of supporting subscriptions and saved payment methods for Amazon Pay, we want Amazon Pay orders to use amazon_pay instead of card as the selected payment method, for the following reasons:

  • When crafting payment method options, we need to use amazon_pay instead of card. Otherwise, the payment method will not attach to the customer.
  • We need to have a separate logic when creating payment tokens. Amazon Pay does not expose card details such as last 4 digits or brand, so we cannot use the existing payment token logic for cards.

This PR also removes overrides and custom logic that are no longer necessary:

  • Payment method title overrides. No longer necessary as Amazon Pay is now its own payment method and no longer riding on the card payment method.
  • Code for warning shoppers regarding delayed payment verification. No longer necessary as Amazon Pay does not have to be async after all.

Testing instructions

  1. Turn on the Amazon Pay feature flag using the Stripe helper plugin, or by setting _wcstripe_feature_amazon_pay to yes in wp_options.
  2. As a shopper, purchase any product using Amazon Pay.
  3. In the Order Received confirmation page, verify that the payment method correctly says "Amazon Pay".
  4. In wp-admin Edit Order page, verify that the order says "Payment via Amazon Pay".
  5. In Stripe settings, enable manual capture, i.e. Issue an authorization on checkout, and capture later.
  6. As a shopper, make another purchase via Amazon Pay.
  7. As the merchant, manually capture the charge by setting the order to "Processing".
  8. Verify that the charge was successfully captured.
    • Under Order Notes, you will see a Stripe charge complete (Charge ID: py_xxxx) note.

  • 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

Sorry, something went wrong.

@annemirasol annemirasol changed the title Update/amazon pay as payment method Amazon Pay ECE: update selected payment method Mar 17, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@annemirasol annemirasol force-pushed the update/amazon-pay-as-payment-method branch 3 times, most recently from 7d5bdc8 to c39e1ac Compare March 17, 2025 17:39
@annemirasol annemirasol force-pushed the update/amazon-pay-as-payment-method branch from c39e1ac to 1ab9516 Compare March 17, 2025 17:41
@annemirasol annemirasol force-pushed the update/amazon-pay-as-payment-method branch from 1ab9516 to e179b5e Compare March 17, 2025 17:44
@annemirasol annemirasol self-assigned this Mar 17, 2025
@annemirasol annemirasol marked this pull request as ready for review March 17, 2025 18:40
@annemirasol annemirasol requested review from a team, malithsen and Mayisha and removed request for a team March 17, 2025 18:40
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.

👍 Code looks good and tests well. Thanks for the PR!

@annemirasol annemirasol enabled auto-merge (squash) March 18, 2025 15:24
@annemirasol annemirasol merged commit 91353c5 into develop Mar 18, 2025
36 of 38 checks passed
@annemirasol annemirasol deleted the update/amazon-pay-as-payment-method branch March 18, 2025 15:35
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.

None yet

2 participants