Yii Framework Forum: [EXTENSION] ECCValidator - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] ECCValidator Credit Card validator implementing Mod10 algorithm Rate Topic: -----

#1 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 13 February 2011 - 08:13 AM

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
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#2 User is offline   Bhaumik 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 22-July 11

Posted 22 July 2011 - 04:11 AM

Hi How do i add the rules for the all validation of the creditcard?
0

#3 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

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.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#4 User is offline   jharkins 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 11-February 11

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!
0

#5 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 22 August 2011 - 04:06 PM

View Postjharkins, 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!


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.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#6 User is offline   Rajith R 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 831
  • Joined: 20-April 11
  • Location:India

Posted 03 July 2012 - 03:18 AM

hi Antonio Ramirez, This is an awesome implementation


Forum Post


is this above problem solved?
Rajith Ramachandran,
Wiwo inc.
| Mobile: 919995504508
0

#7 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 03 July 2012 - 05:47 AM

View PostRajith R, on 03 July 2012 - 03:18 AM, said:

hi Antonio Ramirez, This is an awesome implementation


Forum Post


is this above problem solved?


Yes, indeed: https://github.com/t...idator.php#L117
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#8 User is offline   Rajith R 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 831
  • Joined: 20-April 11
  • Location:India

Posted 03 July 2012 - 08:14 AM

thank u...Antonio Ramirez>>

the code in gthub and eccvalidator , are the same. right??
Rajith Ramachandran,
Wiwo inc.
| Mobile: 919995504508
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users