#EdElric - APAC card data
1 messages · Page 1 of 1 (latest)
What info is missing that you are looking for?
Do you have an example ID of a card that does not have this data
When adding a credit card on Stripe using the Stripe::Customer.create API, the response is missing sources
This only happens with the new API Key for APAC locations.
Do you have an example ID of a customer that you created like that?
cus_LQgZ0cBSFlFFi6
Thank you. Do you also have an ID of a custom that you did see sources on after creation?
the same customer, different locales.
Sources showed up when I tried adding this customer to US, when I tirend adding a Singapore card sources did not show up
Do you have the ID for the Singaporean card?
cus_LQgUnfENE4hFWK
I am only seeing the 4242 test card on that Customer which sounds like it lines up with what you are saying
That is the Customer ID, the card ID would likely look like card_123 or pm_123
Singapore Card id card_1Kjp7TCJof5dehOBQYnj3Mrl
US Card ID: card_1KjpCIFXxX8E3Ds4HWjEhoDn
Interesting. It is appearing on the user's dashboard. I am surprised that it is not showing up under sources on the Customer object https://dashboard.stripe.com/test/customers/cus_LQgZ0cBSFlFFi6
I don't have Stripe login creds, Im just using the API to test this. So cant really see what that link is referring to.
Gotcha. I am trying to thing of why it would show up on one user but not the other.
Is there something is the setting for the new region that could have caused it?
I don't think that that should impact it but will check.
Actually, the country code on both of those cards is US. How/where are you specifiying the Singapore locale when going through this process?
Ah, I think I see the difference
I pass in a hash when created the token,
stripe.createToken(card, data)
const data = { line1: addressLine1, line2: addressLine2, city: city, state: state, zip_code: zipcode, country: country };
The API version of the call is different. The sources property used to be included by default but it is not any more. In newer versions of the API, you need to include expand=['sources'] to get that info back with the Customer object
gotcha, will give that a try.
That worked!, Thanks a lot. qq will including expand=['sources'] in the older API version break anything?
Awesome! I am unsure if that would error. Do you have your code that makes the older version call to test with rihgt now?
card: token,
description: user.id,
email: user.team_admin_email,
}, {
api_key: stripe_api_key
})```
this is the older version.
for this to work with the new API all I had to do was
card: token,
description: user.id,
email: user.team_admin_email,
expand: ['sources']
}, {
api_key: stripe_api_key
})```
Using the expand param like that won't error out on the older API version either. So you can do it in both but it is only necessary in the newer API version.
Awesome. Thanks a lot for helping.