#yelldoggie

1 messages · Page 1 of 1 (latest)

jolly gardenBOT
magic whale
#

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?

fervent stream
#

yeah, exactly

#

the button submits the payment element, and then assuming no errors there, the form submits to my server

magic whale
#

Okay, could you reverse that? Submit the subscription and return the latest_invoice.payment_intent.client_secret to use when confirming the payment?

fervent stream
#

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.

magic whale
#

Not if you are using our deferred intent flow

fervent stream
#

that'll work if the PaymentIntent is being automatically created by a Subscription instead, yeah?

magic whale
#

In that flow you only need the clientSecret to have a value when you call stripe.confirmPayment()

fervent stream
#

oh cool

magic whale
#

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

fervent stream
#

i think that does work for me then

magic whale
#

and use it when calling the confirmPayment() function

fervent stream
#

ok yeah, i think this is the info I needed. Thanks a ton!