get_token_type_by_id() public static method

Returns what type (credit card, echeck, etc) of token a token is by ID.
Since: 2.6.0
public static get_token_type_by_id ( integer $token_id ) : string
$token_id integer Token ID
return string Type
 /**
  * Test getting a token's type by ID.
  * @since 2.6.0
  */
 function test_wc_payment_tokens_get_type_by_id()
 {
     $token = WC_Helper_Payment_Token::create_cc_token();
     $token_id = $token->get_id();
     $this->assertEquals('CC', WC_Payment_Tokens::get_token_type_by_id($token_id));
 }