PHP 클래스 WC_Payment_Tokens

An API for storing and managing tokens for gateways and customers.
부터: 2.6.0
저자: WooThemes
파일 보기 프로젝트 열기: woocommerce/woocommerce 1 사용 예제들

공개 메소드들

메소드 설명
delete ( WC_Payment_Token $token_id ) Remove a payment token from the database by ID.
get ( integer $token_id, $token_result = null ) : WC_Payment_Token | null Get a token object by ID.
get_customer_default_token ( integer $customer_id ) : WC_Payment_Token | null Returns a customers default token or NULL if there is no default token.
get_customer_tokens ( integer $customer_id, string $gateway_id = '' ) : array Returns an array of payment token objects associated with the passed customer ID.
get_order_tokens ( integer $order_id ) : array Returns an array of payment token objects associated with the passed order ID.
get_token_type_by_id ( integer $token_id ) : string Returns what type (credit card, echeck, etc) of token a token is by ID.
get_tokens ( array $args ) : array Gets valid tokens from the database based on user defined criteria.
set_users_default ( integer $user_id, integer $token_id ) Loops through all of a users payment tokens and sets is_default to false for all but a specific token.

메소드 상세

delete() 공개 정적인 메소드

Remove a payment token from the database by ID.
부터: 2.6.0
public static delete ( WC_Payment_Token $token_id )
$token_id WC_Payment_Token Token ID

get() 공개 정적인 메소드

Get a token object by ID.
부터: 2.6.0
public static get ( integer $token_id, $token_result = null ) : WC_Payment_Token | null
$token_id integer Token ID
리턴 WC_Payment_Token | null Returns a valid payment token or null if no token can be found

get_customer_default_token() 공개 정적인 메소드

Returns a customers default token or NULL if there is no default token.
부터: 2.6.0
public static get_customer_default_token ( integer $customer_id ) : WC_Payment_Token | null
$customer_id integer
리턴 WC_Payment_Token | null

get_customer_tokens() 공개 정적인 메소드

Returns an array of payment token objects associated with the passed customer ID.
부터: 2.6.0
public static get_customer_tokens ( integer $customer_id, string $gateway_id = '' ) : array
$customer_id integer Customer ID
$gateway_id string Optional Gateway ID for getting tokens for a specific gateway
리턴 array Array of token objects

get_order_tokens() 공개 정적인 메소드

Returns an array of payment token objects associated with the passed order ID.
부터: 2.6.0
public static get_order_tokens ( integer $order_id ) : array
$order_id integer Order ID
리턴 array Array of token objects

get_token_type_by_id() 공개 정적인 메소드

Returns what type (credit card, echeck, etc) of token a token is by ID.
부터: 2.6.0
public static get_token_type_by_id ( integer $token_id ) : string
$token_id integer Token ID
리턴 string Type

get_tokens() 공개 정적인 메소드

Gets valid tokens from the database based on user defined criteria.
부터: 2.6.0
public static get_tokens ( array $args ) : array
$args array
리턴 array

set_users_default() 공개 정적인 메소드

Loops through all of a users payment tokens and sets is_default to false for all but a specific token.
부터: 2.6.0
public static set_users_default ( integer $user_id, integer $token_id )
$user_id integer User to set a default for
$token_id integer The ID of the token that should be default