Zen Cart Logo
Forums / General Questions / Validate cvv number

Validate cvv number

Locked

Views: 6,894

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
29 Nov 2006, 8:07 AM
#1
gruntre69 avatar

gruntre69

Zen Follower

Join Date:
Aug 2005
Location:
Australia
Posts:
103
Plugin Contributions:
0

Validate cvv number

Hi all,

I found this code for cvv number validation:

if (MODULE_PAYMENT_CC17_COLLECT_CVV == 'True')  {
      $js .= '    var cc_cvv = document.checkout_payment.cc_cvv.value;' . "\n";
    }

My problem is that even though the validation works for minimum of a 3 digit cvv number my customers can still use the space bar to trick the validation. can anybody help with an idea of changing this so that the three digits must be numerical numbers 1 - 9

29 Nov 2006, 9:24 AM
#2
gruntre69 avatar

gruntre69

Zen Follower

Join Date:
Aug 2005
Location:
Australia
Posts:
103
Plugin Contributions:
0

Re: Validate cvv number

Tried this but it only works for other characters not spaces from the space bar:```
}
$js .= ' if (isNaN(cc_cvv)){' . "\n" .
' error_message = error_message + "' . MODULE_PAYMENT_CC17_TEXT_JS_CC17_NOTNUMBER . '";' . "\n" .
' error = 1;' . "\n" .
' }' . "\n" ;

So it isn't quite right
3 Dec 2006, 5:14 AM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Validate cvv number

What payment module are you using?

4 Dec 2006, 12:47 AM
#4
gruntre69 avatar

gruntre69

Zen Follower

Join Date:
Aug 2005
Location:
Australia
Posts:
103
Plugin Contributions:
0

Re: Validate cvv number

I am using slightly modified versions of the standard credit card modules which store card data for manual processing by my staff.

The modifications are to include a small surcharge for card use and encryption of the card number before storage in the databse.