From c908a8cc8fff56313be91c621f8a0fcc19154dfc Mon Sep 17 00:00:00 2001 From: Kruglov Kirill Date: Thu, 18 Jul 2013 15:39:52 +0400 Subject: [PATCH] fix #15896 delete methods are removed. orderFixExternalIds method added. --- lib/IntaroCrm/RestApi.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/IntaroCrm/RestApi.php b/lib/IntaroCrm/RestApi.php index 7eb8eb2..621c2bd 100644 --- a/lib/IntaroCrm/RestApi.php +++ b/lib/IntaroCrm/RestApi.php @@ -140,6 +140,24 @@ class RestApi return $result; } + /** + * Обновление externalId у заказов с переданными id + * + * @param array $orders- массив, содержащий id и externalId заказа + * @return array + */ + public function orderFixExternalIds($order) + { + $dataJson = json_encode($order); + $dataJson = str_replace(self::$jsonReplaceSource, self::$jsonReplaceTarget, + $dataJson); + $this->parameters['orders'] = $dataJson; + + $url = $this->apiUrl.'orders/fix-external-ids'; + $result = $this->curlRequest($url, 'POST'); + return $result; + } + /** * Удаление заказа * @@ -147,6 +165,7 @@ class RestApi * @param string $by - поиск заказа по id или externalId * @return array */ + /* public function orderDelete($id, $by = 'externalId') { $url = $this->apiUrl.'orders/'.$id.'/delete'; @@ -154,7 +173,7 @@ class RestApi $this->parameters['by'] = $by; $result = $this->curlRequest($url, 'POST'); return $result; - } + }*/ /** * Получение последних измененных заказов @@ -238,6 +257,7 @@ class RestApi * @param string $by - поиск заказа по id или externalId * @return array */ + /* public function customerDelete($id, $by = 'externalId') { $url = $this->apiUrl.'customers/'.$id.'/delete'; @@ -245,7 +265,7 @@ class RestApi $this->parameters['by'] = $by; $result = $this->curlRequest($url, 'POST'); return $result; - } + }*/ /** * Получение списка заказов клиента