Skip to content

Commit

Permalink
Добавлена передача дополнительных параметров в GET запросах (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellynoize authored Oct 14, 2024
1 parent c893cf2 commit 2c6cccc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v4.1.17
* Added additional parameters to GET requests.

## v4.1.16
* Support for services in ICML

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.16
4.1.17
2 changes: 1 addition & 1 deletion src/upload/admin/controller/extension/module/retailcrm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public function __construct($url, array $defaultParameters = array())
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(
Expand All @@ -60,7 +60,16 @@ public function makeRequest(
);
}

$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;

Expand Down

0 comments on commit 2c6cccc

Please sign in to comment.