OXID eShop CE  4.8.11
 All Classes Files Functions Variables Pages
oxCcValidator Class Reference

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$sDatecredit 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$sNumbercredit 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$sTypecredit card type
string$sNumbercredit 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$sNumbercredit card number
string$sTypecredit card type [optional]
string$sDatecard 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: