7

No Billing Postal Code? No Problem!

 3 years ago
source link: https://developer.squareup.com/blog/no-billing-postal-code-no-problem/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
July 6th, 2017 | 1 minute read

No Billing Postal Code? No Problem!

How To Remove the Postal Code Field (Square Payment Form)

Twitter
Facebook
Reddit
LinkedIn

As Square’s eCommerce platform expands outside the United States and Canada, we’ve heard feedback from developers in other countries (e.g. Japan & Australia), where requesting billing postal codes is uncommon, that they’d like to remove the postal code field in their eCommerce Payment Form.

Good news! Effective today, to remove the postal code field, all you need to do is change one line of code.

https___cdn-images-1.medium.com_max_2000_1_Fsw3BgKBUULcLhLab67JgA.png

When you load the eCommerce Payment Form — replace:

postalCode: {
        elementId: 'sq-postal-code'
      }

With the following:

postalCode: false

Once this is done, the payment form will load without the postal code field!

Warning: the postal code field is still required to process payment online for merchants based in the United States, Canada, and United Kingdom. Removing the field will result in these transactions being declined.** **With the following error message:

{
  "errors": [
    {
      "category": "INVALID_REQUEST_ERROR",
      "code": "INVALID_VALUE",
      "detail": "Postal code is required for nonces used by merchants in `US`"
    }
  ]
}

Additional Reading

If you are interested in learning more about how to style the payment form, you can read about it here.

Picture of Matan-Paul Shetrit

By Matan-Paul Shetrit
@MatanPaulMedium


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK