From 7657ae434a857d05eb985d07be2ba79699590d78 Mon Sep 17 00:00:00 2001 From: Grisha Pomadchin Date: Sat, 22 Mar 2014 15:08:51 +0400 Subject: [PATCH] api class fix --- intaro.intarocrm/classes/general/RestApi.php | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/intaro.intarocrm/classes/general/RestApi.php b/intaro.intarocrm/classes/general/RestApi.php index c7f8ce81..9576d9e7 100644 --- a/intaro.intarocrm/classes/general/RestApi.php +++ b/intaro.intarocrm/classes/general/RestApi.php @@ -283,6 +283,34 @@ class RestApi return $result; } + /** + * Получение списка служб доставки + * + * @return array - массив типов доставки + */ + public function deliveryServicesList() + { + $url = $this->apiUrl.'reference/delivery-services'; + $result = $this->curlRequest($url); + return $result; + } + + /** + * Редактирование службы доставки + * + * @param array $deliveryService - информация о типе доставки + * @return array + */ + public function deliveryServiceEdit($deliveryService) + { + $dataJson = json_encode($deliveryService); + $this->parameters['deliveryService'] = $dataJson; + + $url = $this->apiUrl.'reference/delivery-services/'.$deliveryService['code'].'/edit'; + $result = $this->curlRequest($url, 'POST'); + return $result; + } + /** * Получение списка типов оплаты