get('/myAccount'); } /** * Registra o webhook na conta da unidade e retorna o id criado. */ public function register(string $apiKey): string { $client = new AsaasClient($apiKey); $response = $client->post('/webhooks', [ 'name' => 'Ginástica do Cérebro', 'url' => config('services.asaas.webhook_url'), 'email' => config('mail.from.address'), 'enabled' => true, 'interrupted' => false, 'authToken' => config('services.asaas.webhook_token'), 'sendType' => 'SEQUENTIALLY', 'events' => self::EVENTS, ]); return $response['id']; } /** * Remove o webhook da conta da unidade (best-effort). */ public function delete(string $apiKey, string $webhookId): void { $client = new AsaasClient($apiKey); $client->delete("/webhooks/{$webhookId}"); } }