#yelldoggie
1 messages · Page 1 of 1 (latest)
hi 👋
This would be tough to implement since the first invoice will finalize immediately and you cannot add items after that.
But wait... I on'y see one button on that page. Does that mean the payment element would only be submitted when the Start My Membership button is clicked?
yeah, exactly
the button submits the payment element, and then assuming no errors there, the form submits to my server
Okay, could you reverse that? Submit the subscription and return the latest_invoice.payment_intent.client_secret to use when confirming the payment?
i could but wont that still cause Elements to re-render, and for the user to lose any input they've already given? Elements takes the client_secret as a prop.
that'll work if the PaymentIntent is being automatically created by a Subscription instead, yeah?
In that flow you only need the clientSecret to have a value when you call stripe.confirmPayment()
oh cool
If you go through that flow then you will need to submit the subscription information to your server and get back the client secret in the form Submit handler
i think that does work for me then
and use it when calling the confirmPayment() function
ok yeah, i think this is the info I needed. Thanks a ton!