get_order_tokens() public static method

Returns an array of payment token objects associated with the passed order ID.
Since: 2.6.0
public static get_order_tokens ( integer $order_id ) : array
$order_id integer Order ID
return array Array of token objects
 /**
  * Test getting tokens associated with an order.
  * @since 2.6.0
  */
 function test_wc_payment_tokens_get_order_tokens()
 {
     $order = WC_Helper_Order::create_order();
     $this->assertEmpty(WC_Payment_Tokens::get_order_tokens($order->id));
     $token = WC_Helper_Payment_Token::create_cc_token();
     update_post_meta($order->id, '_payment_tokens', array($token->get_id()));
     $this->assertCount(1, WC_Payment_Tokens::get_order_tokens($order->id));
 }
 /**
  * Returns a list of all payment tokens associated with the current order
  *
  * @since 2.6
  * @return array An array of payment token objects
  */
 public function get_payment_tokens()
 {
     return WC_Payment_Tokens::get_order_tokens($this->get_id());
 }