This the forum post for the credit card validator class. It validates credit card numbers prefix and uses Mod 10 algorithm to detect single-digit errors.
Currently supports:
- Maestro
- Solo
- Electron
- American Express
- Mastercard
- Discover
- JCB
- Voyager
- Diners Club
- Switch
- Laser
- VISA
To download the extension: http://www.yiiframew...n/eccvalidator/
Change Log
13-02-2011 Fixed regular expression bug for ECCValidator::ALL check
13-02-2011 Implemented the option for multiple card checking (Thanks mdomba)
Please use this post for suggestions, requests, and problems that may arise with the use of this class.
Hope you find it useful.
Cheers
Page 1 of 1
[EXTENSION] ECCValidator Credit Card validator implementing Mod10 algorithm
#1
Posted 13 February 2011 - 08:13 AM
¿How long would it take for you to understand that you own nothing in this world?
www.ramirezcobos.com
www.ramirezcobos.com
#2
Posted 22 July 2011 - 04:11 AM
Hi How do i add the rules for the all validation of the creditcard?
#3
Posted 23 July 2011 - 04:07 PM
The validation rule works only for the creditcard number, for the rest (exp date) use the other methods in the validator as you wish.
¿How long would it take for you to understand that you own nothing in this world?
www.ramirezcobos.com
www.ramirezcobos.com
#4
Posted 22 August 2011 - 04:02 PM
This is an awesome implementation of the mod 10 algorithm. Thanks for the hard work.
On a side note, I'd like to report a minor bug. In the public method validateDate, it currently will not allow dates in the month of December. Changing:
return is_integer($creditCardExpiredMonth) && $creditCardExpiredMonth > 1 && $creditCardExpiredMonth < 12 &&
to:
return is_integer($creditCardExpiredMonth) && $creditCardExpiredMonth > 1 && $creditCardExpiredMonth <= 12 &&
fixes it. Note: the only difference is <= instead of <.
Thanks again for such awesome work!
On a side note, I'd like to report a minor bug. In the public method validateDate, it currently will not allow dates in the month of December. Changing:
return is_integer($creditCardExpiredMonth) && $creditCardExpiredMonth > 1 && $creditCardExpiredMonth < 12 &&
to:
return is_integer($creditCardExpiredMonth) && $creditCardExpiredMonth > 1 && $creditCardExpiredMonth <= 12 &&
fixes it. Note: the only difference is <= instead of <.
Thanks again for such awesome work!
#5
Posted 22 August 2011 - 04:06 PM
jharkins, on 22 August 2011 - 04:02 PM, said:
This is an awesome implementation of the mod 10 algorithm. Thanks for the hard work.
On a side note, I'd like to report a minor bug. In the public method validateDate, it currently will not allow dates in the month of December. Changing:
return is_integer($creditCardExpiredMonth) && $creditCardExpiredMonth > 1 && $creditCardExpiredMonth < 12 &&
to:
return is_integer($creditCardExpiredMonth) && $creditCardExpiredMonth > 1 && $creditCardExpiredMonth <= 12 &&
fixes it. Note: the only difference is <= instead of <.
Thanks again for such awesome work!
On a side note, I'd like to report a minor bug. In the public method validateDate, it currently will not allow dates in the month of December. Changing:
return is_integer($creditCardExpiredMonth) && $creditCardExpiredMonth > 1 && $creditCardExpiredMonth < 12 &&
to:
return is_integer($creditCardExpiredMonth) && $creditCardExpiredMonth > 1 && $creditCardExpiredMonth <= 12 &&
fixes it. Note: the only difference is <= instead of <.
Thanks again for such awesome work!
Thanks for your words and for pointing that out, in fact, we should also allow January right?
¿How long would it take for you to understand that you own nothing in this world?
www.ramirezcobos.com
www.ramirezcobos.com
#7
Posted 03 July 2012 - 05:47 AM
¿How long would it take for you to understand that you own nothing in this world?
www.ramirezcobos.com
www.ramirezcobos.com
Share this topic:
Page 1 of 1

Help













