validate() public method

These fields are required by all eCheck payment tokens: last4 - string Last 4 digits of the check
Since: 2.6.0
public validate ( ) : boolean
return boolean True if the passed data is valid
Esempio n. 1
0
 /**
  * Test validation for empty/unset values.
  * @since 2.6.0
  */
 function test_wc_payment_token_echeck_validate_empty()
 {
     $token = new WC_Payment_Token_eCheck();
     $token->set_token(time() . ' ' . __FUNCTION__);
     $this->assertFalse($token->validate());
     $token->set_last4('1111');
     $this->assertTrue($token->validate());
 }