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;