diff --git a/app/Listeners/Payment/PaymentNotification.php b/app/Listeners/Payment/PaymentNotification.php index 3c3ff8b8635b..c23346341139 100644 --- a/app/Listeners/Payment/PaymentNotification.php +++ b/app/Listeners/Payment/PaymentNotification.php @@ -80,7 +80,7 @@ class PaymentNotification implements ShouldQueue private function trackRevenue($event) { $payment = $event->payment; - $invoice = $payment->invoice; + $invoice = $payment->invoices()->exists() ? $payment->invoices->first() : false; $company = $payment->company; $analytics_id = $company->google_analytics_key;