#iammaxim_code
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
âąď¸ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!
đ 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/1212519236975726704
đ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
â˛ď¸ 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. Thank you for your patience!
Hello! We'll be with you shortly. 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.
- iammaxim_unexpected, 4 hours ago, 15 messages
- iammaxim_unexpected, 18 hours ago, 13 messages
previously we would use:
stripe.Customer.delete_source(
stripe_link.stripe_cus_id,
card_id
)
Hi, the code you shared is the legacy Sources API. With the Payment Method API, https://docs.stripe.com/api/payment_methods/detach you can only pass the payment method id and not the customer id.
when detaching a pm, is it possible to automatically have the next pm become the default payment?
otherwise a user might remove the default and forget to make the other pm the default payment
after which I presume a subscription payment would fail
No, it won't automatically happen. You would need to make an excplicit call on the server side, https://docs.stripe.com/api/customers/update#update_customer-invoice_settings-default_payment_method to make the next payment method as the default. My recommendation is that you listen to the the payment methods detached event, https://docs.stripe.com/api/events/types#event_types-payment_method.detached on your end, and then look at the customer to see if there is another payment method to make it the default payment method.