WC_Payment_Token_Data_Store_Interface
in
Payment Token Data Store Interface
Tags
Table of Contents
- get_metadata() : array
- Returns metadata for a specific payment token.
- get_token_by_id() : object
- Returns an stdObject of a token.
- get_token_type_by_id() : string
- Get a token's type by ID.
- get_tokens() : array
- Returns an array of objects (stdObject) matching specific token criteria.
- get_users_default_token() : object
- Returns an stdObject of a token for a user's default token.
- set_default_status() : 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.
Methods
get_metadata()
Returns metadata for a specific payment token.
public
get_metadata(int $token_id) : array
Parameters
- $token_id : int
-
Token ID.
Return values
arrayget_token_by_id()
Returns an stdObject of a token.
public
get_token_by_id(int $token_id) : object
Should contain the fields token_id, gateway_id, token, user_id, type, is_default.
Parameters
- $token_id : int
-
Token ID.
Return values
objectget_token_type_by_id()
Get a token's type by ID.
public
get_token_type_by_id(int $token_id) : string
Parameters
- $token_id : int
-
Token ID.
Return values
stringget_tokens()
Returns an array of objects (stdObject) matching specific token criteria.
public
get_tokens(array $args) : array
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.
Parameters
- $args : array
-
Arguments.
Return values
arrayget_users_default_token()
Returns an stdObject of a token for a user's default token.
public
get_users_default_token(int $user_id) : object
Should contain the fields token_id, gateway_id, token, user_id, type, is_default.
Parameters
- $user_id : int
-
User ID.
Return values
objectset_default_status()
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(int $token_id[, bool $status = true ]) : string
Parameters
- $token_id : int
-
Token ID.
- $status : bool = true
-
If should update status.