Public Member Functions | Protected Member Functions | Protected Attributes

oxCcValidator Class Reference

List of all members.

Public Member Functions

 isValidCard ($sNumber, $sType="", $sDate="")

Protected Member Functions

 _isValidType ($sType, $sNumber)
 _isExpired ($sDate)
 _isValidNumer ($sNumber)

Protected Attributes

 $_aCardsInfo

Detailed Description

Credit card validation class

Definition at line 7 of file oxccvalidator.php.


Member Function Documentation

oxCcValidator._isExpired ( sDate  )  [protected]

Checks credit card expiration date. Returns TRUE if card is not expired

Parameters:
string $sDate credit card type
Returns:
bool

Definition at line 52 of file oxccvalidator.php.

oxCcValidator._isValidNumer ( sNumber  )  [protected]

checks credit card number. Returns TRUE if card number is valid

Parameters:
string $sNumber credit card number
Returns:
bool

Definition at line 77 of file oxccvalidator.php.

oxCcValidator._isValidType ( sType,
sNumber 
) [protected]

Checks credit card type. Returns TRUE if card is valid

Parameters:
string $sType credit card type
string $sNumber credit card number
Returns:
bool

Definition at line 34 of file oxccvalidator.php.

oxCcValidator.isValidCard ( sNumber,
sType = "",
sDate = "" 
)

Checks if provided credit card information is valid. Returns TRUE if valid

Parameters:
object $sNumber credit card number
string $sType credit card type [optional]
string $sDate card expiration date [optional]
Returns:
bool

Definition at line 111 of file oxccvalidator.php.


Member Data Documentation

oxCcValidator.$_aCardsInfo [protected]
Initial value:
 array(                                           
                                   "amx" => '/^3[47].{13}$/',                 
                                   "dlt" => '/^4.{15}$/',                     
                                   "dnc" => '/^30[0-5].{11}$|^3[68].{12}$/',  
                                   "dsc" => '/^6011.{12}$/',                  
                                   "enr" => '/^2014.{11}$|^2149.{11}$/',      
                                   "jcb" => '/^3.{15}$|^2131|1800.{11}$/',    
                                   "mcd" => '/^5[1-5].{14}$/',                
                                   "swi" => '/^[456].{15}$|^[456].{17,18}$/', 
                                   "vis" => '/^4.{15}$|^4.{12}$/',            
                                 )

Definition at line 14 of file oxccvalidator.php.


The documentation for this class was generated from the following file: