Exemple #1
0
 /**
  * @param bool $throwException
  * @throws ThePayException
  * @return bool
  */
 public function verifySignature($throwException = TRUE)
 {
     if ($this->error) {
         if ($throwException) {
             throw new ThePayException($this->error->getMessage(), $this->error->getCode());
         }
         return FALSE;
     }
     try {
         parent::verifySignature();
     } catch (\TpInvalidSignatureException $e) {
         if ($throwException) {
             throw new ThePayException('Invalid signature.');
         }
         return FALSE;
     }
     if (!is_numeric(parent::getValue())) {
         if ($throwException) {
             throw new ThePayException('Price is not numeric.');
         }
         return FALSE;
     }
     return TRUE;
 }