Re: Credit card checks?
| From: | Mark McCulligh | Date: | Wed, 24 Jul 2002 00:47:06 +0000 |
| Subject: | Re: Credit card checks? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-109176@lists.php.net to get a copy of this message | ||
You could use an algorithms called mod10. Both Visa, MasterCard and I think
most other credit cards use the mod10 algorithm. A credit card must pass a
mod10 test to be a valid number(Like a Regular Expression test). It won't
tell you if the number exist, but it will tell you if it could exist. I
also know the mod10 is used for Canadian Social Security numbers (SIN).
Unfortunately I have never seen a PHP function for it, I only used mod10 in
a language called Uniface by Compuware. I know there is another name for
it also, but I can't remember it right now.
It is a great test, someone just typing in numbers at random will have a
terrible time guessing a number right. I have never seen someone do it let.
Then you can use the first character of the number to test the card type.
I will see if I can locate the algorithm and email it too you.
Mark
"Jas" <jlgerfen@hotmail.com> wrote in message
news:20020723181239.25134.qmail@pb1.pair.com...
> Just wondering if anyone has come across the need to develop a class to
test
> a string of numbers based on a credit card type. If you have where would
I
> be able to get information on what string of numbers is consistent with
each
> of the different credit cards? Any help would be appreciated!
> Jas
>
>