Meu Webhook: public function webhook() {
$body = '{
"webhookUrl": "https://julioerp.agenciaweblab.com.br/webhook.php"
}';
try {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->config['rotas'] . '/v2/webhook/' . $this->config['chave_pix']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_SSLCERT, $this->config["certificado"]);
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, '');
$headers = array();
$headers[] = 'Authorization: Basic ' . $this->access_token;
$headers[] = 'X-Skip-Mtls-Checking: true';
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo '
';
var_dump($this->config['chave_pix'], $this->config['client_id'], $this->config['client_secret'], $result);
echo '
';
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
return $result;
} catch (Exception $e) {
echo '
';
var_dump($e->getCode(), $e->getFile(), $e->getMessage());
echo '
';
}
}