#ryuuuu
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Which integration are you referring to?
So im using a nuxt frontend
with stripe.js
setup like this
im only using the stripe js element so i can get the payment method, which i then send to my backend to save to the customer
Can you share the docs you are using
tbh i don't remember where i found this mode: "setup" part, i think i was using these docs: https://stripe.com/docs/js/element/payment_element
the thing is, as you can see from the UI photo, its requesting a country but i dont think its saving it to the PM, so i would assume if i add the name field it wouldnt save it either
Have you inspected the Payment Method that is created?
yeah, i saved some cards (the test ones) with Romania as a country, and i then i used my php backend to get them from the customer, it looks like it still says US
Do you see it in the billing_details.address?
oh
yeah it is there
i didnt realise theres 2 country fields
so adding a name field to the stripe.js form should work then
It is kind of confusing.
But you can pass additional info from the front-end in the payment_method_data.billing_details when making the .confirm call
https://stripe.com/docs/js/setup_intents/confirm_setup#confirm_setup_intent-options-confirmParams-payment_method_data
hm would it possible to change something here to swap the country field for the name field?
so that stripe.js creates the PM already with the full name of the card owner set?
im only using stripe.js to get the PM id, and then sending that to my backend to save to the customer as default payment method
The Payment Element will dynamically determine what information to collect based on the Payment Method. You can only specify auto or never for what information to collect.
If you want to always collect the full name on the card I would recommend you set name: 'never' and add a field of your own. Then you could pass that data in the billing details when confirming the setup intent
hm this is weird, i would've tought theres an "always" option too
Yes I can understand that frustration.
hmm alright i know what i'll do, i'll just request the base 3 fields for the card and thats it, and then have another page for the user to save his whole billing details
from what i can see you cant attach the name/country straight to the card, it would go into billing details anyways
and since i plan for my customers to only have 1 card at once saved, ill just give them to option to fill out the whole billing details with name,email,phone,address etc and update the payment method with those after its already saved to the customer
if i use that payment method to pay for an invoice, will all those billing_details be added to the invoice too automatically?
The Payment Method and Customer data will be included through the Invoice but where in the Invoice object are you expecting this information to go? https://stripe.com/docs/api/invoices/object
hmm i was hoping its gonna show somewhere in the invoice PDF
as like, the customers billing address
nope, i just tested it now by settings the PM details from the dashboard
looks like it doesnt show up on the invoice
i guess, i dont really have any need to collect any of this info
just saving the PM using the card number, expiry date, and CVC and paying an invoice with it should be enough
You can retrieve the billing details from the Payment Method and populate them in the Customer object: https://stripe.com/docs/api/customers/object
ohh ok they show up on the invoice now, i got confused again because i couldnt find a billing address on the customer except on the payment method itself
i tested with adding billing details straight to the customer from the dashboard and its showing up on the invoice
theres so many different places to save addres/country/name/email etc. its gotten really confusing
but i got it now, its alot more clear
thank you for the help
Happy to shed what ๐ก I can ๐
๐