#mtoledo2
1 messages · Page 1 of 1 (latest)
Hello
Why exactly do you want to collect the card twice? Why not just collect it once and make it clear on the site that it is going to be used for two separate charges?
Or are you expecting to collect two different cards here?
Ah gotcha.
In that case you can always initialize Stripe.JS twice and mount two different Payment Elements.
Should work just fine
Ah actually this is harder with React
Missed that you mentioned that above
I think you can render multiple Elements providers in this case though?
I haven't tried that myself
Yeah the react part is the complicated part.
Using nextjs so can go with a different route and use the same component and should just work was my thinking
But actually multiple elements might work too
Yeah if you want you can certainly just destroy the initial one and remount it again after the first submission
You would use https://stripe.com/docs/js/element/other_methods/destroy to do that then you would want to re-create your Elements provider with your new client secret
actually jk I checked. I am rendering multiple elements but yeah would need to destroy
hmm let me give that a try
Alright yeah I just tested with two different Elements Providers and rendering two Payment Elements and that does work fine
So that's an option if you don't want to go the destroy and recreate route
👍
I was rendering same component the first time not 2 instances
Gotcha