#RJ01

1 messages ยท Page 1 of 1 (latest)

lament shardBOT
candid jasper
#

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

thorn veldt
#

because you have a sample of these..

#

isn't possible to achieve this design?

candid jasper
#

Did you try setting fields.billingDetails.address.country to never when initializing the Payment Element?

thorn veldt
#

is this correct?

candid jasper
#

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.

thorn veldt
#

got it

#

it should be in options

#

but

#

the email is still showing

lament shardBOT
candid jasper
#

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.

thorn veldt
#

pi_3NFzdDKgpulIQWSv0f9PrXW0_secret_2x9TdKbM4DzZr5RvxetiPMkpL

#

here

candid jasper
#

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.

thorn veldt
candid jasper
#

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?

thorn veldt
#

this is my code

candid jasper
#

Yup, the linkAuthenticationElement near the bottom of that code is the email address field you're seeing in the UI.

thorn veldt
#

ohh can i comment that?

steady vault
#

Hello ๐Ÿ‘‹
Yes

#

You can comment it out

thorn veldt
#

it works

#

thank you guys

steady vault
#

NP! Shoutout to toby ๐Ÿ˜„