Additional logging for Checkout transactions

This commit is contained in:
David Bomba 2022-11-11 15:16:03 +11:00
parent a87b8d1e99
commit 569fa064e3
2 changed files with 5 additions and 3 deletions

View File

@ -87,9 +87,9 @@ trait Utilities
$error_message = ''; $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']; $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']; $error_message = $_payment['status'];
} }

View File

@ -438,7 +438,7 @@ class CheckoutComPaymentDriver extends BaseDriver
$this->init(); $this->init();
$this->setPaymentHash($request->getPaymentHash()); $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()) { if (!Auth::guard('contact')->check()) {
$client = $request->getClient(); $client = $request->getClient();
auth()->guard('contact')->loginUsingId($client->contacts()->first()->id, true); auth()->guard('contact')->loginUsingId($client->contacts()->first()->id, true);
@ -455,6 +455,8 @@ class CheckoutComPaymentDriver extends BaseDriver
return $this->processUnsuccessfulPayment($payment); return $this->processUnsuccessfulPayment($payment);
} }
} catch (CheckoutApiException | Exception $e) { } catch (CheckoutApiException | Exception $e) {
nlog("checkout");
nlog($e->getMessage());
return $this->processInternallyFailedPayment($this, $e); return $this->processInternallyFailedPayment($this, $e);
} }
} }