#ursus0055_best-practices

1 messages ¡ Page 1 of 1 (latest)

radiant orchidBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1332340363276587070

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

frozen sable
#

Hi, let me help you with this.

#

What do you mean by "setup intent that has already been saved" exactly?

crisp quiver
#

I mean, I'm looking for a way to show the form with some information visible about the setup intent that has already been saved in stripe.

#

setup intent not saved yet => form empty and you can save the info (and this is done)
setup intent already been saved => form with the info filled (the one we can display al least)

frozen sable
#

SetupIntent is a transactional object, which has no use after it is completed. It produces a PaymentMethod object, which is a persistent object. Do you mean you want to show details of the Customer's saved PaymentMethods on this page?

crisp quiver
#

yes exactly

#

but all the code I've seen the component PaymentElement it seems never takes parameters

frozen sable
#

You don't need Payment Element for that. You can just fetch the Customer's attached PaymentMethods, and display their properties in your own UI.

crisp quiver
#

oh ok I see.

frozen sable
#

Please note, a Customer can have multiple Payment Methods attached, so would suggest showing all of them. I would also recommend keeping a Payment Element with a new SetupIntent to add a new PaymentMethod, if needed.

crisp quiver
#

ok, thank you very much vanya, very helpful