Skip to content

Commit

Permalink
refactor: add condition before register route
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubersilva committed Jan 24, 2025
1 parent c91ce8b commit fa2ffe0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Framework/PaymentGateways/Webhooks/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ class Webhook

public function __construct(PaymentGateway &$paymentGateway)
{
$paymentGateway->routeMethods[] = $this->webhookNotificationsListener;
if ($this->paymentGateway->canListeningWebhookNotifications()) {
$paymentGateway->routeMethods[] = $this->webhookNotificationsListener;
}

$this->paymentGateway = &$paymentGateway;
$this->events = new WebhookEvents($paymentGateway::id());
}
Expand Down

0 comments on commit fa2ffe0

Please sign in to comment.