#sushbhat
1 messages · Page 1 of 1 (latest)
Hi there!
Hi Soma
Yes that's possible:
- Set
fields.billingDetails.address:neverwhen creating the Payment Element https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-address - And then when confirming the PaymentIntent you would need to pass the address https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method_data-billing_details
The option I shared above will completely hide that field.
Another option is to prefill the field with https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-defaultValues but users will be able to change it.
ok, when we hide it, what about the UI customizations, how will it get handled.. for eg when US is selected there is an option to enter zip code but when India is selected there is no option
Good question! Let me run some tests.
sure
Here's what I tested:
- Create the Payment Element with
fields.billingDetails.address.country: "never" - Then confirm the Payment Intent with
payment_method_data.billing_details.address.countryand set it to either "US" or "IN"
In both case it just worked. But I would recommend you to run some tests to make sure it works as you expect.