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] Apple Pay session cannot be created for Express Checkout Element unless domain is registered with new endpoint #9098

Closed
ricardo opened this issue Jul 15, 2024 · 2 comments · Fixed by #9139
Assignees
Labels
component: checkout Issues related to Checkout focus: checkout payments 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

@ricardo
Copy link
Member

ricardo commented Jul 15, 2024

Describe the bug

When clicking the Apple Pay button with the _wcpay_feature_stripe_ece option set to 1, the Apple Pay dialog closes and an error is thrown in the console:

Could not create Apple Pay session. Please make sure you have registered this Stripe account. For more information, see https://stripe.com/docs/apple-pay#web.

This is because we need to register the domain first with this new endpoint: https://api.stripe.com/v1/payment_method_domains (src).

We might want to consider setting applePay to auto instead of always when rendering the button to make sure it's not available in case the domain verification has failed or the button shouldn't be displayed for some reason.

To fix this, we can update or add a new endpoint to the server and trigger domain registrations when WooPayments gets updated:

add_action( 'woocommerce_woocommerce_payments_updated', [ $this, 'verify_domain_on_update' ] );

To Reproduce

  1. Enable the ECE flag.
  2. Change your domain with JT/ngrok.
  3. As a shopper on Safari, try to checkout with Apple Pay.
  4. Notice the Apple Pay modal opens up, but closes shortly after.
@ricardo ricardo added type: bug The issue is a confirmed bug. component: checkout Issues related to Checkout labels Jul 15, 2024
@rafaelzaleski rafaelzaleski added focus: checkout payments priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. labels Jul 16, 2024
@bborman22
Copy link
Contributor

Hey team! Please add your planning poker estimate with Zenhub @rafaelzaleski @ricardo

@bborman22
Copy link
Contributor

Just noting that as part of this issue, let's also remove the now unnecessary limitation on Apple Pay registration in test mode. This way it's easier to test Apple Pay going forward.

@ricardo ricardo changed the title Apple Pay session cannot be created for Express Checkout Element unless domain is registered with new endpoint [ECE] Apple Pay session cannot be created for Express Checkout Element unless domain is registered with new endpoint Jul 16, 2024
@rafaelzaleski rafaelzaleski self-assigned this Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: checkout Issues related to Checkout focus: checkout payments 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