#gonsanto_code
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1426213026456928287
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
we even found the layout: tabs is not working as expected 🤔
this is an example when using layout: tabs ... the blue Card was never being shown when tabs and only Card was available
Hi, At a high level, PaymentElement collects only the necessary information to process the payment. There’s no way to force the Payment Element to always collect a ZIP unfortunately. So yes they’d need to use the Address Element if they want to always collect some billing address fields with a payment. Let me look into the postal code issue with this version. Hang tight
ok perfect... I will mention this to the team... the weird thing is that the documentation is saying the post code in the UK should be there 🤔
the tab layout was my issue 😄
Can you share how you're creating the Element?
If you set it to autom, https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-address it should surface the Postal Code.
this is the code
const paymentElementOptions: StripePaymentElementOptions = {
layout: 'tabs',
};
stripeElements = stripe.elements(stripeOptions);
paymentElement = stripeElements.create(
'payment',
paymentElementOptions,
);
we are not modifying anything related to the address
Can you set that field to auto and see if the Postal Code is surfaced?
yes let me try
just tried this
const paymentElementOptions: StripePaymentElementOptions = {
layout: 'tabs',
fields: {
billingDetails: {
address: {
postalCode: 'auto',
},
},
},
};
stripeElements = stripe.elements(stripeOptions);
paymentElement = stripeElements.create(
'payment',
paymentElementOptions,
);
and it is still not showing it
Looking
I know that with the latest API version,https://docs.stripe.com/changelog/clover/2025-09-30/postal_code_in_card_form_for_non_us_countries#what’s-new we do not collect postal code for GB
I just deleted a message here, so not to confuse us. Given that you're using @stripe/stripe-js": "^8.0.0, you're using the latest version so this is expected.
If you require Postal Code, you'd want to use Address Element
ok so thats really good to know... thank you so much for checking