#alecpope_api
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/1298558939482423296
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
You should update the Customer's invoice_settings.default_payment_method, and set it to the PaymentMethod coming from the SetupIntent pm_xxx
Thanks! So, when the customer is confirming the setup intent, I need to update the customer? Then I need to implement webhooks, right?
Correct.
Okay, thank you very much! Is there also a possibility that the user creates the subscription and automatically adds the payment method to it's account? Or is it required to do the setup intent beforehand?
In the simplest form you don't need an extra SetupIntent: https://docs.stripe.com/billing/subscriptions/build-subscriptions?ui=elements
Thanks. I will try it out! Maybe one more question: when the user has a payment method - how can I display it to the user? Is there a preconfigured UI element that can be used? The only elements I saw are used for actually paying/confirming something
Are you using Payment Element?
Yep
There's a new feature that allows you to re-display saved Payment Methods: https://docs.stripe.com/payments/save-customer-payment-methods
How I understand this, it is used for reusing existing payment methods, or?
What I mean is to show the customer that he already has a payment method. Something like "MasterCard: **** **** **** 0101"
You can then list Customer's PaymentMethods and display it in your own UI: https://docs.stripe.com/api/payment_methods/customer_list
Okay, but the rendering of each payment method needs to be custom implemented? Because there are a lot of payment methods and I wanted to be sure if there is already an existing UI element
There's no other built-in component, unfortunately.
Alright, thanks for the info and thank you very much for your help!
Happy to help.