Update payment notifications

This commit is contained in:
David Bomba 2023-03-28 07:36:22 +11:00
parent 0472cb97f8
commit fb4a4ac126

View File

@ -39,7 +39,6 @@ class PaymentNotification implements ShouldQueue
* Handle the event. * Handle the event.
* *
* @param object $event * @param object $event
* @return bool
*/ */
public function handle($event) public function handle($event)
{ {
@ -51,6 +50,15 @@ class PaymentNotification implements ShouldQueue
$payment = $event->payment; $payment = $event->payment;
/*Google Analytics Track Revenue*/
if (isset($payment->company->google_analytics_key)) {
$this->trackRevenue($event);
}
if($payment->is_manual)
return;
/*User notifications*/ /*User notifications*/
foreach ($payment->company->company_users as $company_user) { foreach ($payment->company->company_users as $company_user) {
$user = $company_user->user; $user = $company_user->user;
@ -80,10 +88,6 @@ class PaymentNotification implements ShouldQueue
} }
} }
/*Google Analytics Track Revenue*/
if (isset($payment->company->google_analytics_key)) {
$this->trackRevenue($event);
}
} }
private function trackRevenue($event) private function trackRevenue($event)