set_last4() public method

Set the last four digits.
Since: 2.6.0
public set_last4 ( string $last4 )
$last4 string
 /**
  * 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;
 }
Beispiel #2
0
 /**
  * Test get/set last4.
  * @since 2.6.0
  */
 public function test_wc_payment_token_echeck_last4()
 {
     $token = new WC_Payment_Token_eCheck();
     $token->set_last4('1111');
     $this->assertEquals('1111', $token->get_last4());
 }