# Webpayment locale is incorrect (zip instead of postal code)

**URL:** <https://developer.squareup.com/forums/t/webpayment-locale-is-incorrect-zip-instead-of-postal-code/23246>\
**Category:** Questions\
**Created:** [July 16, 2025, 8:30pm UTC](https://developer.squareup.com/forums/t/webpayment-locale-is-incorrect-zip-instead-of-postal-code/23246 "2025-07-16T20:30:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JayB](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@JayB](https://developer.squareup.com/forums/u/JayB)\
**Post date:** [July 16, 2025, 8:30pm UTC](https://developer.squareup.com/forums/t/webpayment-locale-is-incorrect-zip-instead-of-postal-code/23246/1 "2025-07-16T20:30:08Z")

</div>

Spent my morning working on integrating the webpayment sdk into my check out page using the JS and it works fine except it doesn’t autodetect the locale and I only get the field for US Zip code rather than Canadian postal codes. I tried to force it but it doesn’t seem to work.

```auto
const payments = Square.payments(
	'sandbox-xxxxxxxxxxxxxxxxxxxxxxxxxxxx',
	'xxxxxxxxx'
	, , {
     locale: 'en-CA'});

```

It seems to be presenting the ZIP field after I start typing 4111 1111 1111 1111. (same with 5105 1051 0510 5100)

Is it getting locale from the CC number and the test number is US?

If so, is there a way to override that for testing? Using a Canadian postal code causes an Enter Valid Zip Code error.

EDIT: I see this was asked before in 2023. And the answer would appear to still be yes…it’s tied to the CC number.

How exactly am I supposed to test this. I don’t even have US customers…

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [July 16, 2025, 8:31pm UTC](https://developer.squareup.com/forums/t/webpayment-locale-is-incorrect-zip-instead-of-postal-code/23246/2 "2025-07-16T20:31:06Z")

</div>

👋 I’m Square Dev AI, here to help answer your question!  
Based on the information you’ve provided, the following documentation will help answer your question:

> **[Localize In-App Payments](https://developer.squareup.com/docs/in-app-payments/localize-ios)**
>
> Learn how to localize an In-App Payments application for Android or iOS.

> **[Square Developer](https://developer.squareup.com/docs/app-marketplace/requirements/web-payments-sdk)**

> **Additional Documentation**
>
> [Sandbox Payments](https://developer.squareup.com/docs/devtools/sandbox/payments)  
> [Supported Payment Methods by Country](https://developer.squareup.com/docs/payment-card-support-by-country)  
> [Remove the Postal Code Requirement](https://developer.squareup.com/docs/in-app-payments-sdk/cookbook/disable-postal-code)

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.  
Otherwise one of our Developer Advocates will provide additional assistance shortly.

---

<div class="post-metadata">

**Author:** ![JayB](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@JayB](https://developer.squareup.com/forums/u/JayB)\
**Post date:** [July 16, 2025, 8:44pm UTC](https://developer.squareup.com/forums/t/webpayment-locale-is-incorrect-zip-instead-of-postal-code/23246/3 "2025-07-16T20:44:23Z")

</div>

Never mind. I found a work around.

I’ll leave this here for future reference.

Using the EU test card numbers found here (but nowhere I could find on any Square site)

> **[CodeStop.com - Test Credit Card Numbers for Square Payments](https://codestop.com/articles/view/57)**
>
> Test Credit Card Numbers for Square Payments

I can get it to present the postal code so I can test it.

Kind of ridiculous you don’t have an option for Canada.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [July 17, 2025, 4:44pm UTC](https://developer.squareup.com/forums/t/webpayment-locale-is-incorrect-zip-instead-of-postal-code/23246/4 "2025-07-17T16:44:01Z")

</div>

The Web Payments SDK should automatically detect the locale based on the device settings or the specified locale in your configuration. However, it seems like the issue you’re experiencing is related to the test credit card numbers you’re using, which are likely defaulting to a US locale.

The test card numbers you mentioned (4111 1111 1111 1111 and 5105 1051 0510 5100) are commonly used for testing and might be associated with US settings, which is why you’re seeing the ZIP code field instead of a Canadian postal code field.

To test with a Canadian postal code, you can try the following:

1. Ensure that your device or browser is set to a Canadian locale.
2. Use a test card number that is recognized as Canadian, if available.
3. If the SDK allows, explicitly set the locale to ‘en-CA’ in your configuration, as you have done, and ensure that this setting is correctly applied.

Unfortunately, if the test card numbers are inherently linked to a US locale, overriding this behavior might not be possible without using a different set of test card numbers that are recognized as Canadian. If you continue to face issues, you might need to check if there are specific test card numbers provided by Square for Canadian testing or consult further resources for locale-specific testing.

_This answer was reviewed by @Bryan-Square._
