Support

Home Forums Event Espresso Premium Validate the billing ZIP code

Validate the billing ZIP code

Posted: June 30, 2019 at 8:40 am


Patrick

June 30, 2019 at 8:40 am

Hi,

Could you please clarify the Stripe gateway “Validate the billing ZIP code” option ?

Under the Stripe.js Reference, it is stated :

Hide the postal code field. Default is false. If you are already collecting a full billing address or postal code elsewhere, set this to true.

Does that mean that if we collect the postal code in our registration form and set this option to “false”, EE will still pass on to Stripe the postal code input field for validation purposes ?

If not, we may want to enable this option for security purposes. In that case, is there a way to customize the “postal code / zip code” placeholder in the Stripe checkout window ? Currently, the placeholder for french language is “CP”, which does not mean much for us.

Regards.

Patrick


Tony

  • Support Staff

July 1, 2019 at 4:10 am

Hi Patrick,

Under the Stripe.js Reference, it is stated :

Hide the postal code field. Default is false. If you are already collecting a full billing address or postal code elsewhere, set this to true.

That’s actually for a Stripe.js integration (which we don’t use) and is for the hidePostalCode parameter.

We use Stripe Checkout, which is a different integration method:

https://stripe.com/docs/checkout#integration

Does that mean that if we collect the postal code in our registration form and set this option to “false”, EE will still pass on to Stripe the postal code input field for validation purposes ?

No.

That setting tells Stripe where if they should validate the Postal Code/Zip code for the card (when applicable).

The “Validate the billing ZIP code” option basically sets data-zip-code to true or false when creating the Stripe checkout instance.

You can see an example of this in use in the Stripe docs here:

https://stripe.com/docs/checkout#integration-custom

And a live example you can see in action here: https://jsfiddle.net/wpTony/ny90e48a/

Those are doing pretty much the same thing, only one is the ‘standard’ method of opening checkout, the other is a custom method.

The field for the Postal Code/Zip field will only appear on the checkout modal if it is needed, as not all countries use it. Checkout uses the first 6 digits of the card number to determine the card’s country and show or hide that field.

Use the live view above, click on pay with card and start typing 424242 into the card field, see the ZIP field show? That’s what that option does. If you set data-zip-code="false" in the top left and click run, then re-test… no more zip field.

If not, we may want to enable this option for security purposes. In that case, is there a way to customize the “postal code / zip code” placeholder in the Stripe checkout window ? Currently, the placeholder for french language is “CP”, which does not mean much for us.

That’s controlled by Stripe and I don’t believe we can pass over placeholder text to replace it. However, if I set the data-locale above on the live view to ‘fr’ the ZIP field shows ‘Zip Code’ for me, is that the same field you are referring to? – https://monosnap.com/file/kbcWJj8d2uhwyN3cmVpcUzN1SlhedF

The support post ‘Validate the billing ZIP code’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso