Ejemplo n.º 1
0
 /**
  * @param string $code
  * @return bool
  */
 public function verify($code)
 {
     $params = ['pCaptcha' => (string) $code];
     try {
         $response = $this->transport->__soapCall('SprawdzCaptcha', [$params]);
     } catch (\SoapFault $e) {
         throw new RegonException($e->getMessage(), 0, $e);
     }
     return (bool) $response->SprawdzCaptchaResult;
 }
Ejemplo n.º 2
0
 /**
  * @param string $regon
  * @param string $name
  * @return array|mixed
  */
 public function report($regon, $name)
 {
     $params = ['pRegon' => $regon, 'pNazwaRaportu' => $name];
     try {
         $response = $this->transport->__soapCall('DanePobierzPelnyRaport', [$params]);
     } catch (\SoapFault $e) {
         throw new RegonException($e->getMessage(), 0, $e);
     }
     if (empty($response->DanePobierzPelnyRaportResult)) {
         $message = $this->getValue(GetValue::ERROR_MESSAGE);
         $code = $this->getValue(GetValue::ERROR_CODE);
         if ($message || $code) {
             throw new SearchException($message, $code);
         }
         throw new SearchException('', Enum\GetValue::SEARCH_ERROR_SESSION);
     }
     return $this->normalizeResponse($response->DanePobierzPelnyRaportResult);
 }