WPPizza – A Restaurant Plugin for WordPress › Support › Add-Ons › Gateways › Stripe › Post code validation
- AuthorPosts
- 27 July, 2016 at 12:54 pm #19771
Hi Olly
Just wondering if there is an easy way to turn on zip/post code validation in Stripe ?
the option is turned on in my account but looks like something needs to be turned on in the plugin in order for it to work. Just trying to reduce fraud.Thanks
27 July, 2016 at 1:34 pm #19783Out of the box, no.
However , I would be happy to add this as an option if you could run a test for me by editing
wppizza-gateway-stripe.php like so and tell me if this works (i would then have to make this a more dynamic option in the plugin itself, but as a test this should be fine).wppizza-gateway-stripe.php on approx line 393 AFTER
$js[]="if (stripeEmail == null){var stripeEmailVal='';}else{var stripeEmailVal=stripeEmail.value;}";
ADD
$input_field_id = 'ccustom6'; /* set the id of the field enabled and set for entering Post/Zip codes in wppizza->order form settings */ $js[]="var stripeZip = document.getElementById('".$input_field_id ."');"; $js[]="if (stripeZip == null){var stripeZipVal='';}else{var stripeZipVal=stripeZip.value;}";
setting the
$input_field_id
(the field you are using in wppizza->order form settings for the customer to enter his/her zipcode). Make sure you set this field in the settings there as being requiredthen, wppizza-gateway-stripe.php on approx line 407 AFTER
$js[]="name: '".$name."',";
ADD
$js[]="address_zip: ''+stripeZipVal+'',";
for this to have any effect, enable declines on verification failures in your stripe account settings.
let me know
27 July, 2016 at 1:43 pm #19784Thank you for your reply, that’s for the zip code in the delivery address not in stripe popup window right ?
27 July, 2016 at 1:45 pm #19785wrong.
it will be passed on to stripe (but you don’t have to enter it again in the stripe popup)27 July, 2016 at 1:52 pm #19786I know it will be passed on to stripe but what if the delivery zip code is different than the billing zip code, I thought that there is an option to have another field in stripe popup window for the billing zip code.
27 July, 2016 at 1:55 pm #19790>I know it will be passed on to stripe but what if the delivery zip code is different than the billing zip code,
the you would have to label that filed “billing zip code” i would have though> I thought that there is an option to have another field in stripe popup window for the billing zip code.
if there is, that would be great/better. got an example somewhere that does that ?
27 July, 2016 at 2:04 pm #19792>the you would have to label that filed “billing zip code” i would have though
what if cash payment is selected ? do you think I can only show billing zip code field when stripe is selected using css ?>if there is, that would be great/better. got an example somewhere that does that ?
I saw this elsewhere but I might get in touch with stripe for this if needed27 July, 2016 at 2:25 pm #19793>but I might get in touch with stripe for this if needed
i had a look myself, but cannot see the option of adding a zipcode field to the popup in any documntation. Personally I agree that this should be there/optional. Maybe you can persuade them to do this sort of thing. Would certainly be th emost elegant solution> do you think I can only show billing zip code field when stripe is selected using css ?
somwhat in conjunction with js.
i.e if wppizza-gateway-stripe is checked, set css of field visible and required , else hide and unset required(just off the top of my head, there may be other solutions too)27 July, 2016 at 3:21 pm #19794I will see what I can do, will keep you updated.
Thanks for your help - AuthorPosts
- The topic ‘Post code validation’ is closed to new replies.