#benclum11
1 messages · Page 1 of 1 (latest)
Are you trying to list Attached PaymentMethods? If so, you'd want to use this endpoint instead
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.
I ideally I was trying to save a Stripe API call by fetching both the customer object AND the payment method objects in the same API call.
but yeah it can be done in separate API calls
looks like I can do it in "reverse" Stripe::Customer.list_payment_methods(customer_id, { expand: ['data.customer'] }) but that doesn't work if the customer has no payment methods
Yeah listing payment methods is a separate endpoint unfortunately. The only payment method you could list from a customer is whatever's set under invoice_settings.default_payment_method
https://stripe.com/docs/api/customers/object?lang=ruby#customer_object-invoice_settings-default_payment_method
got it. thanks.