From 8c4fecaa2c7175b324f7a44d2d34da64bb1dca99 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 11 May 2021 21:47:19 +1000 Subject: [PATCH] enforce object over array --- app/Services/Client/PaymentMethod.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/Client/PaymentMethod.php b/app/Services/Client/PaymentMethod.php index b235aad129f2..930369787ff0 100644 --- a/app/Services/Client/PaymentMethod.php +++ b/app/Services/Client/PaymentMethod.php @@ -136,7 +136,7 @@ class PaymentMethod foreach ($gateway->driver($this->client)->gatewayTypes() as $type) { - if (isset($gateway->fees_and_limits) && property_exists($gateway->fees_and_limits, $type)) { + if (isset($gateway->fees_and_limits) && is_object($gateway->fees_and_limits) && property_exists($gateway->fees_and_limits, $type)) { if ($this->validGatewayForAmount($gateway->fees_and_limits->{$type}, $this->amount) && $gateway->fees_and_limits->{$type}->is_enabled) { @@ -165,7 +165,7 @@ class PaymentMethod foreach ($gateway->driver($this->client)->gatewayTypes() as $type) { - if (isset($gateway->fees_and_limits) && property_exists($gateway->fees_and_limits, $type)) { + if (isset($gateway->fees_and_limits) && is_object($gateway->fees_and_limits) && property_exists($gateway->fees_and_limits, $type)) { if ($this->validGatewayForAmount($gateway->fees_and_limits->{GatewayType::CREDIT_CARD}, $this->amount)) $this->payment_methods[] = [$gateway->id => $type];