#JonathanB-billing-portal
1 messages ยท Page 1 of 1 (latest)
Hi there!
Can you specify exactly what you mean by the cards object is empty? There is no cards object associated with a Customer.
Ah
I know the confusion
So you are looking for the paymentmethods themselves, which will be listed under the sources property: https://stripe.com/docs/api/customers/object#customer_object-sources
However, this property is not included by default when you retrieve a Customer
You need to expand it
Info on expanding here: https://stripe.com/docs/api/expanding_objects
The Customer may also have a default set under their invoice_settings.default_payment_method: https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method
Sorry, I meant the cards property on the Customer object
When I call
stripe customers retrieve {customerId}
there is a cards property that according to the API docs will show the 10 most recently used cards, however none of the cards that are entered via the billing portal show there and the cards property is showing as an empty array
sources is also showing an empty array under the customer object as well
Hrmm what API version are you using?
And can you provide me a request ID for one of these retrievals?
Logs in the stripe dashboard is showing API version 2014-11-20
The example in working with (in test mode) is:
stripe customers retrieve cus_MFD9aNj3CugSmW
Okay thanks
Hi there ๐ jumping in my so my teammate can take a break. I'm going to need to do a little digging first to find the cards field that you're referring to, please bear with me while I work on that.
Sure thing!
Sorry, but I'm struggling to find the cards field that you're referring to, could you link me to the documentation that you're referencing?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Can you try using this list function instead? It looks like you were trying to list Sources, but looking at the Customer record they seem to have Payment Methods 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.
So through the CLI, listing the payment methods is returning card data and sources is not as seen in the screenshot above
My only issue with this is that payment methods apparently don't return a card_id to be used with the charge endpoint but can only be used to make a PaymentIntent
I'm wondering if this is because those cards were created using the billing portal?
If that is the case, is there a way to configure the billing portal to create cards as sources rather than payment methods?
Correct, Payment Methods are intended for use with Payment Intents, and are not compatible with Charges.
No, as far as I'm aware the Customer Portal is not able to create Sources and only creates Payment Methods.
Okay, well at least that make sense why I was seeing such differences between them
I'm glad I could help explain that!