Representation of a payment token for eChecks.
Since: 2.6.0
Author: WooThemes
Inheritance: extends WC_Payment_Token
Exemple #1
0
 /**
  * Test reading/getting a token from DB correctly sets meta.
  * @since 2.6.0
  */
 public function test_wc_payment_token_echeck_read_pulls_meta()
 {
     $token = WC_Helper_Payment_Token::create_eCheck_token();
     $token_id = $token->get_id();
     $token_read = new WC_Payment_Token_eCheck($token_id);
     $this->assertEquals('1234', $token_read->get_last4());
 }
 /**
  * Create a new eCheck payment token
  *
  * @since 2.6
  * @return WC_Payment_Token_eCheck object
  */
 public static function create_eCheck_token()
 {
     $token = new WC_Payment_Token_eCheck();
     $token->set_last4(1234);
     $token->set_token(time());
     $token->save();
     return $token;
 }