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] Do not display ECE/PRB when CC is not enabled #3546

Closed
annemirasol opened this issue Oct 24, 2024 · 2 comments · Fixed by #3589
Closed

[ECE] Do not display ECE/PRB when CC is not enabled #3546

annemirasol opened this issue Oct 24, 2024 · 2 comments · Fixed by #3589
Assignees
Labels
component: ECE Issues related to Express Checkout Element priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.

Comments

@annemirasol
Copy link
Contributor

annemirasol commented Oct 24, 2024

Describe the bug
When express payment methods are enabled, but credit cards are not, Apple Pay and Google Pay are still available in the product, cart and checkout pages. However, the shopper cannot complete their purchase using them, and the order results in an Invalid payment method error.

To Reproduce
Steps to reproduce the behavior:

  1. As a merchant, enable Apple Pay/Google Pay, but disable Credit card / debit card as a payment method.
  2. Enable some other payment method, like CashApp.
  3. As a shopper, add a product to your cart.
  4. Verify that Google Pay and/or Apple Pay are displayed in the product, cart and checkout pages.
  5. Attempt to complete the purchase using Google Pay or Apple Pay. Notice that it will let you launch the payment modals.
  6. After clicking "Pay", the order will fail with an Invalid payment method error.
    Expected behavior
    I expect Apple Pay/Google Pay to not be displayed if the shopper cannot finish their purchases using said methods.

Screenshots
Image

@annemirasol annemirasol added type: bug The issue is a confirmed bug. component: ECE Issues related to Express Checkout Element labels Oct 24, 2024
@james-allan
Copy link
Contributor

@annemirasol I haven't been able to replicate the Google or Apple Pay buttons being shown on the product page following your steps.

I think this issue is limited to the block cart and block checkout pages.

It's my understanding that this is because how display_express_checkout_button_html() determines if it should load the element for mounting the buttons to. In my testing display_express_checkout_button_html() isn't outputting the mounting element when cards are disabled and so even though the JS does everything else to render the buttons, there's no element to mount them to. There's nothing like this on the block powered pages, WC core mounts the buttons for us when we register them.

So, IMO we have 2 options here:

  1. Make the block cart and checkout pages consistant with the other pages. ie Don't render them if cards are disabled.
  2. Work out if we can support these express buttons even if cards are disabled.

The reason I've mentioned that second option is because if you disable cards in your Stripe settings you'll notice that Link disappears as an available express checkout method. Google and Apple Pay remain. I'm not sure if that's communicating that they should still work. 🤷‍♂

@wjrosa wjrosa added the priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. label Oct 28, 2024
@annemirasol
Copy link
Contributor Author

@james-allan Thanks! I've updated the description and removed the product page from the affected pages.

So, IMO we have 2 options here:

I have no strong opinion here, but if we go for option #1, i.e. do not render, it would be great if we make the payment methods admin page's behavior consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ECE Issues related to Express Checkout Element priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants