Merge pull request #8877 from turbo124/v5-develop

Minor fixes for paytrace
This commit is contained in:
David Bomba 2023-10-15 17:22:52 +11:00 committed by GitHub
commit ec69541e29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -140,7 +140,7 @@ class AccountTransformer implements AccountTransformerInterface
'id' => $account->id,
'account_type' => $account->CONTAINER,
// 'account_name' => $account->accountName,
'account_name' => property_exists($account, 'accountName') ? $account->accountName : $account->nickname,
'account_name' => property_exists($account, 'accountName') ? $account->accountName : ($account->nickname ?? 'Unknown Account'),
'account_status' => $account_status,
'account_number' => property_exists($account, 'accountNumber') ? '**** ' . substr($account?->accountNumber, -7) : '',
'provider_account_id' => $account->providerAccountId,

View File

@ -183,7 +183,7 @@ class CreditCard
$response = $this->paytrace->gatewayRequest('/v1/transactions/sale/by_customer', $data);
if ($response->success) {
if ($response->success ?? false) {
$this->paytrace->logSuccessfulGatewayResponse(['response' => $response, 'data' => $this->paytrace->payment_hash], SystemLog::TYPE_PAYTRACE);
return $this->processSuccessfulPayment($response);

View File

@ -198,7 +198,7 @@ class PaytracePaymentDriver extends BaseDriver
$auth_data = json_decode($response);
if (! property_exists($auth_data, 'access_token')) {
if (!isset($auth_data) || ! property_exists($auth_data, 'access_token')) {
throw new SystemError('Error authenticating with PayTrace');
}