#kevin-r_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/1435346283832545391
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there
very well. I figured it was generally random, but I could totally see a remote Stripe coder living in ND. (Bundled up)
๐
OK, so I'm going to look for payment_methods, sources ,and invoice_settings.default_payment_method.
Anyways, in terms of precedence... this only matters for Subscriptions/Invoices
Otherwise you always specify the PaymentMethod or Source via the payment_method parameter of a PaymentIntent.
OK, that's good to know.
But if you are using Subs/Invoices then the Subscription's default_payment_method takes precedence, followed by invoice_settings.default_payment_method followed by default_source, see: https://docs.stripe.com/api/subscriptions/object?api-version=2025-10-29.preview&rds=1#subscription_object-default_payment_method
OK. That part seems easy and I know I've seen that already.
but if there's no default_payment_method, source, or invoice_settings.default_payment_method, will the subscription just not charge, or will it look around for a source object on the customer? (or a card object, which I think we have customers old enough to have that attribute.)
(some of our code uses an API from 2013, which I'm rewriting, but this is the kind of thing I'm try to rectify before pulling the trigger.)
It will not charge if there is no default set
You mostly want to make sure that there is a default_payment_method set for every Sub or a default set on every Customer
OK. so the ONLY customer item that can be involved is invoice_settings.default_payment_method.
Ah no actually I forgot about Customer default_source which comes last in the precedence ordering
OK. and there cannot be a cutomer.default_payment_method, just a customer.invoice_settings.default_payment_method, correct?
Correct
OK. I know I'm overthinking it, but I think that's my job sometimes. ๐
OK, thanks for the help - have a great day!
You too!