#EdElric - Billing Address
1 messages · Page 1 of 1 (latest)
Hello, I'd be happy to help! Can you explain what you mean by "mount address fields to the payment element"?
So we are using Stripe JS on the front end to setup an Intent and confirm card setup. Stripe JS provides a payment-element which provides the Credit Card Number, Expiry Date and CVC UI inbuilt. Im trying to add billing address to the same element.
Gotcha. You need to adjust the billingDetails options you're passing in when creating the Payment Element: https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails
Note there's no way to force collection of any specific billing details field. You can set them to auto, but if you want to force collection of something in particular you should disable it in the Payment Element with never and collect it in your own form field instead.
Yup, tried that some like
fields: {
billingDetails: 'auto'
}
});
Gotcha, and then just pass it to Stripe when I confirmCardSetup?
Yep! Although with the Payment Element is't just confirmSetup: https://stripe.com/docs/js/setup_intents/confirm_setup