From f49faf8f161073d539e8dd5c4899e450612b6724 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 11 Dec 2020 08:10:50 +1100 Subject: [PATCH] Fix for custom gateway query --- app/Models/Client.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/Models/Client.php b/app/Models/Client.php index 43194b30760c..35ba155cef61 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -484,9 +484,10 @@ class Client extends BaseModel implements HasLocalePreference //** Plucks the remaining keys into its own collection $payment_methods_intersect = $payment_methods_collections->intersectByKeys($payment_methods_collections->flatten(1)->unique()); - //handle custom gateways which are not unique'd() - - //we need to check for "0" here as we disable a payment gateway for a client with the number "0" + // handle custom gateways as they are not unique'd()--------------------------------------------------------- + // we need to split the query here as we allow multiple custom gateways, so we must show all of them, they query logic + // above only pulls in unique gateway types.. ie.. we only allow 1 credit card gateway, but many custom gateways. + if ($company_gateways || $company_gateways == '0') { $transformed_ids = $this->transformKeys(explode(',', $company_gateways)); $gateways = $this->company @@ -516,10 +517,7 @@ class Client extends BaseModel implements HasLocalePreference } } - //handle custom gateways which are not unique'd() - - - + //handle custom gateways as they are not unique'd()--------------------------------------------------------- $payment_urls = [];