From 9ff3f10866288d031801618aa4c7b3579072aa71 Mon Sep 17 00:00:00 2001 From: Frosin Date: Thu, 4 Jul 2019 09:43:59 +0300 Subject: [PATCH] fixed incorrect response processing bug in RetailcrmHistory --- retailcrm/lib/RetailcrmHistory.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/retailcrm/lib/RetailcrmHistory.php b/retailcrm/lib/RetailcrmHistory.php index 7339e03..b4d7700 100644 --- a/retailcrm/lib/RetailcrmHistory.php +++ b/retailcrm/lib/RetailcrmHistory.php @@ -23,7 +23,7 @@ class RetailcrmHistory $history = self::$api->customersHistory($filter); - if ($history->isSuccessful() && count($history->history)) { + if ($history && count($history->history)) { $historyChanges = $history->history; $end = end($historyChanges); $sinceid = $end['id']; @@ -167,7 +167,7 @@ class RetailcrmHistory $orderFix = array(); $history = self::$api->ordersHistory($filter); - if ($history->isSuccessful() && count($history->history) > 0) { + if ($history && count($history->history) > 0) { $historyChanges = $history->history; $end = end($historyChanges); $sinceId = $end['id']; @@ -187,7 +187,7 @@ class RetailcrmHistory if (!array_key_exists('externalId', $order_history)) { $responce = self::$api->ordersGet($order_history['id'], 'id'); - if ($responce->isSuccessful()) { + if ($responce) { $order = $responce['order']; } else { continue;