#corethings-list-customer-pms
1 messages ยท Page 1 of 1 (latest)
Hey there! Yep, that's probably the wrong API in this instance. Checkout will instead create a Payment Method object and attach it to the Customer
This is the endpoint you actually want: https://stripe.com/docs/api/payment_methods/customer_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.
Payment Methods are the newer API/object that work across pretty much all local payment methods (including cards)
nice! Thanks for that. Just tried it out and it is now indeed listing the cards. However, I don't see a "default" payment method attribute with this object - is this correct? If there is no "default" attribute, how can I allow the user to set this if they have multiple payment methods (cards)
Great! Indeed, that's not a default behaviour with Checkout. So you'd need to make an additional API call to update the invoice_settings.default_payment_method field on the Customer: https://stripe.com/docs/api/customers/update#update_customer-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.
hmm .. If I'm listing all 'customer cards on file' to the customer, how do I show them which card is the default payment method?
Good question! I guess you'd need to map the pm_xxx ID from the Customer object (invoice_settings.default_payment_method) to the corresponding Payment Method object from that list endpoint
There's no direct flag on the PM object unfortunately
sounds good! Thanks so much for this - I think I'm good to go for now. (also - I'm x-Stripe and this developer support service is absolutely awesome ๐ Regards to the team and keep up the good work)
Thanks so much for the kind words! I'll relay them to the team ๐