WPPizza – A Restaurant Plugin for WordPress › Support › Add-Ons › Gateways › Stripe › Zip / postcode field doesn't work for UK as it's a numeric field.
- AuthorPosts
- 23 November, 2017 at 11:40 am #33092
Hi Olly
There’s an issue with the Stripe popup for UK payees
the field for zipcode is set to be a numeric input, but UK postcodes are a mixture of letters and numbers.I’ve seen that this was something you’ve added in for customers in the past, but you don’t appear to have made it optional.
23 November, 2017 at 1:22 pm #33093hmm, I don’t think that’s true actually (but feel free to prove me – and Stripe – wrong)
according to stripe docs
https://stripe.com/docs/stripe-js/reference#postal-code-formatting
Postal code formatting
The card Element automatically determines your customer’s billing address country based on their card number. Using this information, the postal code field validation reflects whether that country uses numeric or alphanumeric-formatted postal codes, or if the country uses postal codes at all. For instance, if a U.S. card is entered, the postal code field only accepts a five-digit numeric value. If it’s a UK card, an alphanumeric value can be provided instead.so it entirely depends on the card no you are using – well, according to their documentation anyway.
if you have evidence to the contrary i’d be glad to hear it and pass it on to / have a word with the guys at stripe23 November, 2017 at 1:29 pm #33094ok, this is quite possible, as I am testing with the 4242 4242 … test card number.
brb
23 November, 2017 at 1:36 pm #33095it appears you are correct.
Sorry for wasting time.
23 November, 2017 at 2:34 pm #33098ok
a couple of things for future reference (and thinking out loud for a bit here too)
– although there’s no checkbox option to turn this post/zipcode validation off (as this really is a security validation you should have enabled to combat fraud) if one really wants to disable this (for whatever reason), there’s a filter included that could be used to disable this verification like so
add_filter('wppizza_gateway_stripe_filter_vars', 'myprefix_stripe_filter_vars'); function myprefix_stripe_filter_vars($vars){ unset($vars['zipCode']); /* or alternatively */ $vars['zipCode'] = 'false'; return vars; }
– hmm, i wonder about the following though (not a too common scenario i would think but not impossible either):
what happens if i have a UK credit card and bank account. I then move to another country – let’s say Spain – and change the address associated with this account/credit card – as i would have to.
therefore my postcode changes from something like ‘SW6 1AB’ to ‘071234’ ….I would have thought it’s still a UK credit card (UK Bank), but the zip/postcode has a different validation structure now.
Admittedly, the chances are also quite good that i would also have “proper” credit/debit card associated with a spanish bank and postcode, but still….or maybe stripe is clever enough to be able to work out this kind of thing too. (the validation rules in the gateway implementation are set by stripe , not by me btw)again, just thinking out loud here…and it’s probably still a lot safer to insist on postcodes that match the card-country even if it means perhaps loosing a customer or two (though – as mentioned above – the chances are they will also have alternative ways to pay)
- AuthorPosts
- The topic ‘Zip / postcode field doesn't work for UK as it's a numeric field.’ is closed to new replies.