From 2d1e9f820c38c3a7626d0ef4660dbf3d20fadc30 Mon Sep 17 00:00:00 2001 From: Akolzin Dmitry Date: Wed, 28 Feb 2018 17:02:13 +0300 Subject: [PATCH] Fix session for api methods --- Changelog.md | 4 ++++ catalog/controller/api/retailcrm.php | 10 +++++----- system/library/retailcrm/OpencartApiClient.php | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Changelog.md b/Changelog.md index f56d422..5433943 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,7 @@ +## v.2.0.4 +* Улучшена механика выгрузки изменений из RetailCRM +* Улучшена механика выборки и настройки способов доставки + ## v.2.0.3 * Улучшена механика выгрузки изменений из RetailCRM * Улучшена механика выборки и настройки способов доставки diff --git a/catalog/controller/api/retailcrm.php b/catalog/controller/api/retailcrm.php index 202670a..ee3fa27 100644 --- a/catalog/controller/api/retailcrm.php +++ b/catalog/controller/api/retailcrm.php @@ -124,17 +124,17 @@ class ControllerApiRetailcrm extends Controller private function auth() { if (version_compare(VERSION, '2.1.0', '>=')) { - if (!isset($this->request->get['token']) - || !$this->request->get['token'] + if (!isset($this->request->get['key']) + || !$this->request->get['key'] ) { return array('error' => 'Not found api key'); } - if (isset($this->request->get['token']) - && !empty($this->request->get['token']) + if (isset($this->request->get['key']) + && !empty($this->request->get['key']) ) { $this->load->model('account/api'); - $api = $this->model_account_api->getApiByKey($this->request->get['token']); + $api = $this->model_account_api->getApiByKey($this->request->get['key']); if (!empty($api)) { return $api; diff --git a/system/library/retailcrm/OpencartApiClient.php b/system/library/retailcrm/OpencartApiClient.php index f1a8a30..63a0557 100644 --- a/system/library/retailcrm/OpencartApiClient.php +++ b/system/library/retailcrm/OpencartApiClient.php @@ -44,7 +44,7 @@ class OpencartApiClient { $opencartStoreInfo = $this->model_setting_store->getStore($this->opencartStoreId); if (version_compare(VERSION, '2.1.0', '>=') && !empty($this->apiToken)) { - $getParams['token'] = $this->apiToken; + $getParams['key'] = $this->apiToken; } elseif (is_array($this->apiToken) && isset($this->apiToken['username'])) { $getParams = $this->apiToken; }