From 273499acdce84c9c0c2478adc231c243a886bac7 Mon Sep 17 00:00:00 2001 From: Akolzin Dmitry Date: Thu, 25 Oct 2018 11:30:05 +0300 Subject: [PATCH] Update generation clientId --- .../admin/controller/extension/module/retailcrm.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/upload/admin/controller/extension/module/retailcrm.php b/src/upload/admin/controller/extension/module/retailcrm.php index 1c00161..c45b048 100644 --- a/src/upload/admin/controller/extension/module/retailcrm.php +++ b/src/upload/admin/controller/extension/module/retailcrm.php @@ -206,7 +206,7 @@ class ControllerExtensionModuleRetailcrm extends Controller $retailcrm_setting = $this->model_setting_setting->getSetting('retailcrm_setting'); if (!$retailcrm_setting) { - $clientId = hash('md5', date('Y-m-d H:i:s')); + $clientId = uniqid(); $api = $this->retailcrm->getApiClient( $this->request->post[$this->moduleTitle . '_url'], $this->request->post[$this->moduleTitle . '_apikey'], @@ -903,14 +903,14 @@ class ControllerExtensionModuleRetailcrm extends Controller { $scheme = isset($this->request->server['HTTPS']) ? 'https://' : 'http://'; $logo = 'https://s3.eu-central-1.amazonaws.com/retailcrm-billing/images/5af48736c6a0c-opencart-seeklogo.com.svg'; - $code = 'opencart'; + $integrationCode = 'opencart'; $name = 'Opencart'; - $accountUrl = $scheme . $this->request->server['HTTP_HOST'] . '/admin/index.php?route=extension/module/retailcrm'; + $accountUrl = $scheme . $this->request->server['HTTP_HOST'] . '/admin'; if ($api_version == 'v4') { $configuration = array( 'name' => $name, - 'code' => $code, + 'code' => $integrationCode . '-' . $clientId, 'logo' => $logo, 'configurationUrl' => $accountUrl, 'active' => $active @@ -920,8 +920,8 @@ class ControllerExtensionModuleRetailcrm extends Controller } else { $configuration = array( 'clientId' => $clientId, - 'code' => $code, - 'integrationCode' => $code, + 'code' => $integrationCode . '-' . $clientId, + 'integrationCode' => $integrationCode, 'active' => $active, 'name' => $name, 'logo' => $logo,