Google ReCaptcha with pxp

chicos aca les dejo como integrar el google recaptcha con el pxp

function insertarPedidoImportacion(){
//g-recaptcha-response
$url = "https://www.google.com/recaptcha/api/siteverify";
$privateKey = "your-sitekey";
$res_captcha = $this->objParam->getParametro('captcha');
$response = file_get_contents($url . "?secret=" . $privateKey . "&response=" . $res_captcha);
$data = json_decode($response);
if (isset($data->success) and $data->success == true) {
$this->objFunc=$this->create('MODFormularioSolicitudPedido');
$this->res=$this->objFunc->insertarPedidoImportacion($this->objParam);
$this->res->imprimirRespuesta($this->res->generarJson());
}else{
echo "eres un robot";
}
}
This discussion has been closed.