From df42c16be7e75aea1987e2d8edccdde80d259b1f Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 19 Aug 2021 09:14:53 +1000 Subject: [PATCH] Fixes for google analytics --- app/Listeners/Payment/PaymentNotification.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;