Skip to content

Commit b50827a

Browse files
authored
Merge pull request #61 from logeecom/master
Release version 3.2.20
2 parents 5f6b9d7 + 4a9b454 commit b50827a

File tree

6 files changed

+44
-2
lines changed

6 files changed

+44
-2
lines changed
1.6 MB
Binary file not shown.

PluginInstallation/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
55

6+
## [3.2.20](https://github.com/packlink-dev/prestashop_module/compare/v3.2.19...v3.2.20)
7+
### Changed
8+
- Added webhook registration in debug controller
9+
- Added check if menu item already exists before adding it
10+
611
## [3.2.19](https://github.com/packlink-dev/prestashop_module/compare/v3.2.18...v3.2.19)
712
### Changed
813
- Updated to Core version 3.3.21

src/classes/Utility/PacklinkInstaller.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@ public function updateHooks()
180180
*/
181181
public function addMenuItem()
182182
{
183+
/** @noinspection PhpDeprecationInspection */
184+
$id = \Tab::getIdFromClassName('Packlink');
185+
186+
if ($id) {
187+
return true;
188+
}
189+
183190
$tab = new \Tab();
184191

185192
$languages = \Language::getLanguages(true, \Context::getContext()->shop->id);

src/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "packlink/prestashop",
33
"description": "Packlink Shipping PrestaShop plugin",
44
"type": "library",
5-
"version": "3.2.19",
5+
"version": "3.2.20",
66
"repositories": [
77
{
88
"type": "vcs",

src/controllers/admin/DebugController.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<?php
22

33
use Logeecom\Infrastructure\Configuration\Configuration;
4+
use Logeecom\Infrastructure\Http\Exceptions\HttpAuthenticationException;
5+
use Logeecom\Infrastructure\Http\Exceptions\HttpCommunicationException;
6+
use Logeecom\Infrastructure\Http\Exceptions\HttpRequestException;
47
use Logeecom\Infrastructure\ServiceRegister;
8+
use Packlink\BusinessLogic\Http\Proxy;
59
use Packlink\PrestaShop\Classes\Utility\PacklinkPrestaShopUtility;
610
use Packlink\PrestaShop\Classes\Utility\SystemInfoUtility;
711
use Packlink\BusinessLogic\Controllers\DebugController as BaseDebugController;
@@ -167,6 +171,23 @@ public function displayAjaxGetAsyncTimeout()
167171
));
168172
}
169173

174+
/**
175+
* @return void
176+
*
177+
* @throws HttpAuthenticationException
178+
* @throws HttpCommunicationException
179+
* @throws HttpRequestException
180+
*/
181+
public function displayAjaxRegisterWebhooks()
182+
{
183+
$webHookUrl = $this->getConfigService()->getWebHookUrl();
184+
if (!empty($webHookUrl)) {
185+
$this->getProxy()->registerWebHookHandler($webHookUrl);
186+
}
187+
188+
PacklinkPrestaShopUtility::dieJson(array('success' => true));
189+
}
190+
170191
/**
171192
* @return ConfigurationService
172193
*/
@@ -175,4 +196,13 @@ private function getConfigurationService()
175196
/** @noinspection PhpIncompatibleReturnTypeInspection */
176197
return ServiceRegister::getService(Configuration::CLASS_NAME);
177198
}
199+
200+
/**
201+
* @return Proxy
202+
*/
203+
private function getProxy()
204+
{
205+
/** @noinspection PhpIncompatibleReturnTypeInspection */
206+
return ServiceRegister::getService(Proxy::CLASS_NAME);
207+
}
178208
}

src/packlink.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct()
4646
$this->module_key = 'a7a3a395043ca3a09d703f7d1c74a107';
4747
$this->name = 'packlink';
4848
$this->tab = 'shipping_logistics';
49-
$this->version = '3.2.19';
49+
$this->version = '3.2.20';
5050
$this->author = $this->l('Packlink Shipping S.L.');
5151
$this->need_instance = 0;
5252
$this->ps_versions_compliancy = array('min' => '1.6.0.14', 'max' => _PS_VERSION_);

0 commit comments

Comments
 (0)