diff --git a/CHANGELOG.md b/CHANGELOG.md index a38232a..ef2d471 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ## v3.6.12 -* Добавлена передача версий модуля, php и cms в get-запросах к CRM +* Добавлена передача дополнительных параметров в GET запросах ## v3.6.11 * Добавлены подсказки в настройках модуля diff --git a/retailcrm/lib/api/RetailcrmHttpClient.php b/retailcrm/lib/api/RetailcrmHttpClient.php index 4475ada..ea93a31 100644 --- a/retailcrm/lib/api/RetailcrmHttpClient.php +++ b/retailcrm/lib/api/RetailcrmHttpClient.php @@ -43,7 +43,6 @@ class RetailcrmHttpClient protected $url; protected $defaultParameters; - protected $versionData; /** * Client constructor. @@ -62,13 +61,7 @@ class RetailcrmHttpClient } $this->url = $url; - $this->defaultParameters = $defaultParameters; - $this->versionData = [ - 'php_version' => function_exists('phpversion') ? phpversion() : '', - 'cms_source' => 'PrestaShop', - 'module_version' => RetailCRM::VERSION, - 'cms_version' => _PS_VERSION_ - ]; + $this->defaultParameters = $defaultParameters; } /** @@ -113,11 +106,14 @@ class RetailcrmHttpClient ); } - if (self::METHOD_GET === $method) { - $parameters = array_merge($this->defaultParameters, $parameters, $this->versionData); - } else { - $parameters = array_merge($this->defaultParameters, $parameters); - } + $parameters = self::METHOD_GET === $method + ? array_merge($this->defaultParameters, $parameters, [ + 'php_version' => function_exists('phpversion') ? phpversion() : '', + 'cms_source' => 'PrestaShop', + 'module_version' => RetailCRM::VERSION, + 'cms_version' => _PS_VERSION_, + ]) + : $parameters = array_merge($this->defaultParameters, $parameters); $url = $this->url . $path;