Class Zend_Validate_CreditCard

Description
  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Validate/CreditCard.php (line 33)

Zend_Validate_Abstract
   |
   --Zend_Validate_CreditCard
Class Constant Summary
 ALL = 'All'
 AMERICAN_EXPRESS = 'American_Express'
 CHECKSUM = 'creditcardChecksum'
 CONTENT = 'creditcardContent'
 DINERS_CLUB = 'Diners_Club'
 DINERS_CLUB_US = 'Diners_Club_US'
 DISCOVER = 'Discover'
 INVALID = 'creditcardInvalid'
 JCB = 'JCB'
 LASER = 'Laser'
 LENGTH = 'creditcardLength'
 MAESTRO = 'Maestro'
 MASTERCARD = 'Mastercard'
 PREFIX = 'creditcardPrefix'
 SERVICE = 'creditcardService'
 SERVICEFAILURE = 'creditcardServiceFailure'
 SOLO = 'Solo'
 UNIONPAY = 'Unionpay'
 VISA = 'Visa'
Variable Summary
 array $_cardLength
 array $_cardType
 callback $_service
 array $_type
Method Summary
 Zend_Validate_CreditCard addType (string|array $type)
 callback getService ()
 array getType ()
 boolean isValid (string $value)
 void setService (unknown_type $service)
 Zend_Validate_CreditCard setType (string|array $type)
 Zend_Validate_CreditCard __construct ([ $options = array()], string|array $type)
Variables
array $_cardLength = array(
self::AMERICAN_EXPRESS => array(15),self::DINERS_CLUB=>array(14),self::DINERS_CLUB_US=>array(16),self::DISCOVER=>array(16),self::JCB=>array(16),self::LASER=>array(16,17,18,19),self::MAESTRO=>array(12,13,14,15,16,17,18,19),self::MASTERCARD=>array(16),self::SOLO=>array(16,18,19),self::UNIONPAY=>array(16,17,18,19),self::VISA=>array(16),)
(line 81)

List of allowed CCV lengths

  • access: protected
array $_cardType = array(
self::AMERICAN_EXPRESS => array('34', '37'),self::DINERS_CLUB=>array('300','301','302','303','304','305','36'),self::DINERS_CLUB_US=>array('54','55'),self::DISCOVER=>array('6011','622126','622127','622128','622129','62213','62214','62215','62216','62217','62218','62219','6222','6223','6224','6225','6226','6227','6228','62290','62291','622920','622921','622922','622923','622924','622925','644','645','646','647','648','649','65'),self::JCB=>array('3528','3529','353','354','355','356','357','358'),self::LASER=>array('6304','6706','6771','6709'),self::MAESTRO=>array('5018','5020','5038','6304','6759','6761','6763'),self::MASTERCARD=>array('51','52','53','54','55'),self::SOLO=>array('6334','6767'),self::UNIONPAY=>array('622126','622127','622128','622129','62213','62214','62215','62216','62217','62218','62219','6222','6223','6224','6225','6226','6227','6228','62290','62291','622920','622921','622922','622923','622924','622925'),self::VISA=>array('4'),)
(line 100)

List of accepted CCV provider tags

  • access: protected
array $_messageTemplates = array(
self::CHECKSUM => "Luhn algorithm (mod-10 checksum) failed on '%value%'",
self::CONTENT => "'%value%' must contain only digits",
self::INVALID => "Invalid type given, value should be a string",
self::LENGTH => "'%value%' contains an invalid amount of digits",
self::PREFIX => "'%value%' is not from an allowed institute",
self::SERVICE => "Validation of '%value%' has been failed by the service",
self::SERVICEFAILURE => "The service returned a failure while validating '%value%'",
)
(line 66)

Validation failure message template definitions

  • access: protected

Redefinition of:
Zend_Validate_Abstract::$_messageTemplates
Validation failure message template definitions
callback $_service (line 134)

Service callback for additional validation

  • access: protected
array $_type = array() (line 127)

CCIs which are accepted by validation

  • access: protected

Inherited Variables

Inherited from Zend_Validate_Abstract

