/**
  * @link https://www.paypal.com/en_US/vhelp/paypalmanager_help/credit_card_numbers.htm
  */
 public function testIsCcnum()
 {
     $input = '5105105105105100';
     $this->assertTrue(Inspekt::isCcnum($input));
 }
Exemple #2
0
 /**
  * Returns value if it is a valid credit card number format. The
  * optional second argument allows developers to indicate the
  * type.
  *
  * @param mixed $key
  * @param mixed $type
  * @return mixed
  *
  * @tag validator
  */
 function testCcnum($key, $type = NULL)
 {
     if (!$this->keyExists($key)) {
         return false;
     }
     if (Inspekt::isCcnum($this->_getValue($key), $type)) {
         return $this->_getValue($key);
     }
     return FALSE;
 }
Exemple #3
0
 /**
  * Returns value if it is a valid credit card number format. The
  * optional second argument allows developers to indicate the
  * type.
  *
  * @param mixed $key
  * @param mixed $type
  * @return mixed
  * @throws Exception
  * @tag validator
  */
 public function testCcnum($key, $type = null)
 {
     $value = $this->getValueOrNull($key);
     if (!is_null($value) && Inspekt::isCcnum($value, $type)) {
         return $value;
     }
     return false;
 }