*/ protected $params = [ 'noscript' => false, /* Includes the HTML; } return $return; } /** * Gets a solution to the verify server * * @param string $responseField * @return \Laminas\Http\Response * @throws Exception */ protected function post($responseField) { if ($this->secretKey === null) { throw new Exception('Missing secret key'); } if ($this->ip === null) { throw new Exception('Missing ip address'); } /* Fetch an instance of the http client */ $httpClient = $this->getHttpClient(); $params = [ 'secret' => $this->secretKey, 'remoteip' => $this->ip, 'response' => $responseField, ]; $request = new HttpRequest(); $request->setUri(self::VERIFY_SERVER); $request->getPost()->fromArray($params); $request->setMethod(HttpRequest::METHOD_POST); $httpClient->setEncType($httpClient::ENC_URLENCODED); return $httpClient->send($request); } /** * Verify the user input * * This method calls up the post method and returns a * \Laminas\ReCaptcha\Response object. * * @param string $responseField * @return Response */ public function verify($responseField) { $response = $this->post($responseField); return new Response(null, null, $response); } }