#mtoledo2

1 messages · Page 1 of 1 (latest)

mortal apexBOT
robust kindle
#

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?

white glen
#

I'm expecting 2 different cards

#

It should always be 2 different cards actually

robust kindle
#

Ah gotcha.

#

In that case you can always initialize Stripe.JS twice and mount two different Payment Elements.

#

Should work just fine

mortal apexBOT
robust kindle
#

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

white glen
#

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

robust kindle
#

Yeah if you want you can certainly just destroy the initial one and remount it again after the first submission

white glen
#

actually jk I checked. I am rendering multiple elements but yeah would need to destroy

#

hmm let me give that a try

robust kindle
#

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

white glen
#

Just completed that same exact test and worked for me haha

#

Awesome, thanks!

robust kindle
#

👍

white glen
#

I was rendering same component the first time not 2 instances

robust kindle
#

Gotcha