#benbartling - Payment Element

1 messages · Page 1 of 1 (latest)

deft tartan
#

Hi 👋
You would either need to know before rendering the Payment Element or try to re-render with a different client_secret

elder sage
#

Thanks for the quick reply!

When you say "re-render" you mean destroy the existing Payment Element and initialize a new one with the new client_secret, correct? In this scenario, any interaction the customer has had with the Payment Element will be wiped and they'll have to start over, correct?

deft tartan
#

Yes, unless you are able to store their information in a state variable using the .change listener then all their information will be gone.

#

I haven't tried that approach though because it sounds messy to me. I just hide the payment element until I'm sure how much I plan to charge.

elder sage
#

Ok, makes sense, thanks.