#criss-card-billingdetails

1 messages · Page 1 of 1 (latest)

lone hillBOT
plucky cobalt
#

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.

valid sable
#

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

lone hillBOT
valid sable
#

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)

plucky cobalt
valid sable
#

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"}

latent shell
#

criss-aubecs-billingdetails

#

you just have the postal code right?

#

it's right there in the JSON you shared: "postalCode": "42424"

valid sable
#

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

latent shell
#

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

valid sable
#

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

latent shell
#

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

valid sable
# latent shell step 1: log the `paymentMethod` variable after the call in your first picture

{"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"}

latent shell
#

I mean clearly the code you run is not what you think it is

valid sable
#

Ok i'll take a look back at the docs

latent shell
#

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

valid sable
#

I have no idea

#

not using typescript in my project either

latent shell
#

Which doc are you following? I feel like you're trying to pass billing details incorrectly

valid sable
#

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

latent shell
#

No inconvenience at all here