Inheritance diagram for CreditCardValidationSolution:

Public Member Functions | |
| validateCreditCard ($Number, $CheckNumber, $Language='en', $Accepted='', $RequireExp='N', $Month='', $Year='') | |
| getCreditCardType () | |
Public Attributes | |
| $CCVSNumber = '' | |
| $CCVSNumberLeft = '' | |
| $CCVSNumberRight = '' | |
| $CCVSType = '' | |
| $CCVSExpiration = '' | |
| $CCVSError = '' | |
|
|
|
|
||||||||||||||||||||||||||||||||
|
Ensures credit card information is keyed in correctly. Checks that the length is correct, the first four digits are within accepted ranges, the number passes the Mod 10 / Luhn checksum algorithm and that you accept the given type of card. It also determines the card's type via the number's first four digits. The procedure has the option to check the card's expiration date.
Error messages are internationalized through use of variables defined by files in the Just to be clear, this process does not check with banks or credit card companies to see if the card number given is actually associated with a good account. It just checks to see if the number matches the expected format. Warning: this function uses exact number ranges as part of the validation process. These ranges are current as of 30 July 2002. If presently undefined ranges come into use in the future, this program will improperly deject card numbers in such ranges, rendering an error saying "First four digits indicate unknown card type." If this happens while entering a card and type you KNOW are valid, please contact us so we can update the ranges. This function requires PHP to be at version 4.0 or above. Please make a donation to support our open source development. Update notifications are sent to people who make donations that exceed the small registration threshold. See the link below. Credit Card Validation Solution is a trademark of The Analysis and Solutions Company. Several people deserve praise for the Credit Card Validation Solution. I learned of the Mod 10 Algorithm in some Perl code, entitled "The Validator," available on Matt's Script Archive, http://www.scriptarchive.com/ccver.html. That code was written by David Paris, who based it on material Melvyn Myers reposted from an unknown author. Paris credits Aries Solis for tracking down the data underlying the algorithm. I pruned down the algorithm to it's core components, making things smaller, cleaner and more flexible. Plus, I added the expiration date checking routine. My first attemts at this were in Visual Basic, on which Allen Browne and Rico Zschau assisted. Neil Fraser helped a bit on the Perl version. Steve Horsley, Roedy Green and Jon Skeet provided tips on the Java Edition.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.4.4