Validate_CreditCard

From: Date: Sun, 19 Oct 2003 01:15:30 +0000
Subject: Validate_CreditCard
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-22808@lists.php.net to get a copy of this message
Well I've taken some of the CC validation that is currently in Validate and added functions for the following: - Expiry date validation - Type/Number validation (ie. Discover card number starts with '6011') - A catch all to test an entire number's characteristics Not done (not even sure it's possible to test this): - Cvv number validation (any info on this would be great) - Someone needs to test types Diners Club and JCB (I don't have those cards) You can check out the class at: http://professorx.jcssolutions.com/~jstump/CreditCard.phps http://professorx.jcssolutions.com/~jstump/cc_test.phps The second link is a link to a tester script I created if you want to test things yourself. We also have to figure out what to do with the current Validate::creditCard() function. There are two options as I see it. 1.) Make it a wrapper for Validate_CreditCard::number() 2.) Remove it entirely in favor of the new Validate_CreditCard::number() The first option offers backwards compatibility and will not break code using this function if someone were to upgrade their Validate package. Comments? --Joe -- Joe Stump <joe@joestump.net> http://www.joestump.net "Label makers are proof God wants Sys Admins to be happy."

« previous php.pear.dev (#22808) next »