I need to add an additional field to my custom form, I want to add the name of the credit card.
I tried in the following way:
var cardNameElement = eleme
If you're using "PaymentIntents", which you probably should be if you're EU based / SCA compliant, then the format for this has changed again slightly...
stripe.confirmCardPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
card: cardElement,
billing_details: {
name: 'Jenny Rosen'
}
}
}
).then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmCardPayment
docs:
https://stripe.com/docs/stripe-js/reference#stripe-confirm-card-payment
billing_details
object docs:
https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details