#ursus0055_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ 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.
Hi, let me help you with this.
What do you mean by "setup intent that has already been saved" exactly?
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)
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?
yes exactly
but all the code I've seen the component PaymentElement it seems never takes parameters
For cards you can show brand, expiry date, last 4 etc: https://docs.stripe.com/api/payment_methods/object#payment_method_object-card-brand
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.
oh ok I see.
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.
ok, thank you very much vanya, very helpful