From ee97968902295f1faa7904ad3e992d4158162ec9 Mon Sep 17 00:00:00 2001 From: mandan2 Date: Mon, 24 Jul 2023 09:58:10 +0300 Subject: [PATCH] upgrade file, version increase, changelog update --- changelog.md | 3 +++ mollie.php | 2 +- src/Service/SettingsSaveService.php | 3 ++- upgrade/Upgrade-6.0.2.php | 31 +++++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 upgrade/Upgrade-6.0.2.php diff --git a/changelog.md b/changelog.md index 8d6670e1f..ad07ddf8b 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,9 @@ # Changelog # +## Changes in release 6.0.2 ## ++ Decoupled Apple Pay direct feature flag into product and cart separate settings. + ## Changes in release 6.0.1 ## + Fixed payment fee tax problems and improved fee set-up process. + Sync Mollie components and Single click flag to the environment selected. diff --git a/mollie.php b/mollie.php index 391eb0a43..b67c9cbac 100755 --- a/mollie.php +++ b/mollie.php @@ -80,7 +80,7 @@ public function __construct() { $this->name = 'mollie'; $this->tab = 'payments_gateways'; - $this->version = '6.0.1'; + $this->version = '6.0.2'; $this->author = 'Mollie B.V.'; $this->need_instance = 1; $this->bootstrap = true; diff --git a/src/Service/SettingsSaveService.php b/src/Service/SettingsSaveService.php index 5a75a44a5..f3f75cdac 100644 --- a/src/Service/SettingsSaveService.php +++ b/src/Service/SettingsSaveService.php @@ -221,7 +221,8 @@ public function saveSettings(&$errors = []) try { $this->applePayDirectCertificateHandler->handle(); } catch (ApplePayDirectCertificateCreation $e) { - $isApplePayDirectProductEnabled = $isApplePayDirectCartEnabled = false; + $isApplePayDirectProductEnabled = false; + $isApplePayDirectCartEnabled = false; $errors[] = $e->getMessage(); $errors[] = TagsUtility::ppTags( diff --git a/upgrade/Upgrade-6.0.2.php b/upgrade/Upgrade-6.0.2.php new file mode 100644 index 000000000..c6cfd189a --- /dev/null +++ b/upgrade/Upgrade-6.0.2.php @@ -0,0 +1,31 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + */ + +use Mollie\Adapter\ConfigurationAdapter; +use Mollie\Config\Config; + +if (!defined('_PS_VERSION_')) { + exit; +} + +function upgrade_module_6_0_2(Mollie $module): bool +{ + /** @var ConfigurationAdapter $configuration */ + $configuration = $module->getService(ConfigurationAdapter::class); + + $configuration->updateValue(Config::MOLLIE_APPLE_PAY_DIRECT_PRODUCT, Configuration::get('MOLLIE_APPLE_PAY_DIRECT')); + $configuration->updateValue(Config::MOLLIE_APPLE_PAY_DIRECT_PRODUCT, Configuration::get('MOLLIE_APPLE_PAY_DIRECT')); + + $configuration->delete('MOLLIE_APPLE_PAY_DIRECT'); + + return true; +}