#joe-elements-name
1 messages · Page 1 of 1 (latest)
Hey @ashen harness have you tried https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-defaultValues ?
I tried the example in the customized fields:
var paymentElement = elements.create('payment', {
fields: {
billingDetails: {
name: 'never',
email: 'never',
}
}
});
But that didn't work
But I linked you to a different part of the doc since you asked about pre-filling which seems like a different question?
It is, I was just hoping it was the same format
Do you have an example of say pre-filling name?
what have you tried though?
Sorry but I just linked you to the exact doc, can you explain what's not working?
var paymentElement = elements.create('payment', {
fields: {
billingDetails: {
name: 'Joe Adroit',
email: 'joe@test.com',
}
}
});
fields expects auto or never as value. You can't pre-fill those here
I linked you to a different part of the doc
so you pass defaultValues like this: defaultValues: { billingDetails: { name: 'Prefilled Doe', }, },
does that make sense?
Perfect, Thanks!
sure! Let me know if that doesn't work!
It worked