The process here that offers you the ability to check the validity of any kind of credit card is a simple implementation of this algorithm.For any request, or in any case of difficulty, please feel free to contact the webmaster. You enter only the credit card numbers but absolutely not any personal information such as Name, Expiring Date, and the most critical the CVV (Card Verification Value) which is usually at the back (except for Amex cards).This feature can be added/removed as required; maybe useful, depending on specific requirements.
Each number position has a special purpose among defining the type of issuer (IIN), the account number, a check-sum digit, etc...
The following link specifies all group of digits and their purpose: Cracking the credit card digits Do you need a currency converter for your online purchases?
= 0 && s mod 10 = 0; END; CREATE FUNCTION ccd (n TINYTEXT) RETURNS TINYINT BEGIN DECLARE x TINYINT UNSIGNED; DECLARE l TINYINT UNSIGNED DEFAULT length(n); DECLARE i TINYINT UNSIGNED DEFAULT l; DECLARE s SMALLINT UNSIGNED DEFAULT 0; WHILE i This is only to make sure that the numbers are valid using some basic Reg EX patterns.
Note, this does not check to see if the numbers are in-use by someone.
Right now I need something that will work with American Express, Discover, Master Card, and Visa, but it might be helpful if it will also work with other types.
It's probably better NOT to validate in code at your end.
A check digit is a digit added to a number (either at the end or the beginning) that validates the authenticity of the number.
A simple algorithm is applied to the other digits of the number which yields the check digit.
Note that the algorithm used here is freely available across the web even