Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 5.5.0-b1
-
Component/s: None
-
Labels:None
Description
To reproduce
- Enable error reporting
- Create a CC account on a client
- Start an order and move to checkout
- Try to pay with the cc account
- View the error log file
- See the following error
[2022-05-27T17:09:30.609300+00:00] general.ERROR: UnknownException: Trying to get property 'status' of non-object in F:\wamp\www\blesta-5.0\public_html\plugins\order\controllers\checkout.php:892 Stack trace: #0 F:\wamp\www\blesta-5.0\public_html\vendors\monolog\monolog\src\Monolog\ErrorHandler.php(200): UnknownException::setErrorHandler(8, 'Trying to get p...', 'F:\\wamp\\www
ble...', 892, Array) #1 F:\wamp\www\blesta-5.0\public_html\plugins\order\controllers\checkout.php(892): Monolog\ErrorHandler->handleError(8, 'Trying to get p...', 'F:\\wamp\\www
ble...', 892, Array) #2 F:\wamp\www\blesta-5.0\public_html\plugins\order\controllers\checkout.php(789): Checkout->authorizePayment(Array, Array, '2.0300') #3 F:\wamp\www\blesta-5.0\public_html\vendors\minphp\bridge\src\Lib\Dispatcher.php(142): Checkout->getPaymentConfirmation() #4 F:\wamp\www\blesta-5.0\public_html\index.php(21): Dispatcher::dispatch('/blesta-5.0/pub...') #5 {main}
To resolve change plugins/order/controller/checkout.php around line 889:
if ($gateway_obj instanceof MerchantAchVerification && !empty($account_id)) { $account = $this->Accounts->getAch($account_id); if ($account->status == 'unverified') { $response['redirect'] = $this->client_uri . 'accounts/verifyach/' . $account_id . '/'; return $response; } }
To
if ($type == 'ach' && $gateway_obj instanceof MerchantAchVerification && !empty($account_id) && ($account = $this->Accounts->getAch($account_id)) && $account->status == 'unverified' ) { $response['redirect'] = $this->client_uri . 'accounts/verifyach/' . $account_id . '/'; return $response; }