validate() public method

This method is called internally by gateways to avoid wasting time with an API call when the credit card is clearly invalid. Generally if you want to validate the credit card yourself with custom error messages, you should use your framework's validation library, not this method.
public validate ( ) : void
return void
Esempio n. 1
0
 /**
  * @expectedException Omnipay\Common\Exception\InvalidCreditCardException
  * @expectedExceptionMessage Card number should have 12 to 19 digits
  */
 public function testInvalidShortCard()
 {
     $this->card->setNumber('4440');
     $this->card->validate();
 }