PHP Class WC_Payment_Token_CC

Representation of a payment token for credit cards.
Since: 2.6.0
Author: WooThemes
Inheritance: extends WC_Payment_Token
Mostra file Open project: woocommerce/woocommerce Class Usage Examples

Protected Properties

Property Type Description
$type

Public Methods

Method Description
get_card_type ( string $context = 'view' ) : string Returns the card type (mastercard, visa, .
get_display_name ( string $context = 'view' ) : string Get type to display to user.
get_expiry_month ( string $context = 'view' ) : string Returns the card expiration month (MM).
get_expiry_year ( string $context = 'view' ) : string Returns the card expiration year (YYYY).
get_last4 ( string $context = 'view' ) : string Returns the last four digits.
set_card_type ( string $type ) Set the card type (mastercard, visa, .
set_expiry_month ( string $month ) Set the expiration month for the card (formats into MM format).
set_expiry_year ( string $year ) Set the expiration year for the card (YYYY format).
set_last4 ( string $last4 ) Set the last four digits.
validate ( ) : boolean Validate credit card payment tokens.

Protected Methods

Method Description
get_hook_prefix ( ) Hook prefix

Method Details

get_card_type() public method

..).
Since: 2.6.0
public get_card_type ( string $context = 'view' ) : string
$context string
return string Card type

get_display_name() public method

Get type to display to user.
Since: 2.6.0
public get_display_name ( string $context = 'view' ) : string
$context string
return string

get_expiry_month() public method

Returns the card expiration month (MM).
Since: 2.6.0
public get_expiry_month ( string $context = 'view' ) : string
$context string
return string Expiration month

get_expiry_year() public method

Returns the card expiration year (YYYY).
Since: 2.6.0
public get_expiry_year ( string $context = 'view' ) : string
$context string
return string Expiration year

get_hook_prefix() protected method

Hook prefix
Since: 2.7.0
protected get_hook_prefix ( )

get_last4() public method

Returns the last four digits.
Since: 2.6.0
public get_last4 ( string $context = 'view' ) : string
$context string
return string Last 4 digits

set_card_type() public method

..).
Since: 2.6.0
public set_card_type ( string $type )
$type string

set_expiry_month() public method

Set the expiration month for the card (formats into MM format).
Since: 2.6.0
public set_expiry_month ( string $month )
$month string

set_expiry_year() public method

Set the expiration year for the card (YYYY format).
Since: 2.6.0
public set_expiry_year ( string $year )
$year string

set_last4() public method

Set the last four digits.
Since: 2.6.0
public set_last4 ( string $last4 )
$last4 string

validate() public method

These fields are required by all credit card payment tokens: expiry_month - string Expiration date (MM) for the card expiry_year - string Expiration date (YYYY) for the card last4 - string Last 4 digits of the card card_type - string Card type (visa, mastercard, etc)
Since: 2.6.0
public validate ( ) : boolean
return boolean True if the passed data is valid

Property Details

$type protected_oe property

protected $type