-
Notifications
You must be signed in to change notification settings - Fork 69
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
Implement Stripe Link with deferred intent UPE #6784
Implement Stripe Link with deferred intent UPE #6784
Conversation
…-stripe-link-with-deferred-intent
…heckout service tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the previous threads are now successfully closed 👍 Thanks for going through them, Samir! I've found two more things not fully working as expected:
1️⃣ Stripe Link isn't initilized with more than one payment method enabled. I'd wait for #6790 to be resolved and my hunch is the issue with Stripe Link should be resolved as well.
2️⃣ When using Stripe Link to pay for a subscription and thus saving the payment method for the future use, we get an error on the My account page while listing all the available payment methods.
I'll try to get back to the 2️⃣nd issue after I finish #6790, since you're AFK this week.
Latest changes
Testing outcome
Follow-ups
|
Fixes #6391
Fixes #6709
Fixes #6261
Changes proposed in this Pull Request
Linking up with Stripe Link
This implements Stripe Link in both shortcode and blocks checkouts, while using the deferred intent split UPE. The changes involved are somewhat less dramatic than they might appear. The client-side integration remains mostly the same, using the existing exportable integration with the deferred intent checkout scripts. On the server-side, we need to ensure that, when Link is enabled,
link
is added alongsidecard
in thepayment_method_types
value sent to Stripe and we must also add a newmandate_data
value, which is fortunately already an available parameter on the Payments Server.Scattered in amongst this implementation are a few fixes to the blocks checkout parameters and some fixes to how session intent data is stored and cleared, just FYI.
Steps to enable Stripe Link
Stripe Link is only available to US stores, so you will need to onboard your test site with Stripe by using a US-based address. Other than please enable the deferred intent UPE via the dev tools and you should be able to enable Link from the Payments settings, when WooPay is disabled. If Link does still not appear on your Payments settings screen, you may need to visit the Stripe dashboard for your site's account and ensure that the Link capability is requested and active. After requesting the capability, clear your Payments Server cache and hopefully Link will appear before your eyes.
How to checkout with Stripe Link
Link is only available to US stores and consequently is also only compatible with USD at checkout. When these conditions are met, you should find that the email input rises to the top of the checkout and has a Link icon attached to it. This icon is a button that will trigger the Link checkout experience.
However, if you do not immediately see this button, you should be aware that this button is linked to the payment element and only present once this element has been mounted to the DOM. In the shortcode checkout, we mount all the payment elements immediately on page load, so this button should appear immediately without any encouragement. On the blocks checkout, however, we only mount payment elements when the relevant payment gateway is selected, so you may need to select the CC payment gateway radio button first, in order to mount the element and summon the Link button from of its slumber.
If your email address is not identified, you should trigger the registration "Save your info" checkbox to be added to the payment element; whereas if your email address is identified, you will instead trigger the OTP authentication modal to appear on top of the checkout. Note that in test mode, when you register a new Link account it will only be usable with the Stripe account where this Link account is registered and cannot be used across different sites connected to the same platform. Additionally, while registration requires a phone number, in test mode Link will never send actual SMS codes to your device: you can instead use the top-secret code
000000
every time to surpass the OTP challenge.Testing instructions
Stripe Link should be implemented on both blocks and shortcode checkout pages, so these will need to be tested. Here are some combinations of features you should probably ensure are working.
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge