#criss-card-billingdetails
1 messages · Page 1 of 1 (latest)
Hi 👋
Can you explain what APIs you are using and what data isn't where you expect it? I don't quite get your question as it is worded.
Yeah sure! I'm using Nodejs/React Native. I want to collect users' credit card information to make a stripe customer id, which will be stored in firebase to be charged later.
In the following client side code, I'm passing in a name/country in billing details to a server-side cloud function
and then creating a customer id and attaching a payment method in the cloud function
a customer is successfully created along with their cc details, but cardholder name and country (e.g. I'm in US, but if I pass in Mexico it still says US)
And when you inspect the Payment Method via the API you do not see the expected values in the billing_details hash?
https://stripe.com/docs/api/payment_methods/object#payment_method_object-billing_details
Here's my log statement
PaymentMethod was created successfully:
{"AuBecsDebit": {"bsbNumber": null, "fingerprint": null, "last4": null}, "BacsDebit": {"fingerprint": null, "last4": null, "sortCode": null}, "Card": {"availableNetworks": ["visa"], "brand": "Visa", "country": "US", "expMonth": 4, "expYear": 2024, "fingerprint": null, "funding": "credit", "last4": "4242", "preferredNetwork": null}, "Fpx": {"bank": ""}, "Ideal": {"bankIdentifierCode": "", "bankName": ""}, "SepaDebit": {"bankCode": null, "country": null, "fingerprint": null, "last4": null}, "Sofort": {"country": null}, "USBankAccount": {"accountHolderType": "Unknown", "accountType": "Unknown", "bankName": null, "fingerprint": null, "last4": null, "linkedAccount": null, "preferredNetworks": null, "routingNumber": null, "supportedNetworks": null}, "Upi": {"vpa": null}, "billingDetails": {"address": {"city": null, "country": null, "line1": null, "line2": null, "postalCode": "42424", "state": null}, "email": null, "name": null, "phone": null}, "customerId": null, "id": "pm_1NNGr6CNzspyvGyfVReUchol", "livemode": false, "paymentMethodType": "Card"}
criss-aubecs-billingdetails
That card PaymentMethod was created client-side in the request https://dashboard.stripe.com/test/logs/req_oOt2djFqu0kmu6 and you never passed billing details
you just have the postal code right?
it's right there in the JSON you shared: "postalCode": "42424"
yea i only have the postal code
i'm console logging name and country so those exist, and i'm also setting them in the billing_details property
I'm fairly certain you aren't. Try hardcoding values right there in the code, but I don't think the picture you shared is the code you run. Like you wrote Card and we got card for example
sorry it's hard to debug without real actionable details and right now the code you shared is not what I think you are doing
yeah ok gotcha
strange
just double checking the function is set up correctly right?
Like you wrote Card and we got card for example
oh ok let me take a look at this
The first picture is code (please don't send pictures of code) to create a PaymentMethod client-side
The second picture is from your Dashboard for something completely separate where you are cloning a PaymentMethod that exists on a Customer
you seem to be mixing up many separate things and going way too fast right now unfortunately
step 1: log the paymentMethod variable after the call in your first picture
criss-card-billingdetails
{"AuBecsDebit": {"bsbNumber": null, "fingerprint": null, "last4": null}, "BacsDebit": {"fingerprint": null, "last4": null, "sortCode": null}, "Card": {"availableNetworks": ["visa"], "brand": "Visa", "country": "US", "expMonth": 4, "expYear": 2024, "fingerprint": null, "funding": "credit", "last4": "4242", "preferredNetwork": null}, "Fpx": {"bank": ""}, "Ideal": {"bankIdentifierCode": "", "bankName": ""}, "SepaDebit": {"bankCode": null, "country": null, "fingerprint": null, "last4": null}, "Sofort": {"country": null}, "USBankAccount": {"accountHolderType": "Unknown", "accountType": "Unknown", "bankName": null, "fingerprint": null, "last4": null, "linkedAccount": null, "preferredNetworks": null, "routingNumber": null, "supportedNetworks": null}, "Upi": {"vpa": null}, "billingDetails": {"address": {"city": null, "country": null, "line1": null, "line2": null, "postalCode": "42424", "state": null}, "email": null, "name": null, "phone": null}, "customerId": null, "id": "pm_1NNJG3CNzspyvGyfFuP9YHNH", "livemode": false, "paymentMethodType": "Card"}
I mean clearly the code you run is not what you think it is
Ok i'll take a look back at the docs
I also don't understand why you are getting all those obscure types like AuBecsDebit. It feels like you're using some third-party Typescript definitions or something
Ultimately you're clearly not passing the name, see https://dashboard.stripe.com/test/logs/req_XtYPcV6lEkoxtN which is the creation request for that PaymentMethod
Which doc are you following? I feel like you're trying to pass billing details incorrectly
Ok yeah I'm setting up the createPaymentMethod wrong, just saw that i should use the SetupIntent API instead which i will follow
Thanks for helping me out, apologies for the inconvenience
No inconvenience at all here