From 92324b4a202acccc13a4a40d1a3b5723d328373d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 6 Nov 2023 17:41:20 +1100 Subject: [PATCH] Updates for checking payment gateway status --- app/PaymentDrivers/PayPalPPCPPaymentDriver.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/PaymentDrivers/PayPalPPCPPaymentDriver.php b/app/PaymentDrivers/PayPalPPCPPaymentDriver.php index 4764c3b07f23..c5f3da42343a 100644 --- a/app/PaymentDrivers/PayPalPPCPPaymentDriver.php +++ b/app/PaymentDrivers/PayPalPPCPPaymentDriver.php @@ -195,10 +195,15 @@ class PayPalPPCPPaymentDriver extends BaseDriver private function checkPaymentsReceivable(): self { - - if(!$this->company_gateway->getConfigField('payments_receivable')) + + if($this->company_gateway->getConfigField('email_verified') != 'true' || + $this->company_gateway->getConfigField('payments_receivable') != 'Yes' || + $this->company_gateway->getConfigField('consent') != 'true' || + $this->company_gateway->getConfigField('permissions') != 'true' + ){ throw new PaymentFailed('Unable to accept payments at this time, please contact PayPal for more information.', 401); - + } + return $this; }