#Qdm
1 messages · Page 1 of 1 (latest)
Hi there!
Just to be clear, is your goal to ultimately add the invoice number as metadata on a Stripe object, or just to collect this information for usage within your own database?
Yes, I'd like to add it as metadata
Got it. In that case, you'll want to create a separate input field in your application to collect this value from your customers. Once you have this value, you'll need to include it as payment_method_data.metadata when you confirm the PaymentIntent - https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams
Got it and would I use the fields object to create the custom invoice field?https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-customized_fields
No, the text field you'll use to collect invoice numbers from the customers will be completely separate from the PaymentElement creation.
The "customized fields" referenced in these docs are specifically for the case where you want to have control over the display of the fields listed here only - https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields
Thank you!