src/Client.php
public function recognizeRecaptchaV2($googleKey, $pageUrl, $extra = [])
    {
        $captchaId = $this->sendRecaptchaV2($googleKey, $pageUrl, $extra);
        $startTime = time();

        while (true) {
            $this->getLogger()->info("Waiting {$this->rTimeout} sec.");

            sleep($this->recaptchaRTimeout);

            if (time() - $startTime >= $this->mTimeout) {
                throw new RuntimeException("Captcha waiting timeout.");
            }

            $result = $this->getCaptchaResult($captchaId);

            if ($result === false) {
                continue;
            }

            $this->getLogger()->info("Elapsed " . (time()-$startTime) . " second(s).");

            return $result;
        }

        throw new RuntimeException('Unknown recognition logic error.');
    }
public function recognizeRecaptchaV2($googleKey, $pageUrl, $extra = [])
    {
        $captchaId = $this->sendRecaptchaV2($googleKey, $pageUrl, $extra);
        $startTime = time();

        while (true) {
            $this->getLogger()->info("Waiting {$this->rTimeout} sec.");

            sleep($this->recaptchaRTimeout);

            if (time() - $startTime >= $this->mTimeout) {
                throw new RuntimeException("Captcha waiting timeout.");
            }

            $result = $this->getCaptchaResult($captchaId);

            if ($result === false) {
                continue;
            }

            $this->getLogger()->info("Elapsed " . (time()-$startTime) . " second(s).");

            return $result;
        }

        throw new RuntimeException('Unknown recognition logic error.');
    }
Recaptcha V2 recognition.

@param string $googleKey
@param string $pageUrl
@param array $extra              # Captcha options
@return string                   # Code to place in hidden form
@throws ErrorResponseException
@throws InvalidArgumentException
@throws RuntimeException
@throws \GuzzleHttp\Exception\GuzzleException