It was adapted from Perl and Javascript routines that use a "prime of
nines" checksum against the number.

It also looks to see if the prefix matches one of the usual vendors, and
that the length of the number matches what a given vendor expects. 

I've run it against thousands of accounts in production applications and
it has always worked just fine. 

Of course, the account itself might not be any good, but at least you
know its not an arbitrary number.

Another good check is to see if the number is already being used by
anyone. This way if a bogus number is in circulation, it can't be used
more than once. 

Incidentally, the algorithm behind this is also a good way to generate
your own account numbers. The checksum digit it puts at the end is
specifically designed to guard against transpositions and what not. The
first X digits can be a serial number, and then you just concaternate
the checksum at the end. 

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services


Michael Marrotte wrote:
> 
> According to the source and docs it returns a boolean.  But, the link seems
> to be broken in the latest docs for this method.  Any help on how
> validateCreditCard() decides what values to return is greatly appreciated.
> 
> Thanks,
> 
> --Michael Marrotte

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to