private function _verifyResponse($recaptchaResponse)
    {
        $data = http_build_query(array(
                'secret' => $this->_params->get('secret-key'),
                'response' => $recaptchaResponse
            )
        );

        $options = array('http' => array(
                'method'  => 'POST',
                'header'  => 'Content-type: application/x-www-form-urlencoded',
                'content' => $data
            )
        );

        $context = stream_context_create($options);
        $response = file_get_contents('https://www.google.com/recaptcha/api/siteverify', false, $context);
        $result = json_decode($response);

        return (bool) $result->success;
    }
private function _verifyResponse($recaptchaResponse)
    {
        $data = http_build_query(array(
                'secret' => $this->_params->get('secret-key'),
                'response' => $recaptchaResponse
            )
        );

        $options = array('http' => array(
                'method'  => 'POST',
                'header'  => 'Content-type: application/x-www-form-urlencoded',
                'content' => $data
            )
        );

        $context = stream_context_create($options);
        $response = file_get_contents('https://www.google.com/recaptcha/api/siteverify', false, $context);
        $result = json_decode($response);

        return (bool) $result->success;
    }
private function _verifyResponse ( $ recaptchaResponse ) { $ data = http_build_query ( array ( 'secret' => $ this -> _params -> get ( 'secret-key' ) , 'response' => $ recaptchaResponse ) ) ; $ options = array ( 'http' => array ( 'method' => 'POST' , 'header' => 'Content-type: application/x-www-form-urlencoded' , 'content' => $ data ) ) ; $ context = stream_context_create ( $ options ) ; $ response = file_get_contents ( 'https://www.google.com/recaptcha/api/siteverify' , false , $ context ) ; $ result = json_decode ( $ response ) ; return ( bool ) $ result -> success ; }
Verifies the request reCaptcha token against the reCaptcha API

@return boolean
Verifies the request reCaptcha token against the reCaptcha API