$config = [
"certificado" => $this->pixCert,
// "certificado" => DIRPAGE."src/Includes/olimppiuspix.crt.pem",
// "certificado" => "",
"client_id" => $this->clientId,
"client_secret" => $this->clientSecret
];
$autorizacao = base64_encode($config["client_id"] . ":" . $config["client_secret"]);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-pix-h.gerencianet.com.br/v2/webhook/',
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_POSTFIELDS =>'{
"webhookUrl": "https://olimppi.us/webhook/index.php"
}',
CURLOPT_HTTPHEADER => array(
// "authorization: {{Authorization}}",
"Authorization: Basic $autorizacao",
"Content-Type: application/json",
"x-client-cert-pem: {{X-Certificate-Pem}}",
"x-skip-mtls-checking: false"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo "
";
echo $response;
echo "
";