$config = [
"certificate" => realpath("certs/producao/certificado.pem")
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "
https://api-pix.gerencianet.com.br/v2/webhook/".$chave_pix,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_SSLCERT => $config["certificate"], // Caminho do certificado
CURLOPT_SSLCERTPASSWD => "",
CURLOPT_POSTFIELDS =>'{
"webhookUrl": "
https://webhook.com/webhook"
}',
CURLOPT_HTTPHEADER => array(
'authorization: Bearer '.$access_token,
'x-skip-mtls-checking: false',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
$options = json_decode($response, true);
if ($response === FALSE){
$curl_error = curl_error($curl);
}
curl_close($curl);
echo $response;