diff --git a/app/PaymentDrivers/CheckoutCom/Utilities.php b/app/PaymentDrivers/CheckoutCom/Utilities.php index 3c9caef92b25..f8e960fe56c2 100644 --- a/app/PaymentDrivers/CheckoutCom/Utilities.php +++ b/app/PaymentDrivers/CheckoutCom/Utilities.php @@ -87,9 +87,9 @@ trait Utilities $error_message = ''; - if (array_key_exists('actions', $_payment) && array_key_exists('response_summary', end($_payment['actions']))) { + if (is_array($_payment) && array_key_exists('actions', $_payment) && array_key_exists('response_summary', end($_payment['actions']))) { $error_message = end($_payment['actions'])['response_summary']; - } elseif (array_key_exists('status', $_payment)) { + } elseif (is_array($_payment) && array_key_exists('status', $_payment)) { $error_message = $_payment['status']; } diff --git a/app/PaymentDrivers/CheckoutComPaymentDriver.php b/app/PaymentDrivers/CheckoutComPaymentDriver.php index 9e19ac2fe6bb..6801d8f0ff41 100644 --- a/app/PaymentDrivers/CheckoutComPaymentDriver.php +++ b/app/PaymentDrivers/CheckoutComPaymentDriver.php @@ -438,7 +438,7 @@ class CheckoutComPaymentDriver extends BaseDriver $this->init(); $this->setPaymentHash($request->getPaymentHash()); - //11-08-2022 check the user is autenticated + //11-08-2022 check the user is authenticated if (!Auth::guard('contact')->check()) { $client = $request->getClient(); auth()->guard('contact')->loginUsingId($client->contacts()->first()->id, true); @@ -455,6 +455,8 @@ class CheckoutComPaymentDriver extends BaseDriver return $this->processUnsuccessfulPayment($payment); } } catch (CheckoutApiException | Exception $e) { + nlog("checkout"); + nlog($e->getMessage()); return $this->processInternallyFailedPayment($this, $e); } }