WordPress at Your Fingertips
function is not described

WC_Payment_Tokens::get_customer_tokens() public WC 2.6.0

Returns an array of payment token objects associated with the passed customer ID.

{} It's a method of the class: WC_Payment_Tokens{}

Return

WC_Payment_Token[]. Array of token objects.

Usage

$result = WC_Payment_Tokens::get_customer_tokens( $customer_id, $gateway_id );
$customer_id(int) (required)
Customer ID.
$gateway_id(string)
Optional Gateway ID for getting tokens for a specific gateway.
Default: ''

Changelog

Since 2.6.0 Introduced.

Code of WC_Payment_Tokens::get_customer_tokens() WC 5.7.1

public static function get_customer_tokens( $customer_id, $gateway_id = '' ) {
	if ( $customer_id < 1 ) {
		return array();
	}

	$tokens = self::get_tokens(
		array(
			'user_id'    => $customer_id,
			'gateway_id' => $gateway_id,
		)
	);

	return apply_filters( 'woocommerce_get_customer_payment_tokens', $tokens, $customer_id, $gateway_id );
}