1
0
Fork 0
mirror of synced 2025-04-04 14:23:33 +03:00

Краткая запись тернарных операторов и проверка на принадлежность классу

This commit is contained in:
anton 2024-09-23 16:14:42 +03:00
parent c4fdfffc9b
commit 3cc89dcc62

View file

@ -472,12 +472,12 @@ class RetailCrmOrder
$crmBasket = RCrmActions::apiMethod($api, 'cartGet', __METHOD__, $externalId, $site);
$orderResponse = $client->createOrder($order, $site);
if ($orderResponse->success === false) {
if ($orderResponse instanceof OrdersCreateResponse && $orderResponse->success !== true) {
Logger::getInstance()->write([
'methodApi' => 'orderCreate',
'errorMsg' => !empty($orderResponse->errorMsg) ? $orderResponse->errorMsg : '',
'errors' => !empty($orderResponse->errors) ? $orderResponse->errors : '',
'errorMsg' => $orderResponse->errorMsg ?? '',
'errors' => $orderResponse->errors ?? '',
'params' => ['number' => $order['number'], 'externalId' => $order['externalId']]
], 'apiErrors');