From 2193da9f6f57eb6a205754a1687d235481107411 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 24 Sep 2024 09:21:44 +1000 Subject: [PATCH] Fixes for gateway id --- app/PaymentDrivers/CBAPowerBoard/Settings.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/PaymentDrivers/CBAPowerBoard/Settings.php b/app/PaymentDrivers/CBAPowerBoard/Settings.php index 4feab6ab573d..e934566e1904 100644 --- a/app/PaymentDrivers/CBAPowerBoard/Settings.php +++ b/app/PaymentDrivers/CBAPowerBoard/Settings.php @@ -66,12 +66,7 @@ class Settings default => $type = self::GATEWAY_CBA, }; - if($type == self::GATEWAY_CBA && strlen($this->powerboard->company_gateway->getConfigField('gatewayId') ?? '') > 1){ - return $this->powerboard->company_gateway->getConfigField('gatewayId'); - } - return $this->getGatewayByType($type); - } private function getGatewayByType(string $gateway_type_const): mixed @@ -92,6 +87,11 @@ class Settings public function getGatewayId(int $gateway_type_id): string { + + if ($gateway_type_id == GatewayType::CREDIT_CARD && strlen($this->powerboard->company_gateway->getConfigField('gatewayId') ?? '') > 1) { + return $this->powerboard->company_gateway->getConfigField('gatewayId'); + } + $gateway = $this->getPaymentGatewayConfiguration($gateway_type_id); return $gateway->_id;