#RJ01
1 messages ยท Page 1 of 1 (latest)
Hi ๐ the Appearance API is not used to hide the Country field.
If you're colleting the Country details somewhere else, then you can use this field when creating the Payment Element to suppress its collection of Country details:
https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-address-country
Then you can provide the country details from your form when submitting the payment for confirmation:
https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method_data-billing_details
Did you try setting fields.billingDetails.address.country to never when initializing the Payment Element?
No, I don't think so. Hiding the country field is not part of the Appearance API, it's part of the options you pass to the Payment Element when initializing it.
Hm, can you share the ID of a Payment Intent you're using for testing where you saw that behavior? That ID should start with a pi_ prefix.
I'm not readily seeing anything that looks like it would cause that email field to remain present, standing up a test to check this on my account.
Wait, I don't think the email address field is included by default in the Payment Element for card payments. Do you have an additional element, the Link Authentication Element, mounted above the Payment Element?
Yup, the linkAuthenticationElement near the bottom of that code is the email address field you're seeing in the UI.
ohh can i comment that?
NP! Shoutout to toby ๐