Zend_Validate_Abstract::$_defaultTranslator
Zend_Validate_Abstract::$_errors
Zend_Validate_Abstract::$_messageLength
Zend_Validate_Abstract::$_messages
Zend_Validate_Abstract::$_messageVariables
Zend_Validate_Abstract::$_obscureValue
Zend_Validate_Abstract::$_translator
Zend_Validate_Abstract::$_translatorDisabled
Zend_Validate_Abstract::$_value
Methods
addType (line 193)

Adds a CCI to be accepted by validation

  • return: Provides a fluid interface
  • access: public
Zend_Validate_CreditCard addType (string|array $type)
  • string|array $type: Type to allow for validation
getService (line 217)

Returns the actual set service

  • access: public
callback getService ()
getType (line 170)

Returns a list of accepted CCIs

  • access: public
array getType ()
isValid (line 246)

Defined by Zend_Validate_Interface

Returns true if and only if $value follows the Luhn algorithm (mod-10 checksum)

  • access: public
boolean isValid (string $value)
  • string $value
setService (line 227)

Sets a new callback for service validation

  • access: public
void setService (unknown_type $service)
  • unknown_type $service
setType (line 181)

Sets CCIs which are accepted by validation

  • return: Provides a fluid interface
  • access: public
Zend_Validate_CreditCard setType (string|array $type)
  • string|array $type: Type to allow for validation
Constructor __construct (line 141)

Constructor

  • access: public
Zend_Validate_CreditCard __construct ([ $options = array()], string|array $type)
  • string|array $type: OPTIONAL Type of CCI to allow
  • $options

Inherited Methods

Inherited From Zend_Validate_Abstract

 Zend_Validate_Abstract::getDefaultTranslator()
 Zend_Validate_Abstract::getErrors()
 Zend_Validate_Abstract::getMessageLength()
 Zend_Validate_Abstract::getMessages()
 Zend_Validate_Abstract::getMessageTemplates()
 Zend_Validate_Abstract::getMessageVariables()
 Zend_Validate_Abstract::getObscureValue()
 Zend_Validate_Abstract::getTranslator()
 Zend_Validate_Abstract::hasDefaultTranslator()
 Zend_Validate_Abstract::hasTranslator()
 Zend_Validate_Abstract::setDefaultTranslator()
 Zend_Validate_Abstract::setDisableTranslator()
 Zend_Validate_Abstract::setMessage()
 Zend_Validate_Abstract::setMessageLength()
 Zend_Validate_Abstract::setMessages()
 Zend_Validate_Abstract::setObscureValue()
 Zend_Validate_Abstract::setTranslator()
 Zend_Validate_Abstract::translatorIsDisabled()
 Zend_Validate_Abstract::_createMessage()
 Zend_Validate_Abstract::_error()
 Zend_Validate_Abstract::_setValue()
 Zend_Validate_Abstract::__get()
Class Constants
ALL = 'All' (line 40)

Detected CCI list

AMERICAN_EXPRESS = 'American_Express' (line 41)
CHECKSUM = 'creditcardChecksum' (line 53)
CONTENT = 'creditcardContent' (line 54)
DINERS_CLUB = 'Diners_Club' (line 43)
DINERS_CLUB_US = 'Diners_Club_US' (line 44)
DISCOVER = 'Discover' (line 45)
INVALID = 'creditcardInvalid' (line 55)
JCB = 'JCB' (line 46)
LASER = 'Laser' (line 47)
LENGTH = 'creditcardLength' (line 56)
MAESTRO = 'Maestro' (line 48)
MASTERCARD = 'Mastercard' (line 49)
PREFIX = 'creditcardPrefix' (line 57)
SERVICE = 'creditcardService' (line 58)
SERVICEFAILURE = 'creditcardServiceFailure' (line 59)
SOLO = 'Solo' (line 50)
UNIONPAY = 'Unionpay' (line 42)
VISA = 'Visa' (line 51)

Documentation generated on Mon, 21 Jun 2010 15:14:51 -0400 by phpDocumentor 1.4.3