From 964c28bb76721ecf962ffbf368c71fc517d2e808 Mon Sep 17 00:00:00 2001 From: Aleksandar Sasa Boljanovic Date: Thu, 2 Nov 2023 12:33:04 +0100 Subject: [PATCH] Update Application info logic ISSUE: CS-4807 --- src/adyenofficial.php | 2 +- src/classes/Bootstrap.php | 9 ----- .../Services/Integration/ConfigService.php | 14 +++++--- .../ApplicationInfoProcessor.php | 35 ------------------- src/composer.json | 2 +- src/composer.lock | 12 +++---- 6 files changed, 17 insertions(+), 57 deletions(-) delete mode 100644 src/classes/Services/Integration/PaymentProcessors/ApplicationInfoProcessor.php diff --git a/src/adyenofficial.php b/src/adyenofficial.php index aafb140d..5edc7c93 100755 --- a/src/adyenofficial.php +++ b/src/adyenofficial.php @@ -46,7 +46,7 @@ public function __construct() { $this->name = 'adyenofficial'; $this->tab = 'payments_gateways'; - $this->version = '5.0.3'; + $this->version = '5.0.4'; $this->author = $this->l('Adyen'); $this->need_instance = 0; diff --git a/src/classes/Bootstrap.php b/src/classes/Bootstrap.php index a4f155e8..382ab06f 100755 --- a/src/classes/Bootstrap.php +++ b/src/classes/Bootstrap.php @@ -28,7 +28,6 @@ use Adyen\Core\BusinessLogic\Domain\Integration\Processors\ShopperLocaleProcessor as ShopperLocaleProcessorInterface; use Adyen\Core\BusinessLogic\Domain\Integration\Processors\ShopperNameProcessor as ShopperNameProcessorInterface; use Adyen\Core\BusinessLogic\Domain\Integration\Processors\ShopperReferenceProcessor as ShopperReferenceProcessorInterface; -use Adyen\Core\BusinessLogic\Domain\Integration\Processors\ApplicationInfoProcessor as ApplicationInfoProcessorInterface; use Adyen\Core\BusinessLogic\Domain\Integration\Store\StoreService as StoreServiceInterface; use Adyen\Core\BusinessLogic\Domain\Integration\SystemInfo\SystemInfoService as SystemInfoServiceInterface; use Adyen\Core\BusinessLogic\Domain\Integration\Version\VersionService as VersionServiceInterface; @@ -70,7 +69,6 @@ use AdyenPayment\Classes\Services\Integration\Logger\LoggerService; use AdyenPayment\Classes\Services\Integration\OrderService; use AdyenPayment\Classes\Services\Integration\PaymentProcessors\AddressProcessor; -use AdyenPayment\Classes\Services\Integration\PaymentProcessors\ApplicationInfoProcessor; use AdyenPayment\Classes\Services\Integration\PaymentProcessors\BasketItemsProcessor; use AdyenPayment\Classes\Services\Integration\PaymentProcessors\BirthdayProcessor; use AdyenPayment\Classes\Services\Integration\PaymentProcessors\DeviceFingerprintProcessor; @@ -337,13 +335,6 @@ static function () { return new ShopperReferenceProcessor(); } ); - - ServiceRegister::registerService( - ApplicationInfoProcessorInterface::class, - static function () { - return new ApplicationInfoProcessor(); - } - ); } /** diff --git a/src/classes/Services/Integration/ConfigService.php b/src/classes/Services/Integration/ConfigService.php index 0c0e64a0..1af309a1 100755 --- a/src/classes/Services/Integration/ConfigService.php +++ b/src/classes/Services/Integration/ConfigService.php @@ -4,6 +4,7 @@ use Adyen\Core\BusinessLogic\Domain\Configuration\Configuration; use AdyenPayment\Classes\Utility\Url; +use Module; /** * Class ConfigurationService @@ -12,7 +13,7 @@ */ class ConfigService extends Configuration { - private const INTEGRATION_NAME = 'Presta Shop'; + private const INTEGRATION_NAME = 'PrestaShop'; const MIN_LOG_LEVEL = 1; @@ -36,7 +37,7 @@ public function getAsyncProcessUrl($guid): string */ public function getIntegrationVersion(): string { - return '5.0.0'; + return _PS_VERSION_; } /** @@ -52,7 +53,9 @@ public function getIntegrationName(): string */ public function getPluginName(): string { - return 'AdyenPayment'; + $module = Module::getInstanceByName('adyenofficial'); + + return $module->displayName . ' ' . $this->getIntegrationName(); } /** @@ -60,7 +63,8 @@ public function getPluginName(): string */ public function getPluginVersion(): string { - // TODO: Implement getPluginVersion() method. - return ''; + $module = Module::getInstanceByName('adyenofficial'); + + return $module->version; } } diff --git a/src/classes/Services/Integration/PaymentProcessors/ApplicationInfoProcessor.php b/src/classes/Services/Integration/PaymentProcessors/ApplicationInfoProcessor.php deleted file mode 100644 index 92516e7a..00000000 --- a/src/classes/Services/Integration/PaymentProcessors/ApplicationInfoProcessor.php +++ /dev/null @@ -1,35 +0,0 @@ -setApplicationInfo( - new ApplicationInfo(new ExternalPlatform($shopName, _PS_VERSION_), $moduleInstance->version ?? null) - ); - } -} diff --git a/src/composer.json b/src/composer.json index c47f4778..9c989b2e 100755 --- a/src/composer.json +++ b/src/composer.json @@ -41,7 +41,7 @@ "php": "^7.2|^7.4|^8.0", "ext-json": "*", "ext-zip": "*", - "adyen/integration-core": "1.0.3", + "adyen/integration-core": "1.0.4", "ext-simplexml": "*", "ext-openssl": "*" }, diff --git a/src/composer.lock b/src/composer.lock index 4988cb76..5f6b4248 100755 --- a/src/composer.lock +++ b/src/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a1b05c62d8c9ff99d6d1d4e3c0ca7878", + "content-hash": "0e22affdf98f64a9efaf9d2edaec5f49", "packages": [ { "name": "adyen/integration-core", - "version": "1.0.3", + "version": "1.0.4", "source": { "type": "git", "url": "git@github.com:Adyen/adyen-php-plugin-core.git", - "reference": "5c7dafba811dd2d6f963aaf7f514405c4189c0b7" + "reference": "caf90c37d782550006cc2197c9b3151779f365ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Adyen/adyen-php-plugin-core/zipball/5c7dafba811dd2d6f963aaf7f514405c4189c0b7", - "reference": "5c7dafba811dd2d6f963aaf7f514405c4189c0b7", + "url": "https://api.github.com/repos/Adyen/adyen-php-plugin-core/zipball/caf90c37d782550006cc2197c9b3151779f365ad", + "reference": "caf90c37d782550006cc2197c9b3151779f365ad", "shasum": "" }, "require": { @@ -48,7 +48,7 @@ "proprietary" ], "description": "Core Adyen integration library", - "time": "2023-10-12T08:54:21+00:00" + "time": "2023-11-02T11:21:31+00:00" }, { "name": "adyen/php-webhook-module",