#antonio-giano_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/1225509153217314889
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- antonio-giano_best-practices, 1 hour ago, 9 messages
- antonio-giano_defaultpm, 6 days ago, 5 messages
Hello
So you are already collecting a PaymentMethod using the PaymentIntent or SetupIntent from the Subscription and then you would also like to collect another PaymentMethod?
Yes, initially the paymentMethod is implemented through subenrollment. After that, I want to give the possibility to store an additional credit card (so another paymentMethod).
Sorry, i confuse. I mean the payment element. What I want to understand is how to implement the logic mentioned earlier.
Got it, then you follow https://docs.stripe.com/payments/save-and-reuse?platform=web&ui=elements
Basically you create a SetupIntent on your server and pass its client secret to your client and use confirmSetup() client side
Got it.
Following this guide, how would it then work with payment method management. I give an example for better understanding: a customer enters a new credit card. And he will use this to pay the next month's invoice of the subenrollment.
In order to handle this logic, do I need to do any manual steps? For example, retrieving the paymentMethod id created and then updating the default_payment_method field within the invoice_setting field of the customer object?
Yep that's exactly right
You can use Test Clocks (https://docs.stripe.com/billing/testing/test-clocks) to test this end to end as well
Perfect, thank you a lot!