WC_Payment_Tokens::get_order_tokens( int $order_id )
Returns an array of payment token objects associated with the passed order ID.
Description Description
Parameters Parameters
- $order_id
-
(Required) Order ID.
Return Return
(WC_Payment_Token[]) Array of token objects.
Source Source
File: includes/class-wc-payment-tokens.php
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 ); }
Changelog Changelog
Version | Description |
---|---|
2.6.0 | Introduced. |