#dawidzawada-PaymentElement-customer-info
1 messages ยท Page 1 of 1 (latest)
Sure, take ur time!
PaymentElement is autonomous in terms of collecting the billing details
So the idea is that either you set it to auto where it collects the information when needed or you completely disable it by setting it to never so that you can collect the billing info using a custom form of your own
Once you collect this information using your own form, you can set billingDetails as default values on the payment element
https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-defaultValues
Do I need to set them on payment element or i just can provide bellingDetails to confirmSetup function like this:
const {error} = await stripe.confirmSetup({
//Elements instance that was used to create the Payment Element
elements,
redirect: 'if_required'
confirmParams: {payment_method_data: {billing_details: <HERE>}}
});
I believe you can do either but I haven't personally tested it so I'd recommend checking in test mode just to make sure
Allright, thats for your help! Have a nice day!