mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-21 12:46:06 +03:00
Добавлена передача дополнительных параметров в GET запросах (#267)
This commit is contained in:
parent
c893cf24fb
commit
2c6cccc3b1
@ -1,3 +1,6 @@
|
||||
## v4.1.17
|
||||
* Added additional parameters to GET requests.
|
||||
|
||||
## v4.1.16
|
||||
* Support for services in ICML
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user