#mzane42-react
1 messages · Page 1 of 1 (latest)
Hi! I don't think you can remove that field from the Payment Element. Give me a few minutes to check.
I couldn't find any option to remove the country field in the doc here: https://stripe.com/docs/js/elements_object/create_payment_element
Hey there @neon rivet. Depending on the payment method type selected, some require a country field. However, you can disable address collection where applicable: https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-address-country
thanks @delicate tusk that's i'm looking for but how can i use elements.create, because my element in react is already created on mount under the hood, you think that we have to mount it manually to control the fields ?
@jolly fossil thanks too ! ^^
Yeah, so you'd pass an options hash to that elements.create:
elements.create('payment', {
fields: {
billingDetails: {
address: 'never'
}
}
})
Sure, np!