PHP Interface WC_Payment_Token_Data_Store_Interface

Functions that must be defined by payment token store classes.
Author: WooThemes
Show file Open project: woocommerce/woocommerce

Public Methods

Method Description
get_metadata ( id $token_id ) : array Returns metadata for a specific payment token.
get_token_by_id ( id $token_id ) : object Returns an stdObject of a token.
get_token_type_by_id ( id $token_id ) : string Get a token's type by ID.
get_tokens ( array $args ) : array Returns an array of objects (stdObject) matching specific token critera.
get_users_default_token ( id $user_id ) : object Returns an stdObject of a token for a user's default token.
set_default_status ( id $token_id, $status = true ) : string Update's a tokens default status in the database. Used for quickly looping through tokens and setting their statuses instead of creating a bunch of objects.

Method Details

get_metadata() public method

Returns metadata for a specific payment token.
public get_metadata ( id $token_id ) : array
$token_id id
return array

get_token_by_id() public method

Should contain the fields token_id, gateway_id, token, user_id, type, is_default.
public get_token_by_id ( id $token_id ) : object
$token_id id
return object

get_token_type_by_id() public method

Get a token's type by ID.
Since: 2.7.0
public get_token_type_by_id ( id $token_id ) : string
$token_id id
return string

get_tokens() public method

Accepts token_id, user_id, gateway_id, and type. Each object should contain the fields token_id, gateway_id, token, user_id, type, is_default.
public get_tokens ( array $args ) : array
$args array
return array

get_users_default_token() public method

Should contain the fields token_id, gateway_id, token, user_id, type, is_default.
public get_users_default_token ( id $user_id ) : object
$user_id id
return object

set_default_status() public method

Update's a tokens default status in the database. Used for quickly looping through tokens and setting their statuses instead of creating a bunch of objects.
public set_default_status ( id $token_id, $status = true ) : string
$token_id id
return string