#wsteelix - react

1 messages · Page 1 of 1 (latest)

kindred aspen
#

Hi! You would like to add an extra input to collect the name of the customer?

calm oar
#

hi @kindred aspen yes

#

i was wondering if i can enable it via the PaymentElementOptions, under fields?

kindred aspen
#

Got it! The Payment Element doesn't support that. So you would have to add your own input to the page.

calm oar
#

ah ha alright! Thanks for your help anyway then

#

ah, one quick question, how can we send the user input in that custom field to Stripe then?

#

right now user inputs are inside the useElements hook if I remember correctly

kindred aspen
#

What do you mean? You want to send the "name" (from your new input) to Stripe? Where do you want to send it? In the customer object? In the metadata field of the PaymentIntent? Something else?

calm oar
#

yes. I want to attach the "name" value from the new input to the paymentMethod object. would that be possible?

#

so we're collecting Card data with the useElements() hook

#

now if we add a new input to collect also customer name on the same form, how can we attach that value to the Card data that we're collecting also

kindred aspen