From 2c6cccc3b16faaec4a8d8d38396274daa0a30ee1 Mon Sep 17 00:00:00 2001 From: ellynoize <111681973+ellynoize@users.noreply.github.com> Date: Mon, 14 Oct 2024 20:26:34 +0600 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B0=D1=87=D0=B0?= =?UTF-8?q?=20=D0=B4=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8=D1=82=D0=B5=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D1=8B=D1=85=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=B2=20=D0=B2=20GET=20=D0=B7=D0=B0=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=81=D0=B0=D1=85=20=20(#267)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ VERSION | 2 +- .../controller/extension/module/retailcrm.php | 2 +- .../retailcrm/lib/api/RetailcrmHttpClient.php | 15 ++++++++++++--- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27ae50c..1dbaa6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## v4.1.17 +* Added additional parameters to GET requests. + ## v4.1.16 * Support for services in ICML diff --git a/VERSION b/VERSION index 1b94a07..73274fd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.16 +4.1.17 diff --git a/src/upload/admin/controller/extension/module/retailcrm.php b/src/upload/admin/controller/extension/module/retailcrm.php index d664c75..9d5741d 100644 --- a/src/upload/admin/controller/extension/module/retailcrm.php +++ b/src/upload/admin/controller/extension/module/retailcrm.php @@ -2,7 +2,7 @@ class ControllerExtensionModuleRetailcrm extends Controller { - const VERSION_MODULE = '4.1.16'; + const VERSION_MODULE = '4.1.17'; private $_error = []; protected $log, $statuses, $payments, $deliveryTypes, $retailcrmApiClient, $moduleTitle, $tokenTitle; diff --git a/src/upload/system/library/retailcrm/lib/api/RetailcrmHttpClient.php b/src/upload/system/library/retailcrm/lib/api/RetailcrmHttpClient.php index 268596a..4452fcd 100644 --- a/src/upload/system/library/retailcrm/lib/api/RetailcrmHttpClient.php +++ b/src/upload/system/library/retailcrm/lib/api/RetailcrmHttpClient.php @@ -46,9 +46,9 @@ class RetailcrmHttpClient public function makeRequest( $path, $method, - array $parameters = array() + array $parameters = [] ) { - $allowedMethods = array(self::METHOD_GET, self::METHOD_POST); + $allowedMethods = [self::METHOD_GET, self::METHOD_POST]; if (!in_array($method, $allowedMethods, false)) { throw new \InvalidArgumentException( @@ -60,7 +60,16 @@ class RetailcrmHttpClient ); } - $parameters = array_merge($this->defaultParameters, $parameters); + + $parameters = self::METHOD_GET === $method + ? array_merge($this->defaultParameters, $parameters, [ + 'cms_source' => 'OpenCart', + 'cms_version' => VERSION, + 'php_version' => function_exists('phpversion') ? phpversion() : '', + 'module_version' => ControllerExtensionModuleRetailcrm::VERSION_MODULE, + ]) + : $parameters = array_merge($this->defaultParameters, $parameters); + $url = $this->url . $path;