#HS
1 messages · Page 1 of 1 (latest)
You could try this method where the subscription isn't created until after payment details are collected: https://stripe.com/docs/payments/accept-a-payment-deferred?platform=web&type=subscription
I had looked at that, but I was wondering that method requires passing an amount and currency during elements initialization. I'll have the price id available during page load (which I'll be passing to the backend for subscription creation).
So, if I initialize the elements using an amount and currency on the frontend, but then on the backend I use the price id to create the subscription. Will it cause any conflict during confirmPayment step?
There shouldn't be an issue. The amount passed to elements just needs to match the amount the customer will pay for that first payment
Ok great, I'll give that a try.
Another question, similar to the Stripe checkout, is there any way to get the Link authentication working here as well?
Basically have the email field tied to the link authentication, so if the user wants they can sign-up or if they already have a link account, they can simply login using one-time passcode?
The field in the form is setup like this
<div id="link-authentication-element"> <!-- Elements will create authentication element here --> </div>
And then the JS to mount the link auth element.
const linkAuthenticationElement = elements.create("linkAuthentication"); linkAuthenticationElement.mount("#link-authentication-element");
But I still do not see any option to use link on that page, just a regular email input. Am I missing some other elements and code to get this working with custom checkout?
I think that's correct. See: https://stripe.com/docs/payments/elements/link-authentication-element
You need to type email first for something else to show