mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 17:14:31 -04:00
Merge pull request #8877 from turbo124/v5-develop
Minor fixes for paytrace
This commit is contained in:
commit
ec69541e29
@ -140,7 +140,7 @@ class AccountTransformer implements AccountTransformerInterface
|
|||||||
'id' => $account->id,
|
'id' => $account->id,
|
||||||
'account_type' => $account->CONTAINER,
|
'account_type' => $account->CONTAINER,
|
||||||
// 'account_name' => $account->accountName,
|
// '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_status' => $account_status,
|
||||||
'account_number' => property_exists($account, 'accountNumber') ? '**** ' . substr($account?->accountNumber, -7) : '',
|
'account_number' => property_exists($account, 'accountNumber') ? '**** ' . substr($account?->accountNumber, -7) : '',
|
||||||
'provider_account_id' => $account->providerAccountId,
|
'provider_account_id' => $account->providerAccountId,
|
||||||
|
@ -183,7 +183,7 @@ class CreditCard
|
|||||||
|
|
||||||
$response = $this->paytrace->gatewayRequest('/v1/transactions/sale/by_customer', $data);
|
$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);
|
$this->paytrace->logSuccessfulGatewayResponse(['response' => $response, 'data' => $this->paytrace->payment_hash], SystemLog::TYPE_PAYTRACE);
|
||||||
|
|
||||||
return $this->processSuccessfulPayment($response);
|
return $this->processSuccessfulPayment($response);
|
||||||
|
@ -198,7 +198,7 @@ class PaytracePaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
$auth_data = json_decode($response);
|
$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');
|
throw new SystemError('Error authenticating with PayTrace');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user