Class CreditCard
Check if the input is valid credit card number
The type of credit card could be American Express, Diners Club, Discover, JCB, MasterCard, China UnionPay or Visa
- Wei\Base
-
Wei\Validator\BaseValidator
-
Wei\Validator\CreditCard
public
boolean
|
|
protected
boolean
|
|
public
boolean
|
|
public
|
|
public
|
__call(),
__construct(),
__get(),
getOption(),
setOption()
|
t()
|
protected
string
|
$invalidMessage
|
#
'%name% must be valid credit card number'
|
protected
string
|
$negativeMessage
The common message for negative validator |
#
'%name% must not be valid credit card number'
|
protected
array
|
$type
Allowed credit cards name |
#
array()
|
protected
array
|
$cards
The array contains card name, length and validation pattern |
#
array(
'Amex' => array( // American Express
'length' => 15,
'pattern' => '34|37'
),
'DinersClub' => array(
'length' => 14,
'pattern' => '30|36|38'
),
'Discover' => array(
'length' => 16,
'pattern' => '6011|64|65'
),
'JCB' => array(
'length' => array(15, 16),
'pattern' => '2131|1800|35'
),
'MasterCard' => array(
'length' => 16,
'pattern' => '51|52|53|54|55'
),
'UnionPay' => array(
'length' => 16,
'pattern' => '62'
),
'Visa' => array(
'length' => array(13, 16),
'pattern' => '4'
)
)
|
$errors,
$name,
$negative,
$notStringMessage,
$validator
|
$providers,
$wei
|
$t
|