public function sendRecaptchaV2($googleKey, $pageUrl, $extra = [])
    {
        $this->getLogger()->info("Try send google key (recaptcha)  on {$this->serverBaseUri}/in.php");

        if ($this->softId && !isset($extra[Extra::SOFT_ID])) {
            $extra[Extra::SOFT_ID] = $this->softId;
        }

        $response = $this->getHttpClient()->request('POST', "/in.php", [
            RequestOptions::QUERY => array_merge($extra, [
                'method' => 'userrecaptcha',
                'key' => $this->apiKey,
                'googlekey' => $googleKey,
                'pageurl' => $pageUrl
            ])
        ]);

        $responseText = $response->getBody()->__toString();

        if (strpos($responseText, 'OK|') !== false) {
            $this->lastCaptchaId = explode("|", $responseText)[1];
            $this->getLogger()->info("Sending success. Got captcha id `{$this->lastCaptchaId}`.");
            return $this->lastCaptchaId;
        }

        throw new ErrorResponseException($this->getErrorMessage($responseText) ?: "Unknown error: `{$responseText}`.");
    }
public function sendRecaptchaV2($googleKey, $pageUrl, $extra = [])
    {
        $this->getLogger()->info("Try send google key (recaptcha)  on {$this->serverBaseUri}/in.php");

        if ($this->softId && !isset($extra[Extra::SOFT_ID])) {
            $extra[Extra::SOFT_ID] = $this->softId;
        }

        $response = $this->getHttpClient()->request('POST', "/in.php", [
            RequestOptions::QUERY => array_merge($extra, [
                'method' => 'userrecaptcha',
                'key' => $this->apiKey,
                'googlekey' => $googleKey,
                'pageurl' => $pageUrl
            ])
        ]);

        $responseText = $response->getBody()->__toString();

        if (strpos($responseText, 'OK|') !== false) {
            $this->lastCaptchaId = explode("|", $responseText)[1];
            $this->getLogger()->info("Sending success. Got captcha id `{$this->lastCaptchaId}`.");
            return $this->lastCaptchaId;
        }

        throw new ErrorResponseException($this->getErrorMessage($responseText) ?: "Unknown error: `{$responseText}`.");
    }
public function sendRecaptchaV2 ( $ googleKey , $ pageUrl , $ extra = [ ] ) { $ this -> getLogger ( ) -> info ( "Try send google key (recaptcha)  on {$this->serverBaseUri}/in.php" ) ; if ( $ this -> softId && ! isset ( $ extra [ Extra :: SOFT_ID ] ) ) { $ extra [ Extra :: SOFT_ID ] = $ this -> softId ; } $ response = $ this -> getHttpClient ( ) -> request ( 'POST' , "/in.php" , [ RequestOptions :: QUERY => array_merge ( $ extra , [ 'method' => 'userrecaptcha' , 'key' => $ this -> apiKey , 'googlekey' => $ googleKey , 'pageurl' => $ pageUrl ] ) ] ) ; $ responseText = $ response -> getBody ( ) -> __toString ( ) ; if ( strpos ( $ responseText , 'OK|' ) !== false ) { $ this -> lastCaptchaId = explode ( "|" , $ responseText ) [ 1 ] ; $ this -> getLogger ( ) -> info ( "Sending success. Got captcha id `{$this->lastCaptchaId}`." ) ; return $ this -> lastCaptchaId ; } throw new ErrorResponseException ( $ this -> getErrorMessage ( $ responseText ) ? : "Unknown error: `{$responseText}`." ) ; }
Sent recaptcha v2

@param string $googleKey
@param string $pageUrl
@param array $extra
@return string
@throws ErrorResponseException
@throws \GuzzleHttp\Exception\GuzzleException
Sent recaptcha v2