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

[ECE] Hide express checkout if cards are disabled #3589

Merged
merged 9 commits into from
Nov 8, 2024

Conversation

annemirasol
Copy link
Contributor

@annemirasol annemirasol commented Nov 5, 2024

Fixes #3546

Changes proposed in this Pull Request:

When credit cards are not enabled, using Apple Pay/Google Pay will result in an Invalid payment method error. This is because checkout fails validation due to the stripe payment gateway not being available.

In this PR, when credit cards are not enabled, we will not display Apple Pay/Google Pay for block cart and block checkout, as well as the wp-admin Payment Methods page. This is already the behavior for shortcode checkout, shortcode cart and product pages.

In #3593, we will investigate whether we can (and want to) make express checkout work even when cards are not enabled. This PR is focused only on avoiding presenting a broken payment method to the customer.

Testing instructions

Test for wp-admin changes

  1. As a merchant, disable Credit card / debit card as a payment method.
  2. In develop, the Express checkout section still displays Apple Pay/Google Pay as an option.
  3. In this branch, the Express checkout section displays a notice that credit card payments are required for express checkout.

Test for store-side changes

  1. Checkout and build develop.
  2. As a merchant, disable Credit card / debit card as a payment method, but enable Apple Pay/Google Pay
  3. Enable some other payment method, like CashApp.
  4. As a shopper, add a product to your cart.
  5. Apple Pay/Google Pay will still be available in the block cart and block checkout pages, but using them will lead to Invalid payment method error.
  6. Checkout and build this branch.
  7. Apple Pay/Google Pay should no longer be available. Verify that this is true for both block cart and block checkout.
  8. Verify that this is true for both ECE and PRB, by manipulating WC_Stripe_Feature_Flags::is_stripe_ece_enabled().

Screenshots

Admin-side changes: When Credit card / debit card is disabled, Apple Pay/Google Pay is hidden, similar to how it Link already behaves.
Screenshot 2024-11-06 at 12 10 39 PM


  • 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

@annemirasol annemirasol force-pushed the fix/3546-hide-ece-if-cards-disabled branch from a506cae to 2023092 Compare November 6, 2024 16:11
@annemirasol annemirasol requested review from a team and mattallan and removed request for a team November 6, 2024 19:49
Copy link
Contributor

@mattallan mattallan left a comment

Choose a reason for hiding this comment

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

Nice changes here @annemirasol ! Code LGTM and I didn't notice any issues while testing :shipit:


Stripe Settings

  • With cards disabled, confirm Apple/Google Pay is hidden (similar to link)
develop This Branch
rqRYkN.png image

Frontend

  • With cards disabled and Apple/Google Pay + another Stripe payment method enabled, confirm the ECE buttons are not loaded on product pages, shortcode cart/checkout pages & block cart/checkout pages (fixed by this PR).

@annemirasol annemirasol merged commit eb0f1f8 into develop Nov 8, 2024
34 of 35 checks passed
@annemirasol annemirasol deleted the fix/3546-hide-ece-if-cards-disabled branch November 8, 2024 15:40
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.

[ECE] Do not display ECE/PRB when CC is not enabled
2 participants