#KEITH LARD
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Card networks don't really require a name to be passed in
Also the CardElement provides barebones so that developers can build their own UI/UX.
If you do want to collect the cardholder name then you can have your own field that collects it and then pass it in when you confirm the PaymentIntent as part of billingDetails
https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method_data-billing_details
We have a doc here that provides more context on card verification
https://stripe.com/docs/disputes/prevention/verification
thank you, can I pass that name using this api?
const {error: paymentMethodError, paymentMethod} = await this.stripe.createPaymentMethod({
type: 'card',
card: this.cardElement
})
would it just an extra parameter billing_details
Yup
We have an example here
https://stripe.com/docs/js/payment_methods/create_payment_method
.createPaymentMethod({
type: 'card',
card: cardElement,
billing_details: {
name: 'Jenny Rosen',
},
})
.then(function(result) {
// Handle result.error or result.paymentMethod
});```
perfect thank ๐
NP! ๐ Happy to help
I cant see payment methods can I, until it's attached to a customer/charged ?
Umm do you mean on the dashboard?
ye
Gotcha, yeah in that case you'd need to attach it
You can look at the API logs though if you just want to confirm if the PaymentMethod was created ๐
OR list them using the API
Cool, I was also wondering, cardElement.focus(); doesn't seem to be working, is that the correct way to do it?
Good question, checking in to how you can do this with the card element and will get back to you
thank you
That function seems to work for me https://jsfiddle.net/8q7styz9/8/
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.