How do I disable the ZIP code in the single element input?

Hey all… Somehow I’m unable to disable postalCode in the single element sqpaymentform. I set postalCode: false , but it still asks the user for a ZIP code. How do I disable the ZIP code in the single element?

Unfortunately this is currently not possible in the single card element on the payment form. This is still in beta and I know there’s work continuing to be done, but no ETA on when this would be available at this time.

Understood. The single card element has a really nice UX/DX. Hope this feature is on the todo list very close to the top :innocent:

Two questions relating to this from a very new visitor here…

  1. How do I get the single-line layout on my website page? I can’t see anything about it in what I’ve found so far in the documentation or the sample project. Is it just CSS, or something more than that?

  2. Why is the postalCode field required, in any layout? I have made many payments on websites in the past, but never have I seen one that requires a postal code as part of the card details. It feels very odd to me.

I bought a Square reader recently and have been very happy with it. So I thought I would experiment with the possibility of adding payment pages on my website using Square. I’ve been a software developer over many decades, so just ascending the Square API learning curves…

Hi @marshallarts, the single-card element is currently buried in the Payment Form Walkthrough here: https://developer.squareup.com/docs/payment-form/payment-form-walkthrough as it’s still in Beta. To be clear, using the non-single-card element, you can remove the postal code requirement for certain countries, but the postal code is required currently if your developer account is based on the US, CA, or UK (see here: https://developer.squareup.com/docs/payment-form/cookbook/sqpaymentform-customization#remove-the-postal-code-requirement)

Thanks for that. Will do some more looking/tinkering.

Your answer was posted in Jul 2020. Is the pastalcode: false available? Since CVV is collected, I want to disable the postal code option.

The Web Payments SDK shows a postal code input field on the payment form after the SDK determines the country that issued the buyer’s credit card. The Web Payments SDK displays the proper form label for the postal code based on the country:

  • For US, the form displays “ZIP”.
  • For CA, the form displays “Postal Code”.
  • For UK, the form displays “Postcode”.

If the payment form displays the postal code field, the payment requires a postal code for the buyer to proceed. The SDK enforces input field validation for the postal code depending on the country. :slightly_smiling_face: