#dan_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/1290166037651918849
đ 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.
- dan_code, 6 days ago, 22 messages
There's no default_payment_method for customer. Are you referring to the customer's invoice_settings_default_payment_method ?
Hey Jack, on the dashboard where it's marked default - is that something different?
In the above example, I want to return the Visa as the payment method to use for a payment intent. But the first result is always Link
The default payment method shown in Dashboared is either https://docs.stripe.com/api/customers/object#customer_object-default_source or https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
What's the customer ID>?
Thank you, that makes a lot of sense! To make it a bit more.. confusing, the payment system currently utilises a mix of Source and Payment Methods (legacy things..)
Would the default source on a customer always be the last payment method (regardless of it being a payment method or via source)?
Customer ID: cus_QvObzUkm5xIi07
Thanks for the ID, the 4242 card is the customer's default_source
Can that default source also be a link/payment method (non-source api based) as well?
No, only source objects (i.e., card sources)
Would it be correct to say if default_source is set to null, and default_payment_method is set to null. There is no default payment method set for the customer?
And if so, would my process of obtaining the last card be:
- Check customer object
-- If default_source is not null, use this as payment intent source
-- If default_payment_method is not null, use this as payment intent source - If neither have returned, call the payment methods API against a customer to return all their cards/link. Order the results by created and use that as payment method for a payment intent source
If the purpose if to retrieve the last used card, just call https://docs.stripe.com/api/payment_methods/customer_list and use the first payment method from the list.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
The problem I encountered with this API call is it was always returning Link as the first Payment Method when a Source Card was the last method added
Hmm, I see. You can also check the PaymentMethod's created timestamp
To confirm, the easiest way is calling the API, getting all payment methods and sorting by timestamp?
Yes you are right