WordPress at Your Fingertips
function is not described

WC_Payment_Tokens::get_order_tokens() public WC 2.6.0

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

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

Hooks from the method
Return

WC_Payment_Token[]. Array of token objects.

Usage

$result = WC_Payment_Tokens::get_order_tokens( $order_id );
$order_id(int) (required)
Order ID.

Changelog

Since 2.6.0 Introduced.

Code of WC_Payment_Tokens::get_order_tokens() WC 5.6.0

public static function get_order_tokens( $order_id ) {
	$order = wc_get_order( $order_id );

	if ( ! $order ) {
		return array();
	}

	$token_ids = $order->get_payment_tokens();

	if ( empty( $token_ids ) ) {
		return array();
	}

	$tokens = self::get_tokens(
		array(
			'token_id' => $token_ids,
		)
	);

	return apply_filters( 'woocommerce_get_order_payment_tokens', $tokens, $order_id );
}