From 83360e4c6929c2861932d294e7e21fb7e21245f6 Mon Sep 17 00:00:00 2001 From: Akolzin Dmitry Date: Wed, 24 Oct 2018 16:35:07 +0300 Subject: [PATCH] Fix for marketplace --- retailcrm/retailcrm.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/retailcrm/retailcrm.php b/retailcrm/retailcrm.php index 79ed058..038b84b 100644 --- a/retailcrm/retailcrm.php +++ b/retailcrm/retailcrm.php @@ -732,7 +732,7 @@ class RetailCRM extends Module if ($response !== false) { if (!$settings['clientId']) { - $clientId = hash('md5', date('Y-m-d H:i:s')); + $clientId = uniqid(); $result = $this->integrationModule($api, $clientId, $settings['version']); if ($result) { @@ -773,14 +773,14 @@ class RetailCRM extends Module { $scheme = isset($_SERVER['HTTPS']) ? 'https://' : 'http://'; $logo = 'https://s3.eu-central-1.amazonaws.com/retailcrm-billing/images/5b845ce986911-prestashop2.svg'; - $code = 'prestashop'; + $integrationCode = 'prestashop'; $name = 'PrestaShop'; $accountUrl = $scheme . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; if ($apiVersion == 'v4') { $configuration = array( 'name' => $name, - 'code' => $code, + 'code' => $integrationCode . '-' . $clientId, 'logo' => $logo, 'configurationUrl' => $accountUrl, 'active' => $active @@ -790,8 +790,8 @@ class RetailCRM extends Module } else { $configuration = array( 'clientId' => $clientId, - 'code' => $code, - 'integrationCode' => $code, + 'code' => $integrationCode . '-' . $clientId, + 'integrationCode' => $integrationCode, 'active' => $active, 'name' => $name, 'logo' => $logo,