#wei - retrieve credit cards
1 messages ยท Page 1 of 1 (latest)
Hello, do you see the cards that you are expecting when you list the payment methods for the customer? https://stripe.com/docs/api/payment_methods/list
Yes, just confirmed it is being returned with the list payment methods endpoint correctly.
Should we be able to get it from /sources too?
It looks like Pompey is offline. @grand lotus is there anyway you could respond to our query?
What are you trying to get? What is the end-goal/final-product? Is it just a list of every thing Payment Method?
And I am back again. I don't think these should show up as sources as well. Do you need these as a source for something that you are doing?
I'm looking to list all the cards linked to the customer.
In the sources doc it says
You must attach a reusable source to a Customer object
What's the reason for the card to not return in the sources curl above but returning in the payment methods endpoint?
I'm trying to understand why this card is not considered a source. Or the difference between payment method and source.
Which doc are you working through there?
Sources are deprecated and it is typically recommended to work with payment methods instead unless you are working with a feature that hasn't been ported to payment methods yet
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 it doesn't say deprecated at the link
Apologies, I used the wrong word. Sources are the legacy integration, we typically recommend working with the PaymentMethods API which is newer https://stripe.com/docs/payments/payment-methods/transitioning
we have legacy integration already built and I'm debugging why the card didn't show up for this customer using the api linked. ๐
There we go. That was my next question.
๐
Thanks for the clarification. I will check in to that payment method in a minute
To be clear, we still support sources fully and I was not trying to push you to migrate. I just sometimes assume most people on this server doing new work when they aren't.
Sure that would be helpful thank you
Got it!
These are examples of folks with card(s) on dashboard but the cards are missing in source endpoint:
cus_LckBmcFSjmUf67
cus_LC4r9jjUO2vdQs
cus_JbZZj6LJBmJPW0
For the first customer, I also tried the customer endpoint
curl -G https://api.stripe.com/v1/customers/cus_LckBmcFSjmUf67 \
-u [token]:
and no cards were returned there either.
Did you recently change anything about your integration? Was this working before and stopped or is this just sporadically happening now?
It works fine for most customers. A customer first reported it to us a little over a month ago but it could have started happening before then.
We have not changed the integration recently.
Gotcha. So your page builds the UI based on the sources listed for that customer and for some of them nothing is showing up now?
Correct.
Thank you. Looking again at what happened here.
Do you have an account that you know is properly seeing this page?
Do you mean an example customer that has correct cards returned in source endpoint?
Most customers are working correctly. For example, https://api.stripe.com/v1/customers/cus_Ly20eGMLnlMpVM/sources
Awesome thank you. Just wanted to look at how those are prepared and attached
I checked our integration, this customer endpoint example I sent above is also something we use.
Cards are missing in the "cards" key under the response json too ๐ .
Apologies, for some reason I can't see how the source was created on the customer that you do see sources for but I am still trying to look. Do you know off the top of your head if you add sources other than through attaching payment methods when taking payment?
@clever crest those customers have PAymentMethods attached to them pm_123 that's a completely separate API
I recommend that you migrate to https://stripe.com/docs/api/payment_methods/customer_list which would list all cards both the legacy ones like card_123 or src_123 and the newer ones pm_123
Got it. so payment methods and sources are not interoperable. Should cards be returned in the get customer endpoint if it's a payment method?
they are interoperable but one way
The PaymentMethods API is newer and shipped in 2018. When we built it we made sure that legacy objects like card_123 and src_123 worked as PaymentMethods, just not the opposite
as long as you use the newer API, you will get all the objects
we're working with legacy code so we prefer to not make this change at this time. Should payment methods cards be returned in the get customer endpoint? as seen in the screenshot above the card is not returned there either
that's entirely expected
If you want PaymentMethods you use the API I mentioned above
we don't return things on the Customer anymore. We even removed sources, subscriptions and tax_ids from Customer back in 2020 in this API version: https://stripe.com/docs/upgrades#2020-08-27
But you're kinda misunderstnading a lot of this. A PaymentMethod pm_123 can never work with the Charges API. It only works with PaymentIntents and SetupIntents
Thank you I will message back if I have any questions.