Moodle  2.2.1
http://www.collinsharper.com
Zend_Validate_CreditCard Class Reference
Inheritance diagram for Zend_Validate_CreditCard:
Collaboration diagram for Zend_Validate_CreditCard:

Public Member Functions

 __construct ($options=array())
 getType ()
 setType ($type)
 addType ($type)
 getService ()
 setService ($service)
 isValid ($value)

Data Fields

const ALL = 'All'
const AMERICAN_EXPRESS = 'American_Express'
const UNIONPAY = 'Unionpay'
const DINERS_CLUB = 'Diners_Club'
const DINERS_CLUB_US = 'Diners_Club_US'
const DISCOVER = 'Discover'
const JCB = 'JCB'
const LASER = 'Laser'
const MAESTRO = 'Maestro'
const MASTERCARD = 'Mastercard'
const SOLO = 'Solo'
const VISA = 'Visa'
const CHECKSUM = 'creditcardChecksum'
const CONTENT = 'creditcardContent'
const INVALID = 'creditcardInvalid'
const LENGTH = 'creditcardLength'
const PREFIX = 'creditcardPrefix'
const SERVICE = 'creditcardService'
const SERVICEFAILURE = 'creditcardServiceFailure'

Protected Attributes

 $_messageTemplates
 $_cardLength
 $_cardType
 $_type = array()
 $_service

Detailed Description

Definition at line 33 of file CreditCard.php.


Constructor & Destructor Documentation

__construct ( options = array())

Constructor

Parameters:
string | array$typeOPTIONAL Type of CCI to allow

Definition at line 141 of file CreditCard.php.

Here is the call graph for this function:


Member Function Documentation

addType ( type)

Adds a CCI to be accepted by validation

Parameters:
string | array$typeType to allow for validation
Returns:
Zend_Validate_CreditCard Provides a fluid interface

Definition at line 193 of file CreditCard.php.

Here is the caller graph for this function:

Returns the actual set service

Returns:
callback

Definition at line 217 of file CreditCard.php.

getType ( )

Returns a list of accepted CCIs

Returns:
array

Definition at line 170 of file CreditCard.php.

Here is the caller graph for this function:

isValid ( value)

Defined by Zend_Validate_Interface

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

Parameters:
string$value
Returns:
boolean

Implements Zend_Validate_Interface.

Definition at line 246 of file CreditCard.php.

Here is the call graph for this function:

setService ( service)

Sets a new callback for service validation

Parameters:
unknown_type$service

Definition at line 227 of file CreditCard.php.

Here is the caller graph for this function:

setType ( type)

Sets CCIs which are accepted by validation

Parameters:
string | array$typeType to allow for validation
Returns:
Zend_Validate_CreditCard Provides a fluid interface

Definition at line 181 of file CreditCard.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

$_cardLength [protected]
Initial value:
 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),
    )

Definition at line 81 of file CreditCard.php.

$_cardType [protected]
Initial value:
 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'),
    )

Definition at line 100 of file CreditCard.php.

$_messageTemplates [protected]
Initial value:
 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%'",
    )

Reimplemented from Zend_Validate_Abstract.

Definition at line 66 of file CreditCard.php.

$_service [protected]

Definition at line 134 of file CreditCard.php.

$_type = array() [protected]

Definition at line 127 of file CreditCard.php.

const ALL = 'All'

Definition at line 40 of file CreditCard.php.

const AMERICAN_EXPRESS = 'American_Express'

Definition at line 41 of file CreditCard.php.

const CHECKSUM = 'creditcardChecksum'

Definition at line 53 of file CreditCard.php.

const CONTENT = 'creditcardContent'

Definition at line 54 of file CreditCard.php.

const DINERS_CLUB = 'Diners_Club'

Definition at line 43 of file CreditCard.php.

const DINERS_CLUB_US = 'Diners_Club_US'

Definition at line 44 of file CreditCard.php.

const DISCOVER = 'Discover'

Definition at line 45 of file CreditCard.php.

const INVALID = 'creditcardInvalid'

Definition at line 55 of file CreditCard.php.

const JCB = 'JCB'

Definition at line 46 of file CreditCard.php.

const LASER = 'Laser'

Definition at line 47 of file CreditCard.php.

const LENGTH = 'creditcardLength'

Definition at line 56 of file CreditCard.php.

const MAESTRO = 'Maestro'

Definition at line 48 of file CreditCard.php.

const MASTERCARD = 'Mastercard'

Definition at line 49 of file CreditCard.php.

const PREFIX = 'creditcardPrefix'

Definition at line 57 of file CreditCard.php.

const SERVICE = 'creditcardService'

Definition at line 58 of file CreditCard.php.

const SERVICEFAILURE = 'creditcardServiceFailure'

Definition at line 59 of file CreditCard.php.

const SOLO = 'Solo'

Definition at line 50 of file CreditCard.php.

const UNIONPAY = 'Unionpay'

Definition at line 42 of file CreditCard.php.

const VISA = 'Visa'

Definition at line 51 of file CreditCard.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations