From c14a661174fa2b8ec0ef48ab0ba143609fd747de Mon Sep 17 00:00:00 2001 From: kruglov Date: Thu, 4 Jul 2013 15:21:23 +0400 Subject: [PATCH] fix #15624 orderType methods added; composer.json, README.md fixed --- lib/{IntaroCrmRestApi.php => RestApi.php} | 34 ++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) rename lib/{IntaroCrmRestApi.php => RestApi.php} (90%) diff --git a/lib/IntaroCrmRestApi.php b/lib/RestApi.php similarity index 90% rename from lib/IntaroCrmRestApi.php rename to lib/RestApi.php index 1fa0b48..9a46c43 100644 --- a/lib/IntaroCrmRestApi.php +++ b/lib/RestApi.php @@ -1,6 +1,6 @@ apiUrl.'reference/order-types'; + $result = $this->curlRequest($url); + return $result; + } + + /** + * Редактирование типа заказа + * + * @param array $paymentType - информация о типе заказа + * @return array + */ + public function orderTypesEdit($orderType) + { + $dataJson = json_encode($orderType); + $dataJson = str_replace(self::$jsonReplaceSource, self::$jsonReplaceTarget, + $dataJson); + $parameters = array(); + $parameters['orderType'] = $dataJson; + + $url = $this->apiUrl.'order-types/'.$paymentType['code'].'/edit'; + $result = $this->curlRequest($url, $parameters, 'POST'); + return $result; + } + + protected function curlRequest($url, $parameters = null, $method = 'GET', $format = 'json')