consegue me ajudar?
public function setupWebhook($webhookUrl)
{
$data = [
"webhookUrl" => $webhookUrl
];
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://pix-h.api.efipay.com.br/v2/webhook/' . $this->getClientKeyPix(),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer {$this->getClientKeyPix()}",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$error = curl_error($curl);
curl_close($curl);
if ($error) {
throw new \Exception("Erro ao configurar o webhook: $error");
}
return json_decode($response, true);
}
consegue me dizer se essa requisição para configurar o webhook esta correta?