#wsteelix - react
1 messages · Page 1 of 1 (latest)
hi @kindred aspen yes
i was wondering if i can enable it via the PaymentElementOptions, under fields?
Got it! The Payment Element doesn't support that. So you would have to add your own input to the page.
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
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?
yes. I want to attach the "name" value from the new input to the paymentMethod object. would that be possible?
in short, our implementation is currently closely follow this: https://stripe.com/docs/stripe-js/react#useelements-hook
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
You can update the metadata field of the PaymentMethod with this: https://stripe.com/docs/api/payment_methods/update#update_payment_method-metadata
But you will need to do that on the backend.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.