From 1624dc9a42957f1da383db48ac138afed34d2eb6 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 5 Aug 2021 22:30:22 +1000 Subject: [PATCH] Fixes for ghost company gateways --- app/Services/Client/PaymentMethod.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Services/Client/PaymentMethod.php b/app/Services/Client/PaymentMethod.php index 989a185e7016..aaf79c4a95d7 100644 --- a/app/Services/Client/PaymentMethod.php +++ b/app/Services/Client/PaymentMethod.php @@ -74,6 +74,8 @@ class PaymentMethod ->company ->company_gateways ->whereIn('id', $transformed_ids) + ->where('is_deleted', false) + ->whereNull('deleted_at') ->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa') ->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority return array_search($model->id, $transformed_ids);// this closure sorts for us @@ -85,6 +87,7 @@ class PaymentMethod ->company ->company_gateways ->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa') + ->whereNull('deleted_at') ->where('is_deleted', false); } @@ -107,6 +110,8 @@ class PaymentMethod ->company ->company_gateways ->whereIn('id', $transformed_ids) + ->where('is_deleted', false) + ->whereNull('deleted_at') ->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa') ->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority return array_search($model->id, $transformed_ids);// this closure sorts for us @@ -118,6 +123,7 @@ class PaymentMethod ->company ->company_gateways ->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa') + ->whereNull('deleted_at') ->where('is_deleted', false); }