From c712a505213d7438d53acb65a6c57d44d9970995 Mon Sep 17 00:00:00 2001 From: Matic Luznar Date: Fri, 21 Jul 2023 13:18:35 +0200 Subject: [PATCH 01/37] Change Woocommerce minimum version to 3.9. --- src/Activation/ConstraintsChecker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Activation/ConstraintsChecker.php b/src/Activation/ConstraintsChecker.php index 73372ac92..ed257e294 100644 --- a/src/Activation/ConstraintsChecker.php +++ b/src/Activation/ConstraintsChecker.php @@ -34,7 +34,7 @@ class ConstraintsChecker public function __construct() { $wpConstraint = new WordPressConstraint('5.0'); - $wcConstraint = new PluginConstraint('3.0', 'woocommerce', 'WooCommerce'); + $wcConstraint = new PluginConstraint('3.9', 'woocommerce', 'WooCommerce'); $phpConstraint = new PhpConstraint('7.2'); $jsonConstraint = new ExtensionConstraint('json'); $collectionFactory = new ConstraintsCollectionFactory(); From 1bdd10aa995dfe492b81f105daf4279f1eaea637 Mon Sep 17 00:00:00 2001 From: Matic Luznar Date: Thu, 27 Jul 2023 13:38:10 +0200 Subject: [PATCH 02/37] Implement checkout block support for Mollie blocks in the admin. --- resources/js/mollieBlockIndex.js | 9 +- src/Assets/AssetsModule.php | 141 ++++------------- src/Assets/MollieCheckoutBlocksSupport.php | 166 +++++++++++++++++++++ 3 files changed, 198 insertions(+), 118 deletions(-) create mode 100644 src/Assets/MollieCheckoutBlocksSupport.php diff --git a/resources/js/mollieBlockIndex.js b/resources/js/mollieBlockIndex.js index 5e3adf9d0..641511e57 100644 --- a/resources/js/mollieBlockIndex.js +++ b/resources/js/mollieBlockIndex.js @@ -10,8 +10,9 @@ import molliePaymentMethod from './blocks/molliePaymentMethod' const { ajaxUrl, filters, gatewayData, availableGateways } = mollieBlockData.gatewayData; const {useEffect} = wp.element; const isAppleSession = typeof window.ApplePaySession === "function" - function getCompanyField() - { + const isBlockEditor = !!wp?.blockEditor; + + function getCompanyField() { let shippingCompany = document.getElementById('shipping-company'); let billingCompany = document.getElementById('billing-company'); return shippingCompany ? shippingCompany : billingCompany; @@ -39,8 +40,8 @@ import molliePaymentMethod from './blocks/molliePaymentMethod' } gatewayData.forEach(item => { let register = () => registerPaymentMethod(molliePaymentMethod(useEffect, ajaxUrl, filters, gatewayData, availableGateways, item, jQuery, requiredFields, isCompanyFieldVisible, isPhoneFieldVisible)); - if (item.name === 'mollie_wc_gateway_applepay' ) { - if (isAppleSession && window.ApplePaySession.canMakePayments()) { + if (item.name === 'mollie_wc_gateway_applepay' && !isBlockEditor) { + if ((isAppleSession && window.ApplePaySession.canMakePayments())) { register(); } return; diff --git a/src/Assets/AssetsModule.php b/src/Assets/AssetsModule.php index 52bb9e8e7..9cd245798 100644 --- a/src/Assets/AssetsModule.php +++ b/src/Assets/AssetsModule.php @@ -6,15 +6,13 @@ namespace Mollie\WooCommerce\Assets; +use Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry; use Inpsyde\Modularity\Module\ExecutableModule; use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; use Mollie\Api\Exceptions\ApiException; use Mollie\WooCommerce\Buttons\ApplePayButton\DataToAppleButtonScripts; use Mollie\WooCommerce\Buttons\PayPalButton\DataToPayPal; use Mollie\WooCommerce\Components\AcceptedLocaleValuesDictionary; -use Mollie\WooCommerce\Gateway\MolliePaymentGateway; -use Mollie\WooCommerce\Gateway\MolliePaymentGatewayI; -use Mollie\WooCommerce\PaymentMethods\PaymentMethodI; use Mollie\WooCommerce\Settings\Settings; use Mollie\WooCommerce\Shared\Data; use Psr\Container\ContainerInterface; @@ -34,15 +32,7 @@ public function enqueueBlockCheckoutScripts(Data $dataService, array $gatewayIns if (!has_block('woocommerce/checkout')) { return; } - wp_enqueue_script('mollie_block_index'); wp_enqueue_style('mollie-gateway-icons'); - wp_localize_script( - 'mollie_block_index', - 'mollieBlockData', - [ - 'gatewayData' => $this->gatewayDataForWCBlocks($dataService, $gatewayInstances), - ] - ); } public function registerButtonsBlockScripts(string $pluginUrl, string $pluginPath): void @@ -431,102 +421,6 @@ public function enqueueComponentsAssets(Settings $settingsHelper): void ); } - protected function gatewayDataForWCBlocks(Data $dataService, array $gatewayInstances): array - { - $filters = $dataService->wooCommerceFiltersForCheckout(); - $availableGateways = WC()->payment_gateways()->get_available_payment_gateways(); - $availablePaymentMethods = []; - /** - * @var MolliePaymentGatewayI $gateway - * psalm-suppress UnusedForeachValue - */ - foreach ($availableGateways as $key => $gateway) { - if (strpos($key, 'mollie_wc_gateway_') === false) { - unset($availableGateways[$key]); - } - } - if ( - isset($filters['amount']['currency']) - && isset($filters['locale']) - && isset($filters['billingCountry']) - ) { - $filterKey = "{$filters['amount']['currency']}-{$filters['locale']}-{$filters['billingCountry']}"; - foreach ($availableGateways as $key => $gateway) { - $availablePaymentMethods[$filterKey][$key] = $gateway->paymentMethod()->getProperty('id'); - } - } - - $dataToScript = [ - 'ajaxUrl' => admin_url('admin-ajax.php'), - 'filters' => [ - 'currency' => isset($filters['amount']['currency']) ? $filters['amount']['currency'] : false, - 'cartTotal' => isset($filters['amount']['value']) ? $filters['amount']['value'] : false, - 'paymentLocale' => isset($filters['locale']) ? $filters['locale'] : false, - 'billingCountry' => isset($filters['billingCountry']) ? $filters['billingCountry'] : false, - ], - ]; - $gatewayData = []; - $isSepaEnabled = isset($gatewayInstances['mollie_wc_gateway_directdebit']) && $gatewayInstances['mollie_wc_gateway_directdebit']->enabled === 'yes'; - /** @var MolliePaymentGateway $gateway */ - foreach ($gatewayInstances as $gatewayKey => $gateway) { - /** @var string $gatewayId */ - $gatewayId = is_string($gateway->paymentMethod()->getProperty('id')) ? $gateway->paymentMethod()->getProperty('id') : ""; - - if ($gateway->enabled !== 'yes' || $gatewayId === 'directdebit') { - continue; - } - $content = $gateway->paymentMethod()->getProcessedDescriptionForBlock(); - $issuers = false; - if ($gateway->paymentMethod()->getProperty('paymentFields') === true) { - $paymentFieldsService = $gateway->paymentMethod()->paymentFieldsService(); - $paymentFieldsService->setStrategy($gateway->paymentMethod()); - $issuers = $gateway->paymentMethod()->paymentFieldsService()->getStrategyMarkup($gateway); - } - if ($gatewayId === 'creditcard') { - $content .= $issuers; - $issuers = false; - } - $title = $gateway->paymentMethod()->title(); - $labelMarkup = "{$title}{$gateway->icon}"; - $hasSurcharge = $gateway->paymentMethod()->hasSurcharge(); - $gatewayData[] = [ - 'name' => $gatewayKey, - 'label' => $labelMarkup, - 'content' => $content, - 'issuers' => $issuers, - 'hasSurcharge' => $hasSurcharge, - 'title' => $title, - 'contentFallback' => __('Please choose a billing country to see the available payment methods', 'mollie-payments-for-woocommerce'), - 'edit' => $content, - 'paymentMethodId' => $gatewayKey, - 'allowedCountries' => is_array( - $gateway->paymentMethod()->getProperty('allowed_countries') - ) ? $gateway->paymentMethod()->getProperty('allowed_countries') : [], - 'ariaLabel' => $gateway->paymentMethod()->getProperty('defaultDescription'), - 'supports' => $this->gatewaySupportsFeatures($gateway->paymentMethod(), $isSepaEnabled), - 'errorMessage' => $gateway->paymentMethod()->getProperty('errorMessage'), - 'companyPlaceholder' => $gateway->paymentMethod()->getProperty('companyPlaceholder'), - 'phonePlaceholder' => $gateway->paymentMethod()->getProperty('phonePlaceholder'), - 'birthdatePlaceholder' => $gateway->paymentMethod()->getProperty('birthdatePlaceholder'), - ]; - } - $dataToScript['gatewayData'] = $gatewayData; - $dataToScript['availableGateways'] = $availablePaymentMethods; - - return $dataToScript; - } - - public function gatewaySupportsFeatures(PaymentMethodI $paymentMethod, bool $isSepaEnabled): array - { - $supports = (array) $paymentMethod->getProperty('supports'); - $isSepaPaymentMethod = (bool) $paymentMethod->getProperty('SEPA'); - if ($isSepaEnabled && $isSepaPaymentMethod) { - array_push($supports, 'subscriptions'); - } - - return $supports; - } - protected function getPluginUrl(string $pluginUrl, string $path = ''): string { return $pluginUrl . ltrim($path, '/'); @@ -633,9 +527,34 @@ protected function setupModuleActions(ContainerInterface $container): void $pluginPath = $container->get('shared.plugin_path'); /** @var Settings */ $settingsHelper = $container->get('settings.settings_helper'); + $gatewayInstances = $container->get('gateway.instances'); + + /** Add support to Mollie blocks for Woocommerce checkout blocks functionality */ + //https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md#putting-it-all-together + add_action( + 'woocommerce_blocks_loaded', + function () use ($dataService, $gatewayInstances, $pluginUrl, $pluginPath, $hasBlocksEnabled) { + if ($hasBlocksEnabled && class_exists('Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType')) { + add_action( + 'woocommerce_blocks_payment_method_type_registration', + function (PaymentMethodRegistry $paymentMethodRegistry) use ($dataService, $gatewayInstances, $pluginUrl, $pluginPath) { + $paymentMethodRegistry->register( + new MollieCheckoutBlocksSupport( + $dataService, + $gatewayInstances, + $this->getPluginUrl($pluginUrl, '/public/js/mollieBlockIndex.min.js'), + (string) filemtime($this->getPluginPath($pluginPath, '/public/js/mollieBlockIndex.min.js')) + ) + ); + } + ); + } + } + ); + add_action( 'init', - function () use ($container, $hasBlocksEnabled, $settingsHelper, $pluginUrl, $pluginPath, $dataService) { + function () use ($hasBlocksEnabled, $settingsHelper, $pluginUrl, $pluginPath) { self::registerFrontendScripts($pluginUrl, $pluginPath); // Enqueue Scripts @@ -649,12 +568,6 @@ function () use ($container, $hasBlocksEnabled, $settingsHelper, $pluginUrl, $pl }); if ($hasBlocksEnabled) { - /** @var array */ - $gatewayInstances = $container->get('gateway.instances'); - self::registerBlockScripts($pluginUrl, $pluginPath); - add_action('wp_enqueue_scripts', function () use ($dataService, $gatewayInstances) { - $this->enqueueBlockCheckoutScripts($dataService, $gatewayInstances); - }); $this->registerButtonsBlockScripts($pluginUrl, $pluginPath); } } diff --git a/src/Assets/MollieCheckoutBlocksSupport.php b/src/Assets/MollieCheckoutBlocksSupport.php new file mode 100644 index 000000000..92906c66a --- /dev/null +++ b/src/Assets/MollieCheckoutBlocksSupport.php @@ -0,0 +1,166 @@ +dataService = $dataService; + $this->gatewayInstances = $gatewayInstances; + $this->registerScriptUrl = $registerScriptUrl; + $this->registerScriptVersion = $registerScriptVersion; + } + + public function initialize() + { + // + } + + public function get_payment_method_script_handles() + { + wp_register_script( + $this->scriptHandle, + $this->registerScriptUrl, + ['wc-blocks-registry', 'underscore', 'jquery'], + $this->registerScriptVersion, + true + ); + + wp_localize_script( + $this->scriptHandle, + 'mollieBlockData', + [ + 'gatewayData' => $this->gatewayDataForWCBlocks($this->dataService, $this->gatewayInstances), + ] + ); + return [$this->scriptHandle]; + } + + public function get_payment_method_data() + { + return [ + 'title' => "Credit card", + 'description' => "Credit card description", + 'supports' => $this->get_supported_features(), + ]; + } + + private function gatewayDataForWCBlocks(Data $dataService, array $gatewayInstances): array + { + $filters = $dataService->wooCommerceFiltersForCheckout(); + $availableGateways = WC()->payment_gateways()->get_available_payment_gateways(); + $availablePaymentMethods = []; + /** + * @var MolliePaymentGatewayI $gateway + * psalm-suppress UnusedForeachValue + */ + foreach ($availableGateways as $key => $gateway) { + if (strpos($key, 'mollie_wc_gateway_') === false) { + unset($availableGateways[$key]); + } + } + if ( + isset($filters['amount']['currency']) + && isset($filters['locale']) + && isset($filters['billingCountry']) + ) { + $filterKey = "{$filters['amount']['currency']}-{$filters['locale']}-{$filters['billingCountry']}"; + foreach ($availableGateways as $key => $gateway) { + $availablePaymentMethods[$filterKey][$key] = $gateway->paymentMethod()->getProperty('id'); + } + } + + $dataToScript = [ + 'ajaxUrl' => admin_url('admin-ajax.php'), + 'filters' => [ + 'currency' => isset($filters['amount']['currency']) ? $filters['amount']['currency'] : false, + 'cartTotal' => isset($filters['amount']['value']) ? $filters['amount']['value'] : false, + 'paymentLocale' => isset($filters['locale']) ? $filters['locale'] : false, + 'billingCountry' => isset($filters['billingCountry']) ? $filters['billingCountry'] : false, + ], + ]; + $gatewayData = []; + $isSepaEnabled = isset($gatewayInstances['mollie_wc_gateway_directdebit']) && $gatewayInstances['mollie_wc_gateway_directdebit']->enabled === 'yes'; + /** @var MolliePaymentGateway $gateway */ + foreach ($gatewayInstances as $gatewayKey => $gateway) { + /** @var string $gatewayId */ + $gatewayId = is_string($gateway->paymentMethod()->getProperty('id')) ? $gateway->paymentMethod( + )->getProperty('id') : ""; + + if ($gateway->enabled !== 'yes' || $gatewayId === 'directdebit') { + continue; + } + $content = $gateway->paymentMethod()->getProcessedDescriptionForBlock(); + $issuers = false; + if ($gateway->paymentMethod()->getProperty('paymentFields') === true) { + $paymentFieldsService = $gateway->paymentMethod()->paymentFieldsService(); + $paymentFieldsService->setStrategy($gateway->paymentMethod()); + $issuers = $gateway->paymentMethod()->paymentFieldsService()->getStrategyMarkup($gateway); + } + if ($gatewayId === 'creditcard') { + $content .= $issuers; + $issuers = false; + } + $title = $gateway->paymentMethod()->title(); + $labelMarkup = "{$title}{$gateway->icon}"; + $hasSurcharge = $gateway->paymentMethod()->hasSurcharge(); + $gatewayData[] = [ + 'name' => $gatewayKey, + 'label' => $labelMarkup, + 'content' => $content, + 'issuers' => $issuers, + 'hasSurcharge' => $hasSurcharge, + 'title' => $title, + 'contentFallback' => __( + 'Please choose a billing country to see the available payment methods', + 'mollie-payments-for-woocommerce' + ), + 'edit' => $content, + 'paymentMethodId' => $gatewayKey, + 'allowedCountries' => is_array( + $gateway->paymentMethod()->getProperty('allowed_countries') + ) ? $gateway->paymentMethod()->getProperty('allowed_countries') : [], + 'ariaLabel' => $gateway->paymentMethod()->getProperty('defaultDescription'), + 'supports' => $this->gatewaySupportsFeatures($gateway->paymentMethod(), $isSepaEnabled), + 'errorMessage' => $gateway->paymentMethod()->getProperty('errorMessage'), + 'companyPlaceholder' => $gateway->paymentMethod()->getProperty('companyPlaceholder'), + 'phonePlaceholder' => $gateway->paymentMethod()->getProperty('phonePlaceholder'), + 'birthdatePlaceholder' => $gateway->paymentMethod()->getProperty('birthdatePlaceholder'), + ]; + } + $dataToScript['gatewayData'] = $gatewayData; + $dataToScript['availableGateways'] = $availablePaymentMethods; + + return $dataToScript; + } + + public function gatewaySupportsFeatures(PaymentMethodI $paymentMethod, bool $isSepaEnabled): array + { + $supports = (array)$paymentMethod->getProperty('supports'); + $isSepaPaymentMethod = (bool)$paymentMethod->getProperty('SEPA'); + if ($isSepaEnabled && $isSepaPaymentMethod) { + array_push($supports, 'subscriptions'); + } + + return $supports; + } +} From 1f9f499bba56d9bd2f126ed6840c573b693eedb5 Mon Sep 17 00:00:00 2001 From: Matic Luznar Date: Fri, 28 Jul 2023 05:57:44 +0200 Subject: [PATCH 03/37] Update woocommerce stubs and add woocommerce-packages-stubs.php to psalm.xml stubs. --- composer.json | 2 +- composer.lock | 21 ++++++++++----------- psalm.xml | 1 + 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index 9336d23c3..f1d56a322 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "fzaninotto/faker": "^1.9@dev", "inpsyde/php-coding-standards": "^1.0.0", "php-stubs/wordpress-stubs": "^5.0@stable", - "php-stubs/woocommerce-stubs": "^5.0@stable", + "php-stubs/woocommerce-stubs": "7.9.0", "vimeo/psalm": "^4.8 || ^5.13.0" }, "autoload": { diff --git a/composer.lock b/composer.lock index 28c3c95dd..1b41bce71 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cea1ff9bf85bcfc84018e2cbe6806299", + "content-hash": "08ed061076326ed4c72999e92368f69c", "packages": [ { "name": "composer/ca-bundle", @@ -1943,23 +1943,23 @@ }, { "name": "php-stubs/woocommerce-stubs", - "version": "v5.9.1", + "version": "v7.9.0", "source": { "type": "git", "url": "https://github.com/php-stubs/woocommerce-stubs.git", - "reference": "486ccff117badfab94c404065d37a77d632d7db5" + "reference": "3a2f522e29451490c357af550227795d2b0fc55a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/486ccff117badfab94c404065d37a77d632d7db5", - "reference": "486ccff117badfab94c404065d37a77d632d7db5", + "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/3a2f522e29451490c357af550227795d2b0fc55a", + "reference": "3a2f522e29451490c357af550227795d2b0fc55a", "shasum": "" }, "require": { - "php-stubs/wordpress-stubs": "^5.3.0" + "php-stubs/wordpress-stubs": "^5.3 || ^6.0" }, "require-dev": { - "php": "~7.1", + "php": "~7.1 || ~8.0", "php-stubs/generator": "^0.8.0" }, "suggest": { @@ -1981,9 +1981,9 @@ ], "support": { "issues": "https://github.com/php-stubs/woocommerce-stubs/issues", - "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v5.9.1" + "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v7.9.0" }, - "time": "2022-04-30T06:35:48+00:00" + "time": "2023-07-17T22:41:38+00:00" }, { "name": "php-stubs/wordpress-stubs", @@ -4684,8 +4684,7 @@ "minimum-stability": "dev", "stability-flags": { "fzaninotto/faker": 20, - "php-stubs/wordpress-stubs": 0, - "php-stubs/woocommerce-stubs": 0 + "php-stubs/wordpress-stubs": 0 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/psalm.xml b/psalm.xml index 67120051d..40a73a2b8 100644 --- a/psalm.xml +++ b/psalm.xml @@ -24,6 +24,7 @@ + From 4a8d150d3eb0f4cdd796f5ab3311a49f2d663eaa Mon Sep 17 00:00:00 2001 From: Matic Luznar Date: Fri, 28 Jul 2023 08:59:30 +0200 Subject: [PATCH 04/37] Remove unnecessary functions from MollieCheckoutBlocksSupport.php. + format code. --- src/Assets/MollieCheckoutBlocksSupport.php | 24 ++++++++-------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/Assets/MollieCheckoutBlocksSupport.php b/src/Assets/MollieCheckoutBlocksSupport.php index 92906c66a..c9be81b67 100644 --- a/src/Assets/MollieCheckoutBlocksSupport.php +++ b/src/Assets/MollieCheckoutBlocksSupport.php @@ -13,7 +13,6 @@ final class MollieCheckoutBlocksSupport extends AbstractPaymentMethodType protected $name = "mollie"; /** @var string $scriptHandle */ protected $scriptHandle = "mollie_block_index"; - /** @var Data */ protected $dataService; /** @var array */ @@ -22,8 +21,13 @@ final class MollieCheckoutBlocksSupport extends AbstractPaymentMethodType protected $registerScriptUrl; /** @var string $registerScriptVersion */ protected $registerScriptVersion; - public function __construct(Data $dataService, array $gatewayInstances, string $registerScriptUrl, string $registerScriptVersion) - { + + public function __construct( + Data $dataService, + array $gatewayInstances, + string $registerScriptUrl, + string $registerScriptVersion + ) { $this->dataService = $dataService; $this->gatewayInstances = $gatewayInstances; $this->registerScriptUrl = $registerScriptUrl; @@ -35,7 +39,7 @@ public function initialize() // } - public function get_payment_method_script_handles() + public function get_payment_method_script_handles(): array { wp_register_script( $this->scriptHandle, @@ -55,15 +59,6 @@ public function get_payment_method_script_handles() return [$this->scriptHandle]; } - public function get_payment_method_data() - { - return [ - 'title' => "Credit card", - 'description' => "Credit card description", - 'supports' => $this->get_supported_features(), - ]; - } - private function gatewayDataForWCBlocks(Data $dataService, array $gatewayInstances): array { $filters = $dataService->wooCommerceFiltersForCheckout(); @@ -102,7 +97,6 @@ private function gatewayDataForWCBlocks(Data $dataService, array $gatewayInstanc $isSepaEnabled = isset($gatewayInstances['mollie_wc_gateway_directdebit']) && $gatewayInstances['mollie_wc_gateway_directdebit']->enabled === 'yes'; /** @var MolliePaymentGateway $gateway */ foreach ($gatewayInstances as $gatewayKey => $gateway) { - /** @var string $gatewayId */ $gatewayId = is_string($gateway->paymentMethod()->getProperty('id')) ? $gateway->paymentMethod( )->getProperty('id') : ""; @@ -158,7 +152,7 @@ public function gatewaySupportsFeatures(PaymentMethodI $paymentMethod, bool $isS $supports = (array)$paymentMethod->getProperty('supports'); $isSepaPaymentMethod = (bool)$paymentMethod->getProperty('SEPA'); if ($isSepaEnabled && $isSepaPaymentMethod) { - array_push($supports, 'subscriptions'); + $supports[] = 'subscriptions'; } return $supports; From 291c10f1e9cda38ad34240e98250b5f03cac859c Mon Sep 17 00:00:00 2001 From: Matic Luznar Date: Tue, 1 Aug 2023 13:51:58 +0200 Subject: [PATCH 05/37] Get payment method icons from the api --- src/PaymentMethods/AbstractPaymentMethod.php | 3 +++ src/PaymentMethods/IconFactory.php | 5 +++++ src/PaymentMethods/PaymentMethodsIconUrl.php | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/src/PaymentMethods/AbstractPaymentMethod.php b/src/PaymentMethods/AbstractPaymentMethod.php index 6ed8880e4..4501b3326 100644 --- a/src/PaymentMethods/AbstractPaymentMethod.php +++ b/src/PaymentMethods/AbstractPaymentMethod.php @@ -117,6 +117,9 @@ public function hasPaymentFields(): bool */ public function getIconUrl(): string { + if (isset($this->apiPaymentMethod["image"]) && property_exists($this->apiPaymentMethod["image"], "svg")) { + return $this->iconFactory->getExternalIconHtml($this->apiPaymentMethod["image"]->svg); + } return $this->iconFactory->getIconUrl( $this->getIdFromConfig() ); diff --git a/src/PaymentMethods/IconFactory.php b/src/PaymentMethods/IconFactory.php index b94a8b553..33501cd48 100644 --- a/src/PaymentMethods/IconFactory.php +++ b/src/PaymentMethods/IconFactory.php @@ -28,6 +28,11 @@ public function getIconUrl($paymentMethodName): string return $this->iconFactory()->svgUrlForPaymentMethod($paymentMethodName); } + public function getExternalIconHtml($svgIconUrl): string + { + return $this->iconFactory()->generateIconHtml($svgIconUrl); + } + /** * Singleton of the class that handles icons (API/fallback) * @return PaymentMethodsIconUrl|null diff --git a/src/PaymentMethods/PaymentMethodsIconUrl.php b/src/PaymentMethods/PaymentMethodsIconUrl.php index 0ca4eb621..4efba5349 100644 --- a/src/PaymentMethods/PaymentMethodsIconUrl.php +++ b/src/PaymentMethods/PaymentMethodsIconUrl.php @@ -84,6 +84,12 @@ public function svgUrlForPaymentMethod($paymentMethodName) $svgUrl = $this->pluginUrl . '/' . sprintf('public/images/%s', $paymentMethodName) . self::SVG_FILE_EXTENSION; } + return $this->generateIconHtml($svgUrl); + } + + public function generateIconHtml($svgUrl) + { + return ''; } From b4ccc8f35174b368ddc5d7363bed0132593609a0 Mon Sep 17 00:00:00 2001 From: Matic Luznar Date: Wed, 2 Aug 2023 06:04:32 +0200 Subject: [PATCH 06/37] Removed empty space to satisfy phpcs standards. --- src/Assets/AssetsModule.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Assets/AssetsModule.php b/src/Assets/AssetsModule.php index 97bfe1e7d..17ed4a53c 100644 --- a/src/Assets/AssetsModule.php +++ b/src/Assets/AssetsModule.php @@ -646,7 +646,6 @@ function () use ($container, $hasBlocksEnabled, $settingsHelper, $pluginUrl, $pl // Enqueue Scripts add_action('wp_enqueue_scripts', function () use ($container) { $this->enqueueFrontendScripts($container); - }); add_action('wp_enqueue_scripts', function () use ($settingsHelper) { $this->enqueueComponentsAssets($settingsHelper); From 6a49eba51f829b1460971504f313e381b4f9d964 Mon Sep 17 00:00:00 2001 From: Matic Luznar Date: Thu, 3 Aug 2023 10:32:22 +0200 Subject: [PATCH 07/37] Run check_ajax_referer if wp_doing_ajax. --- src/Gateway/Voucher/VoucherModule.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Gateway/Voucher/VoucherModule.php b/src/Gateway/Voucher/VoucherModule.php index 1efd944e0..562755551 100644 --- a/src/Gateway/Voucher/VoucherModule.php +++ b/src/Gateway/Voucher/VoucherModule.php @@ -128,7 +128,11 @@ public function voucherBulkEditSave($product) { $post_id = $product->get_id(); $optionName = Voucher::MOLLIE_VOUCHER_CATEGORY_OPTION; - check_ajax_referer('inlineeditnonce', '_inline_edit'); + + if (wp_doing_ajax()) { + check_ajax_referer('inlineeditnonce', '_inline_edit'); + } + if (isset($_REQUEST[$optionName])) { $option = filter_var(wp_unslash($_REQUEST[$optionName]), FILTER_SANITIZE_SPECIAL_CHARS); update_post_meta($post_id, $optionName, wc_clean($option)); From 546e575207f96de9907ae2898c7b79e0398638a4 Mon Sep 17 00:00:00 2001 From: Matic Luznar Date: Fri, 4 Aug 2023 12:14:12 +0200 Subject: [PATCH 08/37] Fix broken credit card fields layout. --- resources/scss/mollie-components.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/scss/mollie-components.scss b/resources/scss/mollie-components.scss index a0747cf2a..1c12d9a90 100644 --- a/resources/scss/mollie-components.scss +++ b/resources/scss/mollie-components.scss @@ -50,6 +50,7 @@ #expiryDate, #verificationCode { max-width: 50%; + box-sizing: border-box; } #expiryDate { From 4dd5973e3b10d2284b0f70e655caaacdf581f49a Mon Sep 17 00:00:00 2001 From: Matic Luznar Date: Mon, 7 Aug 2023 08:09:03 +0200 Subject: [PATCH 09/37] Write streetAdditional to address_2 field. --- src/Payment/MollieOrderService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Payment/MollieOrderService.php b/src/Payment/MollieOrderService.php index 898c0686e..ca2ae7439 100644 --- a/src/Payment/MollieOrderService.php +++ b/src/Payment/MollieOrderService.php @@ -614,7 +614,7 @@ protected function setBillingAddressAfterPayment($payment, $order) 'email' => $billingAddress->email, 'phone' => null, 'address_1' => $billingAddress->streetAndNumber, - 'address_2' => null, + 'address_2' => property_exists($billingAddress, "streetAdditional") ? $billingAddress->streetAdditional : null, 'city' => $billingAddress->city, 'state' => null, 'postcode' => $billingAddress->postalCode, From f99715d33c1b4ae328085c0165d57b898b6d9c14 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 21 Aug 2023 15:15:02 +0200 Subject: [PATCH 10/37] Filter token input with wc_clean --- src/Payment/MollieOrder.php | 3 +-- src/Payment/MolliePayment.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Payment/MollieOrder.php b/src/Payment/MollieOrder.php index 6d01d3ed1..8ae1105a1 100644 --- a/src/Payment/MollieOrder.php +++ b/src/Payment/MollieOrder.php @@ -159,8 +159,7 @@ public function getPaymentRequestData($order, $customerId, $voucherDefaultCatego if ($cardToken && isset($paymentRequestData['payment'])) { $paymentRequestData['payment']['cardToken'] = $cardToken; } - - $applePayToken = filter_input(INPUT_POST, 'token', FILTER_SANITIZE_SPECIAL_CHARS) ?? false; + $applePayToken = wc_clean(wp_unslash($_POST["token"] ?? '')); if ($applePayToken && isset($paymentRequestData['payment'])) { $encodedApplePayToken = json_encode($applePayToken); $paymentRequestData['payment']['applePayPaymentToken'] = $encodedApplePayToken; diff --git a/src/Payment/MolliePayment.php b/src/Payment/MolliePayment.php index 72d473ae2..f06b2c74c 100644 --- a/src/Payment/MolliePayment.php +++ b/src/Payment/MolliePayment.php @@ -117,7 +117,7 @@ public function getPaymentRequestData($order, $customerId, $voucherDefaultCatego if ($cardToken) { $paymentRequestData['cardToken'] = $cardToken; } - $applePayToken = filter_input(INPUT_POST, 'token', FILTER_SANITIZE_SPECIAL_CHARS) ?? false; + $applePayToken = wc_clean(wp_unslash($_POST["token"] ?? '')); if ($applePayToken) { $encodedApplePayToken = json_encode($applePayToken); $paymentRequestData['applePayPaymentToken'] = $encodedApplePayToken; From db7a2718c99c68fff4a236e4745b68fbb084bcb1 Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Wed, 23 Aug 2023 12:25:39 +0200 Subject: [PATCH 11/37] Allow users to select credit card selector. --- src/PaymentMethods/AbstractPaymentMethod.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/PaymentMethods/AbstractPaymentMethod.php b/src/PaymentMethods/AbstractPaymentMethod.php index 4501b3326..a14d1bed1 100644 --- a/src/PaymentMethods/AbstractPaymentMethod.php +++ b/src/PaymentMethods/AbstractPaymentMethod.php @@ -83,6 +83,18 @@ public function getIdFromConfig(): string return $this->getConfig()['id']; } + public function getUploadedImage() + { + $settings = $this->getSettings(); + + return $settings["iconFileUrl"] ?? null; + } + + public function isCreditCardSelectorEnabled(){ + $settings = $this->getSettings(); + return isset($settings[PaymentMethodsIconUrl::MOLLIE_CREDITCARD_ICONS_ENABLER]) ? $settings[PaymentMethodsIconUrl::MOLLIE_CREDITCARD_ICONS_ENABLER] === "yes" : null; + } + /** * Access the payment method surcharge applied * @return Surcharge @@ -117,7 +129,12 @@ public function hasPaymentFields(): bool */ public function getIconUrl(): string { - if (isset($this->apiPaymentMethod["image"]) && property_exists($this->apiPaymentMethod["image"], "svg")) { + + if($uploadedImageUrl = $this->getUploadedImage()){ + return $this->iconFactory->getExternalIconHtml($uploadedImageUrl); + } + + if (isset($this->apiPaymentMethod["image"]) && property_exists($this->apiPaymentMethod["image"], "svg") && !$this->isCreditCardSelectorEnabled()) { return $this->iconFactory->getExternalIconHtml($this->apiPaymentMethod["image"]->svg); } return $this->iconFactory->getIconUrl( @@ -268,6 +285,7 @@ public function getMergedProperties(): array { return array_merge($this->config, $this->getSettings()); } + /** * Default values for the initial settings saved * From e58e2bcedc0bb357f602b3dbea66f02a57e8c095 Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Wed, 23 Aug 2023 12:31:44 +0200 Subject: [PATCH 12/37] PHPcs styling fixes. --- src/PaymentMethods/AbstractPaymentMethod.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PaymentMethods/AbstractPaymentMethod.php b/src/PaymentMethods/AbstractPaymentMethod.php index a14d1bed1..5b8c0b723 100644 --- a/src/PaymentMethods/AbstractPaymentMethod.php +++ b/src/PaymentMethods/AbstractPaymentMethod.php @@ -90,7 +90,8 @@ public function getUploadedImage() return $settings["iconFileUrl"] ?? null; } - public function isCreditCardSelectorEnabled(){ + public function isCreditCardSelectorEnabled() + { $settings = $this->getSettings(); return isset($settings[PaymentMethodsIconUrl::MOLLIE_CREDITCARD_ICONS_ENABLER]) ? $settings[PaymentMethodsIconUrl::MOLLIE_CREDITCARD_ICONS_ENABLER] === "yes" : null; } @@ -129,8 +130,7 @@ public function hasPaymentFields(): bool */ public function getIconUrl(): string { - - if($uploadedImageUrl = $this->getUploadedImage()){ + if ($uploadedImageUrl = $this->getUploadedImage()) { return $this->iconFactory->getExternalIconHtml($uploadedImageUrl); } From 0599d68adb849ecef64959d669b9e019cb7c4d66 Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Fri, 25 Aug 2023 09:27:44 +0200 Subject: [PATCH 13/37] Implement basic refund functionality. Still needs refactoring. --- src/Payment/MollieOrderService.php | 120 ++++++++++++++++++++++------- 1 file changed, 93 insertions(+), 27 deletions(-) diff --git a/src/Payment/MollieOrderService.php b/src/Payment/MollieOrderService.php index 898c0686e..cb8b5532c 100644 --- a/src/Payment/MollieOrderService.php +++ b/src/Payment/MollieOrderService.php @@ -4,6 +4,7 @@ namespace Mollie\WooCommerce\Payment; +use Exception; use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Resources\Order; use Mollie\Api\Resources\Payment; @@ -14,6 +15,7 @@ use Mollie\WooCommerce\Shared\SharedDataDictionary; use Psr\Log\LoggerInterface as Logger; use Psr\Log\LogLevel; +use WC_Abstract_Order; use WC_Order; class MollieOrderService @@ -171,9 +173,9 @@ public function onWebhookAction() $payment->id . ($payment->mode === 'test' ? (' - ' . __('test mode', 'mollie-payments-for-woocommerce')) : '') )); } - // Status 200 } + /** * @param WC_Order $order * @@ -234,8 +236,9 @@ protected function isOrderPaidByOtherGateway(WC_Order $order) } /** - * @param WC_Order $order + * @param WC_Order $order * @param Payment|Order $payment + * @throws Exception */ protected function processRefunds(WC_Order $order, $payment) { @@ -258,7 +261,11 @@ protected function processRefunds(WC_Order $order, $payment) return; } - $refundIds = $this->findRefundIds($payment); + $refunds = $this->findRefunds($payment); + $refundIds = array_reduce($refunds, static function ($ids, $refund) { + $ids[] = $refund->id; + return $ids; + }, []); // Check for new refund $this->logger->debug( __METHOD__ . " All refund IDs for {$logId}: " . json_encode( @@ -281,15 +288,20 @@ protected function processRefunds(WC_Order $order, $payment) return; } // There are new refunds. - $refundsToProcess = array_diff($refundIds, $processedRefundIds); + $refundIdsToProcess = array_diff($refundIds, $processedRefundIds); + $refundsToProcess = array_filter($refunds, static function ($refund) use ($refundIdsToProcess) { + return in_array($refund->id, $refundIdsToProcess); + }); + $this->logger->debug( __METHOD__ . " Refunds that need to be processed for {$logId}: " - . json_encode($refundsToProcess) + . json_encode($refundIdsToProcess) ); $order = wc_get_order($orderId); - $this->notifyProcessedRefunds($refundsToProcess, $logId, $order, $processedRefundIds); + $woocommerceProcessedRefunds = $this->generateWoocommerceRefunds($refundsToProcess, $order); + $this->notifyProcessedRefunds($refundIdsToProcess, $woocommerceProcessedRefunds, $logId, $order, $processedRefundIds); $order->save(); $this->processUpdateStateRefund($order, $payment); @@ -305,7 +317,7 @@ protected function processRefunds(WC_Order $order, $payment) } /** - * @param WC_Order $order + * @param WC_Order $order * @param Payment|Order $payment */ protected function processChargebacks(WC_Order $order, $payment) @@ -419,7 +431,10 @@ protected function processChargebacks(WC_Order $order, $payment) $newOrderStatus = apply_filters($this->pluginId . '_order_status_on_hold', $newOrderStatus); // Overwrite gateway-wide - $newOrderStatus = apply_filters($this->pluginId . "_order_status_on_hold_{$this->gateway->id}", $newOrderStatus); + $newOrderStatus = apply_filters( + $this->pluginId . "_order_status_on_hold_{$this->gateway->id}", + $newOrderStatus + ); $paymentMethodTitle = $this->getPaymentMethodTitle($payment); @@ -539,12 +554,12 @@ protected function hasLineRefund($payment): bool * @param $payment * @return array */ - protected function findRefundIds($payment): array + protected function findRefunds($payment): array { if (empty($payment->_links->refunds)) { - return $this->findRefundIdsByLine($payment); + return $this->findRefundsByLine($payment); } - return $this->findRefundIdsByLinks($payment); + return $this->findRefundsByLinks($payment); } /** @@ -553,11 +568,11 @@ protected function findRefundIds($payment): array * @param $payment * @return array */ - protected function findRefundIdsByLine($payment): array + protected function findRefundsByLine($payment): array { - return array_map(static function ($refund) { - return $refund->id; - }, $payment->_embedded->refunds); + return array_filter($payment->_embedded->refunds, function($refund){ + return $refund->status === "refunded"; + }); } /** @@ -571,7 +586,7 @@ protected function calculateRefundByLine($payment): float $refundAmount = 0.0; $refunds = $payment->_embedded->refunds; foreach ($refunds as $refund) { - $refundAmount += (float) $refund->amount->value; + $refundAmount += (float)$refund->amount->value; } return $refundAmount; } @@ -582,14 +597,15 @@ protected function calculateRefundByLine($payment): float * @param $payment * @return array */ - protected function findRefundIdsByLinks($payment): array + protected function findRefundsByLinks($payment): array { - $refundIds = []; + $refundsList = []; try { // Get all refunds for this payment $refunds = $payment->refunds(); foreach ($refunds as $refund) { - $refundIds[] = $refund->id; + if($refund->status !== "refunded") continue; + $refundsList[] = $refund; } } catch (\Mollie\Api\Exceptions\ApiException $e) { $this->logger->debug( @@ -598,7 +614,7 @@ protected function findRefundIdsByLinks($payment): array . ' (' . get_class($e) . ')' ); } - return $refundIds; + return $refundsList; } /** @@ -637,7 +653,7 @@ protected function isPartialRefund($payment) } /** - * @param WC_Order $order + * @param WC_Order $order * @param Payment|Order $payment */ protected function processUpdateStateRefund(WC_Order $order, $payment) @@ -653,7 +669,7 @@ protected function processUpdateStateRefund(WC_Order $order, $payment) } /** - * @param WC_Order $order + * @param WC_Order $order * @param Payment|Order $payment * @param $newOrderStatus * @param $refundType @@ -734,6 +750,7 @@ protected function getPaymentMethodTitle($payment) } return $payment_method_title; } + /** * @param \WC_Order $order * @param string $new_status @@ -747,7 +764,7 @@ public function updateOrderStatus(\WC_Order $order, $new_status, $note = '', $re switch ($new_status) { case SharedDataDictionary::STATUS_ON_HOLD: if ($restore_stock === true) { - if (! $order->get_meta('_order_stock_reduced', true)) { + if (!$order->get_meta('_order_stock_reduced', true)) { // Reduce order stock wc_reduce_stock_levels($order->get_id()); @@ -772,17 +789,18 @@ public function updateOrderStatus(\WC_Order $order, $new_status, $note = '', $re } /** - * @param WC_Order $order + * @param WC_Abstract_Order $order * @param string $logId - * @return array|mixed|string|void + * @return array */ - protected function getProcessedRefundIds(WC_Order $order, string $logId) + protected function getProcessedRefundIds(WC_Abstract_Order $order, string $logId): array { if ($order->meta_exists('_mollie_processed_refund_ids')) { $processedRefundIds = $order->get_meta( '_mollie_processed_refund_ids', true ); + $processedRefundIds = is_array($processedRefundIds) ? $processedRefundIds : []; } else { $processedRefundIds = []; } @@ -796,12 +814,60 @@ protected function getProcessedRefundIds(WC_Order $order, string $logId) /** * @param array $refundsToProcess + * @param mixed $order + */ + protected function generateWoocommerceRefunds(array $refundsToProcess, $order) + { + if (count($refundsToProcess) === 0) { + return []; + } + + $woocommerceRefunds = []; + + foreach ($refundsToProcess as $refund) { + $refundItems = $refund->lines; + $wcRefund = [ + 'order_id' => $order->get_id(), + 'amount' => $refund->amount->value, + ]; + + + if (is_array($refundItems) && count($refundItems) > 0) { + $wcRefundItems = []; + foreach ($refundItems as $refundItem) { + $wcRefundItems[$refundItem->metadata->order_item_id] = [ + 'qty' => $refundItem->quantity, + 'refund_total' => $refundItem->totalAmount->value, + 'refund_tax' => $refundItem->vatAmount->value, + ]; + } + $wcRefund['restock_items'] = true; + $wcRefund['line_items'] = $wcRefundItems; + } + + + + try { + $woocommerceRefunds[] = wc_create_refund($wcRefund); + } catch (Exception $error) { + $this->logger->debug( + __METHOD__ . " Can't create a refund for order " . $order->get_id() . " for refund ID: " . $refund->id . "." + ); + } + } + + return $woocommerceRefunds; + } + + /** + * @param array $refundsToProcess + * @param array $woocommerceRefunds * @param string $logId * @param $order * @param $processedRefundIds * @return mixed */ - protected function notifyProcessedRefunds(array $refundsToProcess, string $logId, $order, $processedRefundIds) + protected function notifyProcessedRefunds(array $refundsToProcess, array $woocommerceRefunds,string $logId, $order, $processedRefundIds) { foreach ($refundsToProcess as $refundToProcess) { $this->logger->debug( From 86dc4e1ce60235317ce188dc1c0be06a8ca41aca Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Mon, 28 Aug 2023 12:37:16 +0200 Subject: [PATCH 14/37] Implement refund functionality, including partial refunds. --- src/Payment/MollieOrderService.php | 253 ++++++++++++++++++++--------- 1 file changed, 178 insertions(+), 75 deletions(-) diff --git a/src/Payment/MollieOrderService.php b/src/Payment/MollieOrderService.php index cb8b5532c..a424eec17 100644 --- a/src/Payment/MollieOrderService.php +++ b/src/Payment/MollieOrderService.php @@ -20,6 +20,10 @@ class MollieOrderService { + const REFUND_STATUS_REFUNDED = 'refunded'; + const META_KEY_PROCESSED_ORDERS = '_mollie_processed_refund_ids'; + const META_KEY_PROCESSED_AND_REFUNDED_ORDERS = '_mollie_processed_and_refunded_refund_ids'; + protected $gateway; /** * @var HttpResponse @@ -131,15 +135,20 @@ public function onWebhookAction() if ($order_id != $payment->metadata->order_id) { $this->httpResponse->setHttpResponseCode(400); - $this->logger->debug(__METHOD__ . ": Order ID does not match order_id in payment metadata. Payment ID {$payment->id}, order ID $order_id"); + $this->logger->debug( + __METHOD__ . ": Order ID does not match order_id in payment metadata. Payment ID {$payment->id}, order ID $order_id" + ); return; } // Log a message that webhook was called, doesn't mean the payment is actually processed - $this->logger->debug($this->gateway->id . ": Mollie payment object {$payment->id} (" . $payment->mode . ") webhook call for order {$order->get_id()}.", [true]); + $this->logger->debug( + $this->gateway->id . ": Mollie payment object {$payment->id} (" . $payment->mode . ") webhook call for order {$order->get_id()}.", + [true] + ); // Order does not need a payment - if (! $this->orderNeedsPayment($order)) { + if (!$this->orderNeedsPayment($order)) { // TODO David: move to payment object? // Add a debug message that order was already paid for $this->gateway->handlePaidOrderWebhook($order, $payment); @@ -165,13 +174,18 @@ public function onWebhookAction() if (method_exists($payment_object, $method_name)) { $payment_object->{$method_name}($order, $payment, $payment_method_title); } else { - $order->add_order_note(sprintf( - /* translators: Placeholder 1: payment method title, placeholder 2: payment status, placeholder 3: payment ID */ - __('%1$s payment %2$s (%3$s), not processed.', 'mollie-payments-for-woocommerce'), - $this->gateway->method_title, - $payment->status, - $payment->id . ($payment->mode === 'test' ? (' - ' . __('test mode', 'mollie-payments-for-woocommerce')) : '') - )); + $order->add_order_note( + sprintf( + /* translators: Placeholder 1: payment method title, placeholder 2: payment status, placeholder 3: payment ID */ + __('%1$s payment %2$s (%3$s), not processed.', 'mollie-payments-for-woocommerce'), + $this->gateway->method_title, + $payment->status, + $payment->id . ($payment->mode === 'test' ? (' - ' . __( + 'test mode', + 'mollie-payments-for-woocommerce' + )) : '') + ) + ); } // Status 200 } @@ -187,20 +201,29 @@ public function orderNeedsPayment(WC_Order $order) // Check whether the order is processed and paid via another gateway if ($this->isOrderPaidByOtherGateway($order)) { - $this->logger->debug(__METHOD__ . ' ' . $this->gateway->id . ': Order ' . $order_id . ' orderNeedsPayment check: no, previously processed by other (non-Mollie) gateway.', [true]); + $this->logger->debug( + __METHOD__ . ' ' . $this->gateway->id . ': Order ' . $order_id . ' orderNeedsPayment check: no, previously processed by other (non-Mollie) gateway.', + [true] + ); return false; } // Check whether the order is processed and paid via Mollie - if (! $this->isOrderPaidAndProcessed($order)) { - $this->logger->debug(__METHOD__ . ' ' . $this->gateway->id . ': Order ' . $order_id . ' orderNeedsPayment check: yes, order not previously processed by Mollie gateway.', [true]); + if (!$this->isOrderPaidAndProcessed($order)) { + $this->logger->debug( + __METHOD__ . ' ' . $this->gateway->id . ': Order ' . $order_id . ' orderNeedsPayment check: yes, order not previously processed by Mollie gateway.', + [true] + ); return true; } if ($order->needs_payment()) { - $this->logger->debug(__METHOD__ . ' ' . $this->gateway->id . ': Order ' . $order_id . ' orderNeedsPayment check: yes, WooCommerce thinks order needs payment.', [true]); + $this->logger->debug( + __METHOD__ . ' ' . $this->gateway->id . ': Order ' . $order_id . ' orderNeedsPayment check: yes, WooCommerce thinks order needs payment.', + [true] + ); return true; } @@ -243,65 +266,77 @@ protected function isOrderPaidByOtherGateway(WC_Order $order) protected function processRefunds(WC_Order $order, $payment) { $orderId = $order->get_id(); - - // Debug log ID (order id/payment id) + $notifyNewRefundsIds = []; + $notifyRefundedRefundsIds = []; $logId = "order {$orderId} / payment{$payment->id}"; - - // Add message to log $this->logger->debug(__METHOD__ . " called for {$logId}"); - $hasLineRefund = $this->hasLineRefund($payment); // Make sure there are refunds to process at all - if (empty($payment->_links->refunds) && !$hasLineRefund) { + if (!$this->hasRefund($payment)) { $this->logger->debug( __METHOD__ . ": No refunds to process for {$logId}", [true] ); - return; } - $refunds = $this->findRefunds($payment); - $refundIds = array_reduce($refunds, static function ($ids, $refund) { + $mollieRefunds = $this->findMollieRefunds($payment); + $mollieRefundIds = array_reduce($mollieRefunds, static function ($ids, $refund) { $ids[] = $refund->id; return $ids; }, []); - // Check for new refund + $this->logger->debug( __METHOD__ . " All refund IDs for {$logId}: " . json_encode( - $refundIds + $mollieRefundIds ) ); - // Get possibly already processed refunds - $processedRefundIds = $this->getProcessedRefundIds($order, $logId); + $notedRefundIds = $this->getProcessedRefundIds($order, $logId); + $notedAndWCProcessedRefunds = $this->getWCRefundIds($order, $logId); - // Order the refund arrays by value (refund ID) - asort($refundIds); - asort($processedRefundIds); + foreach ($mollieRefunds as $mollieRefund) { + if (!in_array($mollieRefund->id, $notedRefundIds)) { + $notifyNewRefundsIds[] = $mollieRefund->id; + } - // Check if no new refunds need processing return - if ($refundIds === $processedRefundIds) { + if ($mollieRefund->status === self::REFUND_STATUS_REFUNDED && !in_array($mollieRefund->id, $notedAndWCProcessedRefunds)) { + $notifyRefundedRefundsIds[] = $mollieRefund->id; + } + } + + /** Notification - refund exists in Mollie, but it is not processed in Woocommerce yet */ + if (count($notifyNewRefundsIds) > 0) { $this->logger->debug( - __METHOD__ . " No new refunds, stop processing for {$logId}" + __METHOD__ + . " Refunds that need to be processed for {$logId}: " + . json_encode($notifyNewRefundsIds) + ); + $this->notifyNewRefunds($notifyNewRefundsIds, $logId, $order, $notedRefundIds); + } else { + $this->logger->debug( + __METHOD__ . " No new refunds." ); - return; } - // There are new refunds. - $refundIdsToProcess = array_diff($refundIds, $processedRefundIds); - $refundsToProcess = array_filter($refunds, static function ($refund) use ($refundIdsToProcess) { - return in_array($refund->id, $refundIdsToProcess); - }); - $this->logger->debug( - __METHOD__ - . " Refunds that need to be processed for {$logId}: " - . json_encode($refundIdsToProcess) - ); - $order = wc_get_order($orderId); + /** Notification & Woocommerce refund - refund exists, and it is processed in Mollie, so we can create a refund in the Woocommerce */ + if (count($notifyRefundedRefundsIds)) { + $this->logger->debug( + __METHOD__ + . " Refunds that need to be processed and refunded for {$logId}: " + . json_encode($notifyRefundedRefundsIds) + ); + + $notifyRefundedRefunds = array_filter($mollieRefunds, static function ($mollieRefund) use ($notifyRefundedRefundsIds) { + return in_array($mollieRefund->id, $notifyRefundedRefundsIds); + }); - $woocommerceProcessedRefunds = $this->generateWoocommerceRefunds($refundsToProcess, $order); - $this->notifyProcessedRefunds($refundIdsToProcess, $woocommerceProcessedRefunds, $logId, $order, $processedRefundIds); + $this->notifyRefundedRefundsAndCreateWCRefund($notifyRefundedRefunds, $logId, $order, $notedAndWCProcessedRefunds); + } else { + $this->logger->debug( + __METHOD__ . " No new processed refunds." + ); + } $order->save(); $this->processUpdateStateRefund($order, $payment); @@ -529,7 +564,7 @@ class_exists('WC_Subscriptions') ); return; - } catch (\Mollie\Api\Exceptions\ApiException $e) { + } catch (ApiException $e) { $this->logger->debug( __FUNCTION__ . ": Could not load chargebacks for $payment->id: " . $e->getMessage() . ' (' . get_class($e) . ')' @@ -540,21 +575,24 @@ class_exists('WC_Subscriptions') /** * Check if there is a refund inside an order line * - * @param $payment + * @param Order | Payment $payment * @return bool */ - protected function hasLineRefund($payment): bool + protected function hasRefund($payment): bool { - return !empty($payment->_embedded->refunds); + $hasEmbeddedRefund = !empty($payment->_embedded->refunds); + $hasLinkRefunds = !empty($payment->_links->refunds); + + return $hasEmbeddedRefund || $hasLinkRefunds; } /** * Find the Ids of the refunds * - * @param $payment + * @param Order | Payment $payment * @return array */ - protected function findRefunds($payment): array + protected function findMollieRefunds($payment): array { if (empty($payment->_links->refunds)) { return $this->findRefundsByLine($payment); @@ -570,8 +608,8 @@ protected function findRefunds($payment): array */ protected function findRefundsByLine($payment): array { - return array_filter($payment->_embedded->refunds, function($refund){ - return $refund->status === "refunded"; + return array_filter($payment->_embedded->refunds, static function ($refund) { + return $refund; }); } @@ -594,27 +632,24 @@ protected function calculateRefundByLine($payment): float /** * Check if there is a refund inside an order line * - * @param $payment + * @param Order | Payment $payment * @return array */ protected function findRefundsByLinks($payment): array { - $refundsList = []; + $activeRefunds = []; try { - // Get all refunds for this payment - $refunds = $payment->refunds(); - foreach ($refunds as $refund) { - if($refund->status !== "refunded") continue; - $refundsList[] = $refund; + foreach ($payment->refunds() as $refund) { + $activeRefunds[] = $refund; } - } catch (\Mollie\Api\Exceptions\ApiException $e) { + } catch (ApiException $e) { $this->logger->debug( __FUNCTION__ . " : Could not load refunds for {$payment->id}: {$e->getMessage()}" . ' (' . get_class($e) . ')' ); } - return $refundsList; + return $activeRefunds; } /** @@ -795,9 +830,9 @@ public function updateOrderStatus(\WC_Order $order, $new_status, $note = '', $re */ protected function getProcessedRefundIds(WC_Abstract_Order $order, string $logId): array { - if ($order->meta_exists('_mollie_processed_refund_ids')) { + if ($order->meta_exists(self::META_KEY_PROCESSED_ORDERS)) { $processedRefundIds = $order->get_meta( - '_mollie_processed_refund_ids', + self::META_KEY_PROCESSED_ORDERS, true ); $processedRefundIds = is_array($processedRefundIds) ? $processedRefundIds : []; @@ -812,9 +847,29 @@ protected function getProcessedRefundIds(WC_Abstract_Order $order, string $logId return $processedRefundIds; } + protected function getWCRefundIds(WC_Abstract_Order $order, string $logId): array + { + if ($order->meta_exists(self::META_KEY_PROCESSED_AND_REFUNDED_ORDERS)) { + $wcRefundIds = $order->get_meta( + self::META_KEY_PROCESSED_AND_REFUNDED_ORDERS, + true + ); + $wcRefundIds = is_array($wcRefundIds) ? $wcRefundIds : []; + } else { + $wcRefundIds = []; + } + + $this->logger->debug( + __METHOD__ . " Already created WC refunds for {$logId}: " + . json_encode($wcRefundIds) + ); + return $wcRefundIds; + } + /** * @param array $refundsToProcess * @param mixed $order + * @return array */ protected function generateWoocommerceRefunds(array $refundsToProcess, $order) { @@ -831,7 +886,6 @@ protected function generateWoocommerceRefunds(array $refundsToProcess, $order) 'amount' => $refund->amount->value, ]; - if (is_array($refundItems) && count($refundItems) > 0) { $wcRefundItems = []; foreach ($refundItems as $refundItem) { @@ -845,13 +899,12 @@ protected function generateWoocommerceRefunds(array $refundsToProcess, $order) $wcRefund['line_items'] = $wcRefundItems; } - - try { $woocommerceRefunds[] = wc_create_refund($wcRefund); } catch (Exception $error) { $this->logger->debug( - __METHOD__ . " Can't create a refund for order " . $order->get_id() . " for refund ID: " . $refund->id . "." + __METHOD__ . " Can't create a refund for order " . $order->get_id( + ) . " for refund ID: " . $refund->id . "." ); } } @@ -861,14 +914,18 @@ protected function generateWoocommerceRefunds(array $refundsToProcess, $order) /** * @param array $refundsToProcess - * @param array $woocommerceRefunds * @param string $logId * @param $order - * @param $processedRefundIds + * @param array $processedRefundIds * @return mixed */ - protected function notifyProcessedRefunds(array $refundsToProcess, array $woocommerceRefunds,string $logId, $order, $processedRefundIds) - { + protected function notifyNewRefunds( + array $refundsToProcess, + string $logId, + $order, + array $processedRefundIds + ) { + foreach ($refundsToProcess as $refundToProcess) { $this->logger->debug( __METHOD__ @@ -889,7 +946,7 @@ protected function notifyProcessedRefunds(array $refundsToProcess, array $woocom } $order->update_meta_data( - '_mollie_processed_refund_ids', + self::META_KEY_PROCESSED_ORDERS, $processedRefundIds ); $this->logger->debug( @@ -899,6 +956,52 @@ protected function notifyProcessedRefunds(array $refundsToProcess, array $woocom return $processedRefundIds; } + /** + * @param array $refundsToProcess + * @param string $logId + * @param $order + * @param array $processedRefundIds + * @return mixed + */ + protected function notifyRefundedRefundsAndCreateWCRefund( + array $refundsToProcess, + string $logId, + $order, + array $processedRefundIds + ) { + + foreach ($refundsToProcess as $refundToProcess) { + $this->logger->debug( + __METHOD__ + . " New refund {$refundToProcess->id} processed in Mollie Dashboard for {$logId} Order note added, but order not updated." + ); + /* translators: Placeholder 1: Refund to process id. */ + $order->add_order_note( + sprintf( + __( + 'Refund %s applied to Woocommerce order.', + 'mollie-payments-for-woocommerce' + ), + $refundToProcess->id + ) + ); + + $processedRefundIds[] = $refundToProcess->id; + } + + $this->generateWoocommerceRefunds($refundsToProcess, $order); + + $order->update_meta_data( + self::META_KEY_PROCESSED_AND_REFUNDED_ORDERS, + $processedRefundIds + ); + $this->logger->debug( + __METHOD__ . " Updated all processed and applied refunds for {$logId}: " + . json_encode($processedRefundIds) + ); + return $processedRefundIds; + } + protected function isOrderButtonPayment(WC_Order $order): bool { return $order->get_meta('_mollie_payment_method_button') === 'PayPalButton'; From b7e90cc7c02a40991150ab88f7fbbb53c6dd5944 Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Mon, 28 Aug 2023 13:44:05 +0200 Subject: [PATCH 15/37] Fix filter name. It was not called. --- src/PaymentMethods/Banktransfer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PaymentMethods/Banktransfer.php b/src/PaymentMethods/Banktransfer.php index a34ced8b4..cf49f934b 100644 --- a/src/PaymentMethods/Banktransfer.php +++ b/src/PaymentMethods/Banktransfer.php @@ -82,7 +82,7 @@ public function getFormFields($generalFormFields): array public function filtersOnBuild() { - add_filter('woocommerce_' . $this->getProperty('id') . '_args', function (array $args, \WC_Order $order): array { + add_filter('woocommerce_mollie_wc_gateway_' . $this->getProperty('id') . '_args', function (array $args, \WC_Order $order): array { return $this->addPaymentArguments($args, $order); }, 10, 2); } From 52bf2f25a001fc7475264b67d81e7e2db366ecc8 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 28 Aug 2023 14:31:42 +0200 Subject: [PATCH 16/37] Scope prs and modularity with mozart --- .idea/WooCommerce.iml | 117 ++-- .idea/php.xml | 177 +++--- composer.json | 25 +- composer.lock | 524 +++++++++++++---- lib/README.md | 5 + .../Container/ContainerConfigurator.php | 157 +++++ .../Container/PackageProxyContainer.php | 101 ++++ .../Container/ReadOnlyContainer.php | 142 +++++ .../Modularity/Module/ExecutableModule.php | 21 + .../Modularity/Module/ExtendingModule.php | 24 + .../Modularity/Module/FactoryModule.php | 18 + .../Inpsyde/Modularity/Module/Module.php | 20 + .../Module/ModuleClassNameIdTrait.php | 23 + .../Modularity/Module/ServiceModule.php | 21 + lib/packages/Inpsyde/Modularity/Package.php | 555 ++++++++++++++++++ .../Modularity/Properties/BaseProperties.php | 217 +++++++ .../Properties/LibraryProperties.php | 209 +++++++ .../Properties/PluginProperties.php | 163 +++++ .../Modularity/Properties/Properties.php | 139 +++++ .../Modularity/Properties/ThemeProperties.php | 131 +++++ .../Container/ContainerExceptionInterface.php | 13 + .../Psr/Container/ContainerInterface.php | 37 ++ .../Container/NotFoundExceptionInterface.php | 13 + src/Activation/ActivationModule.php | 3 - src/Assets/AssetsModule.php | 3 +- 25 files changed, 2563 insertions(+), 295 deletions(-) create mode 100644 lib/README.md create mode 100644 lib/packages/Inpsyde/Modularity/Container/ContainerConfigurator.php create mode 100644 lib/packages/Inpsyde/Modularity/Container/PackageProxyContainer.php create mode 100644 lib/packages/Inpsyde/Modularity/Container/ReadOnlyContainer.php create mode 100644 lib/packages/Inpsyde/Modularity/Module/ExecutableModule.php create mode 100644 lib/packages/Inpsyde/Modularity/Module/ExtendingModule.php create mode 100644 lib/packages/Inpsyde/Modularity/Module/FactoryModule.php create mode 100644 lib/packages/Inpsyde/Modularity/Module/Module.php create mode 100644 lib/packages/Inpsyde/Modularity/Module/ModuleClassNameIdTrait.php create mode 100644 lib/packages/Inpsyde/Modularity/Module/ServiceModule.php create mode 100644 lib/packages/Inpsyde/Modularity/Package.php create mode 100644 lib/packages/Inpsyde/Modularity/Properties/BaseProperties.php create mode 100644 lib/packages/Inpsyde/Modularity/Properties/LibraryProperties.php create mode 100644 lib/packages/Inpsyde/Modularity/Properties/PluginProperties.php create mode 100644 lib/packages/Inpsyde/Modularity/Properties/Properties.php create mode 100644 lib/packages/Inpsyde/Modularity/Properties/ThemeProperties.php create mode 100644 lib/packages/Psr/Container/ContainerExceptionInterface.php create mode 100644 lib/packages/Psr/Container/ContainerInterface.php create mode 100644 lib/packages/Psr/Container/NotFoundExceptionInterface.php diff --git a/.idea/WooCommerce.iml b/.idea/WooCommerce.iml index c3c350cf3..067eda272 100644 --- a/.idea/WooCommerce.iml +++ b/.idea/WooCommerce.iml @@ -9,77 +9,80 @@ - - - - - - - + + + + + + + + + + + + + + + + - - - - - - + + + - + + + + + + + + + + + + + + + + - - - - - - - - - - + + + - - + + + + - - - - - - - - - + + + + - - - - + + + - - - - - - - - - - - + + + + + - - - - - - - + + + + + + diff --git a/.idea/php.xml b/.idea/php.xml index 32cb2411d..ae48d7a4d 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -27,124 +27,86 @@ - - - - - - - - - - - + - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -237,6 +199,17 @@ + + + + + + + + + + + diff --git a/composer.json b/composer.json index daca907d6..b1558fb33 100644 --- a/composer.json +++ b/composer.json @@ -20,11 +20,11 @@ "ext-intl": "*", "ext-json": "*", "mollie/mollie-api-php": "^v2.40", - "psr/log":"^1.1.4", - "inpsyde/modularity": "^1.3.0", - "psr/container": "1.0.0" + "psr/log":"^1.1.4" }, "require-dev": { + "inpsyde/modularity": "^1.3.0", + "psr/container": "1.0.0", "phpunit/phpunit": "^8", "brain/monkey": "^2.3", "ptrofimov/xpmock": "^1", @@ -39,7 +39,8 @@ "autoload": { "psr-4": { "Mollie\\WooCommerce\\": "src/", - "Inpsyde\\EnvironmentChecker\\": "pluginEnvironmentChecker" + "Inpsyde\\EnvironmentChecker\\": "pluginEnvironmentChecker", + "Mollie\\WooCommerce\\Vendor\\": "lib/packages/" } }, "autoload-dev": { @@ -72,6 +73,22 @@ "default-env": { "WEBPACK_ENV": "production" } + }, + "hooks": { + "pre-commit": [ + "vendor/bin/phpcbf" + ] + }, + "mozart": { + "dep_namespace": "Mollie\\WooCommerce\\Vendor\\", + "dep_directory": "/lib/packages/", + "classmap_directory": "/lib/classes/", + "classmap_prefix": "MOL_", + "packages": [ + "psr/container", + "inpsyde/modularity" + ], + "delete_vendor_directories": true } }, "config": { diff --git a/composer.lock b/composer.lock index 662f89f23..fe1f5436c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "08ed061076326ed4c72999e92368f69c", + "content-hash": "0c2fbbd6cd339902d138c48e80ccc6c5", "packages": [ { "name": "composer/ca-bundle", @@ -83,79 +83,6 @@ ], "time": "2023-06-06T12:02:59+00:00" }, - { - "name": "inpsyde/modularity", - "version": "1.5.1", - "source": { - "type": "git", - "url": "https://github.com/inpsyde/modularity.git", - "reference": "3bbff6197aabbc4df25b5f386f521bedc71aff2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/inpsyde/modularity/zipball/3bbff6197aabbc4df25b5f386f521bedc71aff2e", - "reference": "3bbff6197aabbc4df25b5f386f521bedc71aff2e", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": ">=7.2", - "psr/container": "~1.0" - }, - "require-dev": { - "brain/monkey": "^2.6.1", - "inpsyde/php-coding-standards": "^1", - "johnpbloch/wordpress-core": ">=5.8", - "mikey179/vfsstream": "^v1.6.10", - "php-stubs/wordpress-stubs": ">=5.8@stable", - "phpunit/phpunit": "^8.5.21", - "vimeo/psalm": "^4.13.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Inpsyde\\Modularity\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Inpsyde GmbH", - "email": "hello@inpsyde.com", - "homepage": "https://inpsyde.com/", - "role": "Company" - }, - { - "name": "Christian Leucht", - "email": "c.leucht@inpsyde.com", - "role": "Developer" - }, - { - "name": "Pablo Kauffman", - "email": "p.kauffman@inpsyde.com", - "role": "Developer" - }, - { - "name": "Giuseppe Mazzapica", - "email": "g.mazzapica@inpsyde.com", - "role": "Developer" - } - ], - "description": "Modular PSR-11 implementation for WordPress plugins, themes or libraries.", - "support": { - "issues": "https://github.com/inpsyde/modularity/issues", - "source": "https://github.com/inpsyde/modularity/tree/1.5.1" - }, - "time": "2022-03-09T13:59:27+00:00" - }, { "name": "mollie/mollie-api-php", "version": "v2.58.0-beta", @@ -248,59 +175,6 @@ }, "time": "2023-06-23T09:10:23+00:00" }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/master" - }, - "time": "2017-02-14T16:28:37+00:00" - }, { "name": "psr/log", "version": "1.1.4", @@ -737,6 +611,63 @@ }, "time": "2023-05-01T16:33:47+00:00" }, + { + "name": "coenjacobs/mozart", + "version": "0.6.0", + "source": { + "type": "git", + "url": "https://github.com/coenjacobs/mozart.git", + "reference": "ac3ff9ed253a575e4e7309379f74424da9a56bd8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/ac3ff9ed253a575e4e7309379f74424da9a56bd8", + "reference": "ac3ff9ed253a575e4e7309379f74424da9a56bd8", + "shasum": "" + }, + "require": { + "league/flysystem": "^1.0", + "php": "^7.2", + "symfony/console": "^4|^5", + "symfony/finder": "^4|^5" + }, + "require-dev": { + "mheap/phpunit-github-actions-printer": "^1.4", + "phpunit/phpunit": "^8.5", + "squizlabs/php_codesniffer": "^3.5" + }, + "bin": [ + "bin/mozart" + ], + "type": "library", + "autoload": { + "psr-4": { + "CoenJacobs\\Mozart\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Coen Jacobs", + "email": "coenjacobs@gmail.com" + } + ], + "description": "Composes all dependencies as a package inside a WordPress plugin", + "support": { + "issues": "https://github.com/coenjacobs/mozart/issues", + "source": "https://github.com/coenjacobs/mozart/tree/0.6.0" + }, + "funding": [ + { + "url": "https://github.com/coenjacobs", + "type": "github" + } + ], + "time": "2021-01-17T15:41:04+00:00" + }, { "name": "composer/package-versions-deprecated", "version": "dev-master", @@ -1487,6 +1418,79 @@ }, "time": "2022-03-07T13:50:29+00:00" }, + { + "name": "inpsyde/modularity", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/inpsyde/modularity.git", + "reference": "3bbff6197aabbc4df25b5f386f521bedc71aff2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/inpsyde/modularity/zipball/3bbff6197aabbc4df25b5f386f521bedc71aff2e", + "reference": "3bbff6197aabbc4df25b5f386f521bedc71aff2e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=7.2", + "psr/container": "~1.0" + }, + "require-dev": { + "brain/monkey": "^2.6.1", + "inpsyde/php-coding-standards": "^1", + "johnpbloch/wordpress-core": ">=5.8", + "mikey179/vfsstream": "^v1.6.10", + "php-stubs/wordpress-stubs": ">=5.8@stable", + "phpunit/phpunit": "^8.5.21", + "vimeo/psalm": "^4.13.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Inpsyde\\Modularity\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Inpsyde GmbH", + "email": "hello@inpsyde.com", + "homepage": "https://inpsyde.com/", + "role": "Company" + }, + { + "name": "Christian Leucht", + "email": "c.leucht@inpsyde.com", + "role": "Developer" + }, + { + "name": "Pablo Kauffman", + "email": "p.kauffman@inpsyde.com", + "role": "Developer" + }, + { + "name": "Giuseppe Mazzapica", + "email": "g.mazzapica@inpsyde.com", + "role": "Developer" + } + ], + "description": "Modular PSR-11 implementation for WordPress plugins, themes or libraries.", + "support": { + "issues": "https://github.com/inpsyde/modularity/issues", + "source": "https://github.com/inpsyde/modularity/tree/1.5.1" + }, + "time": "2022-03-09T13:59:27+00:00" + }, { "name": "inpsyde/php-coding-standards", "version": "dev-master", @@ -1604,6 +1608,156 @@ }, "time": "2023-05-20T04:20:39+00:00" }, + { + "name": "league/flysystem", + "version": "1.1.10", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "league/mime-type-detection": "^1.3", + "php": "^7.2.5 || ^8.0" + }, + "conflict": { + "league/flysystem-sftp": "<1.0.6" + }, + "require-dev": { + "phpspec/prophecy": "^1.11.1", + "phpunit/phpunit": "^8.5.8" + }, + "suggest": { + "ext-ftp": "Allows you to use FTP server storage", + "ext-openssl": "Allows you to use FTPS server storage", + "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", + "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", + "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", + "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", + "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", + "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", + "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", + "league/flysystem-webdav": "Allows you to use WebDAV storage", + "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", + "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", + "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "description": "Filesystem abstraction: Many filesystems, one API.", + "keywords": [ + "Cloud Files", + "WebDAV", + "abstraction", + "aws", + "cloud", + "copy.com", + "dropbox", + "file systems", + "files", + "filesystem", + "filesystems", + "ftp", + "rackspace", + "remote", + "s3", + "sftp", + "storage" + ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/1.1.10" + }, + "funding": [ + { + "url": "https://offset.earth/frankdejonge", + "type": "other" + } + ], + "time": "2022-10-04T09:16:37+00:00" + }, + { + "name": "league/mime-type-detection", + "version": "1.12.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "c7f2872fb273bf493811473dafc88d60ae829f48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/c7f2872fb273bf493811473dafc88d60ae829f48", + "reference": "c7f2872fb273bf493811473dafc88d60ae829f48", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.2", + "phpstan/phpstan": "^0.12.68", + "phpunit/phpunit": "^8.5.8 || ^9.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\MimeTypeDetection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Mime-type detection for Flysystem", + "support": { + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.12.0" + }, + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "time": "2023-08-03T07:14:11+00:00" + }, { "name": "mockery/mockery", "version": "1.3.x-dev", @@ -2711,6 +2865,59 @@ ], "time": "2023-02-27T13:04:50+00:00" }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, + "time": "2017-02-14T16:28:37+00:00" + }, { "name": "ptrofimov/xpmock", "version": "1.1.5", @@ -3757,6 +3964,69 @@ ], "time": "2022-01-02T09:53:40+00:00" }, + { + "name": "symfony/finder", + "version": "v5.4.27", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/ff4bce3c33451e7ec778070e45bd23f74214cd5d", + "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.27" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-07-31T08:02:31+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "v1.27.0", diff --git a/lib/README.md b/lib/README.md new file mode 100644 index 000000000..e25dc2174 --- /dev/null +++ b/lib/README.md @@ -0,0 +1,5 @@ +The packages that are likely to cause conflicts with other plugins (by loading multiple incompatible versions). +Their namespaces are isolated by [Mozart](https://github.com/coenjacobs/mozart). + +Currently, the packages are simply added in the repo to avoid making the build process more complex. +We need to isolate only PSR-11 containers and Inpsyde modularity packages, which are not supposed to change often. diff --git a/lib/packages/Inpsyde/Modularity/Container/ContainerConfigurator.php b/lib/packages/Inpsyde/Modularity/Container/ContainerConfigurator.php new file mode 100644 index 000000000..c7722af4f --- /dev/null +++ b/lib/packages/Inpsyde/Modularity/Container/ContainerConfigurator.php @@ -0,0 +1,157 @@ + + */ + private $services = []; + + /** + * @var array + */ + private $factoryIds = []; + + /** + * @var array> + */ + private $extensions = []; + + /** + * @var ContainerInterface[] + */ + private $containers = []; + + /** + * @var null|ContainerInterface + */ + private $compiledContainer; + + /** + * ContainerConfigurator constructor. + * + * @param ContainerInterface[] $containers + */ + public function __construct(array $containers = []) + { + array_map([$this, 'addContainer'], $containers); + } + + /** + * Allowing to add child containers. + * + * @param ContainerInterface $container + */ + public function addContainer(ContainerInterface $container): void + { + $this->containers[] = $container; + } + + /** + * @param string $id + * @param callable(ContainerInterface $container):mixed $factory + */ + public function addFactory(string $id, callable $factory): void + { + $this->addService($id, $factory); + // We're using a hash table to detect later + // via isset() if a Service as a Factory. + $this->factoryIds[$id] = true; + } + + /** + * @param string $id + * @param callable(ContainerInterface $container):mixed $service + * + * @return void + */ + public function addService(string $id, callable $service): void + { + if ($this->hasService($id)) { + /* + * We are being intentionally permissive here, + * allowing a simple workflow for *intentional* overrides + * while accepting the (small?) risk of *accidental* overrides + * that could be hard to notice and debug. + */ + + /* + * Clear a factory flag in case it was a factory. + * If needs be, it will get re-added after this function completes. + */ + unset($this->factoryIds[$id]); + } + + $this->services[$id] = $service; + } + + /** + * @param string $id + * + * @return bool + */ + public function hasService(string $id): bool + { + if (array_key_exists($id, $this->services)) { + return true; + } + + foreach ($this->containers as $container) { + if ($container->has($id)) { + return true; + } + } + + return false; + } + + /** + * @param string $id + * @param callable(mixed $service, ContainerInterface $container):mixed $extender + * + * @return void + */ + public function addExtension(string $id, callable $extender): void + { + if (!isset($this->extensions[$id])) { + $this->extensions[$id] = []; + } + + $this->extensions[$id][] = $extender; + } + + /** + * @param string $id + * + * @return bool + */ + public function hasExtension(string $id): bool + { + return isset($this->extensions[$id]); + } + + /** + * Returns a read only version of this Container. + * + * @return ContainerInterface + */ + public function createReadOnlyContainer(): ContainerInterface + { + if (!$this->compiledContainer) { + $this->compiledContainer = new ReadOnlyContainer( + $this->services, + $this->factoryIds, + $this->extensions, + $this->containers + ); + } + + return $this->compiledContainer; + } +} diff --git a/lib/packages/Inpsyde/Modularity/Container/PackageProxyContainer.php b/lib/packages/Inpsyde/Modularity/Container/PackageProxyContainer.php new file mode 100644 index 000000000..143b030db --- /dev/null +++ b/lib/packages/Inpsyde/Modularity/Container/PackageProxyContainer.php @@ -0,0 +1,101 @@ +package = $package; + } + + /** + * @param string $id + * @return mixed + * + * @throws \Exception + */ + public function get($id) + { + assert(is_string($id)); + $this->assertPackageBooted($id); + + return $this->container->get($id); + } + + /** + * @param string $id + * @return bool + * + * @throws \Exception + */ + public function has($id) + { + assert(is_string($id)); + + return $this->tryContainer() && $this->container->has($id); + } + + /** + * @return bool + * + * @throws \Exception + * @psalm-assert-if-true ContainerInterface $this->container + */ + private function tryContainer(): bool + { + if ($this->container) { + return true; + } + + if ($this->package->statusIs(Package::STATUS_BOOTED)) { + $this->container = $this->package->container(); + } + + return (bool)$this->container; + } + + /** + * @param string $id + * @return void + * + * @throws \Exception + * + * @psalm-assert ContainerInterface $this->container + */ + private function assertPackageBooted(string $id): void + { + if ($this->tryContainer()) { + return; + } + + $name = $this->package->name(); + $status = $this->package->statusIs(Package::STATUS_FAILED) + ? 'failed booting' + : 'is not booted yet'; + + throw new class ("Error retrieving service {$id} because package {$name} {$status}.") + extends \Exception + implements ContainerExceptionInterface { + }; + } +} diff --git a/lib/packages/Inpsyde/Modularity/Container/ReadOnlyContainer.php b/lib/packages/Inpsyde/Modularity/Container/ReadOnlyContainer.php new file mode 100644 index 000000000..ee082fa0c --- /dev/null +++ b/lib/packages/Inpsyde/Modularity/Container/ReadOnlyContainer.php @@ -0,0 +1,142 @@ + + */ + private $services; + + /** + * @var array + */ + private $factoryIds; + + /** + * @var array> + */ + private $extensions; + + /** + * Resolved factories. + * + * @var array + */ + private $resolvedServices = []; + + /** + * @var ContainerInterface[] + */ + private $containers; + + /** + * ReadOnlyContainer constructor. + * + * @param array $services + * @param array $factoryIds + * @param array> $extensions + * @param ContainerInterface[] $containers + */ + public function __construct( + array $services, + array $factoryIds, + array $extensions, + array $containers + ) { + $this->services = $services; + $this->factoryIds = $factoryIds; + $this->extensions = $extensions; + $this->containers = $containers; + } + + /** + * @param string $id + * + * @return mixed + */ + public function get($id) + { + assert(is_string($id)); + + if (array_key_exists($id, $this->resolvedServices)) { + return $this->resolvedServices[$id]; + } + + if (array_key_exists($id, $this->services)) { + $service = $this->services[$id]($this); + $resolved = $this->resolveExtensions($id, $service); + + if (!isset($this->factoryIds[$id])) { + $this->resolvedServices[$id] = $resolved; + unset($this->services[$id]); + } + + return $resolved; + } + + foreach ($this->containers as $container) { + if ($container->has($id)) { + $service = $container->get($id); + + return $this->resolveExtensions($id, $service); + } + } + + throw new class ("Service with ID {$id} not found.") + extends \Exception + implements NotFoundExceptionInterface { + }; + } + + /** + * @param string $id + * + * @return bool + */ + public function has($id) + { + assert(is_string($id)); + + if (array_key_exists($id, $this->services)) { + return true; + } + + if (array_key_exists($id, $this->resolvedServices)) { + return true; + } + + foreach ($this->containers as $container) { + if ($container->has($id)) { + return true; + } + } + + return false; + } + + /** + * @param string $id + * @param mixed $service + * + * @return mixed + */ + private function resolveExtensions(string $id, $service) + { + if (!isset($this->extensions[$id])) { + return $service; + } + + foreach ($this->extensions[$id] as $extender) { + $service = $extender($service, $this); + } + + return $service; + } +} diff --git a/lib/packages/Inpsyde/Modularity/Module/ExecutableModule.php b/lib/packages/Inpsyde/Modularity/Module/ExecutableModule.php new file mode 100644 index 000000000..ea59bbbf0 --- /dev/null +++ b/lib/packages/Inpsyde/Modularity/Module/ExecutableModule.php @@ -0,0 +1,21 @@ + + */ + public function extensions(): array; +} diff --git a/lib/packages/Inpsyde/Modularity/Module/FactoryModule.php b/lib/packages/Inpsyde/Modularity/Module/FactoryModule.php new file mode 100644 index 000000000..5990547fa --- /dev/null +++ b/lib/packages/Inpsyde/Modularity/Module/FactoryModule.php @@ -0,0 +1,18 @@ + + */ + public function factories(): array; +} diff --git a/lib/packages/Inpsyde/Modularity/Module/Module.php b/lib/packages/Inpsyde/Modularity/Module/Module.php new file mode 100644 index 000000000..7ab5afa7b --- /dev/null +++ b/lib/packages/Inpsyde/Modularity/Module/Module.php @@ -0,0 +1,20 @@ + + */ + public function services(): array; +} diff --git a/lib/packages/Inpsyde/Modularity/Package.php b/lib/packages/Inpsyde/Modularity/Package.php new file mode 100644 index 000000000..72b24d7ee --- /dev/null +++ b/lib/packages/Inpsyde/Modularity/Package.php @@ -0,0 +1,555 @@ + + * $package = Package::new(); + * $package->boot(); + * + * $container = $package->container(); + * $container->has(Package::PROPERTIES); + * $container->get(Package::PROPERTIES); + * + * + * @var string + */ + public const PROPERTIES = 'properties'; + + /** + * Custom action to be used to add Modules to the package. + * It might also be used to access package properties. + * + * @example + * + * $package = Package::new(); + * + * add_action( + * $package->hookName(Package::ACTION_INIT), + * $callback + * ); + * + */ + public const ACTION_INIT = 'init'; + + /** + * Custom action which is triggered after the application + * is booted to access container and properties. + * + * @example + * + * $package = Package::new(); + * + * add_action( + * $package->hookName(Package::ACTION_READY), + * $callback + * ); + * + */ + public const ACTION_READY = 'ready'; + + /** + * Custom action which is triggered when application failed to boot. + * + * @example + * + * $package = Package::new(); + * + * add_action( + * $package->hookName(Package::ACTION_FAILED_BOOT), + * $callback + * ); + * + */ + public const ACTION_FAILED_BOOT = 'failed-boot'; + + /** + * Custom action which is triggered when a package is connected. + */ + public const ACTION_PACKAGE_CONNECTED = 'package-connected'; + + /** + * Custom action which is triggered when a package cannot be connected. + */ + public const ACTION_FAILED_CONNECTION = 'failed-connection'; + + /** + * Module states can be used to get information about your module. + * + * @example + * + * $package = Package::new(); + * $package->moduleIs(SomeModule::class, Package::MODULE_ADDED); // false + * $package->boot(new SomeModule()); + * $package->moduleIs(SomeModule::class, Package::MODULE_ADDED); // true + * + */ + public const MODULE_ADDED = 'added'; + public const MODULE_NOT_ADDED = 'not-added'; + public const MODULE_REGISTERED = 'registered'; + public const MODULE_REGISTERED_FACTORIES = 'registered-factories'; + public const MODULE_EXTENDED = 'extended'; + public const MODULE_EXECUTED = 'executed'; + public const MODULE_EXECUTION_FAILED = 'executed-failed'; + public const MODULES_ALL = '*'; + + /** + * Custom states for the class. + * + * @example + * + * $package = Package::new(); + * $package->statusIs(Package::IDLE); // true + * $package->boot(); + * $package->statusIs(Package::BOOTED); // true + * + */ + public const STATUS_IDLE = 2; + public const STATUS_INITIALIZED = 4; + public const STATUS_BOOTED = 8; + public const STATUS_FAILED = -8; + + /** + * Current state of the application. + * + * @see Package::STATUS_* + * + * @var int + */ + private $status = self::STATUS_IDLE; + + /** + * Contains the progress of all modules. + * + * @see Package::moduleProgress() + * + * @var array> + */ + private $moduleStatus = [self::MODULES_ALL => []]; + + /** + * Hashmap of where keys are names of connected packages, and values are boolean, true + * if connection was successful. + * + * @see Package::connect() + * + * @var array + */ + private $connectedPackages = []; + + /** + * @var list + */ + private $executables = []; + + /** + * @var Properties + */ + private $properties; + + /** + * @var ContainerConfigurator + */ + private $containerConfigurator; + + /** + * @param Properties $properties + * @param ContainerInterface[] $containers + * + * @return Package + */ + public static function new(Properties $properties, ContainerInterface ...$containers): Package + { + return new self($properties, ...$containers); + } + + /** + * @param Properties $properties + * @param ContainerInterface[] $containers + */ + private function __construct(Properties $properties, ContainerInterface ...$containers) + { + $this->properties = $properties; + + $this->containerConfigurator = new ContainerConfigurator($containers); + $this->containerConfigurator->addService( + self::PROPERTIES, + static function () use ($properties) { + return $properties; + } + ); + } + + /** + * @param Module $module + * + * @return static + * @throws \Exception + */ + public function addModule(Module $module): Package + { + $this->assertStatus(self::STATUS_IDLE, 'access Container'); + + $registeredServices = $this->addModuleServices($module, self::MODULE_REGISTERED); + $registeredFactories = $this->addModuleServices($module, self::MODULE_REGISTERED_FACTORIES); + $extended = $this->addModuleServices($module, self::MODULE_EXTENDED); + $isExecutable = $module instanceof ExecutableModule; + + // ExecutableModules are collected and executed on Package::boot() + // when the Container is being compiled. + if ($isExecutable) { + /** @var ExecutableModule $module */ + $this->executables[] = $module; + } + + $added = $registeredServices || $registeredFactories || $extended || $isExecutable; + $status = $added ? self::MODULE_ADDED : self::MODULE_NOT_ADDED; + $this->moduleProgress($module->id(), $status); + + return $this; + } + + /** + * @param Package $package + * @return bool + * @throws \Exception + */ + public function connect(Package $package): bool + { + if (($package === $this)) { + return false; + } + + $packageName = $package->name(); + $errorData = ['package' => $packageName, 'status' => $this->status]; + + // Don't connect, if already connected + if (array_key_exists($packageName, $this->connectedPackages)) { + do_action( + $this->hookName(self::ACTION_FAILED_CONNECTION), + $packageName, + new \WP_Error('already_connected', 'already connected', $errorData) + ); + + return false; + } + + // Don't connect, if already booted or boot failed + if (in_array($this->status, [self::STATUS_BOOTED, self::STATUS_FAILED], true)) { + $this->connectedPackages[$packageName] = false; + do_action( + $this->hookName(self::ACTION_FAILED_CONNECTION), + $packageName, + new \WP_Error('no_connect_status', 'no connect status', $errorData) + ); + + return false; + } + + $this->connectedPackages[$packageName] = true; + + // We put connected package's properties in this package's container, so that in modules + // "run" method we can access them if we need to. + $this->containerConfigurator->addService( + sprintf('%s.%s', $package->name(), self::PROPERTIES), + static function () use ($package): Properties { + return $package->properties(); + } + ); + + // If the other package is booted, we can obtain a container, otherwise + // we build a proxy container + $container = $package->statusIs(self::STATUS_BOOTED) + ? $package->container() + : new PackageProxyContainer($package); + + $this->containerConfigurator->addContainer($container); + + do_action( + $this->hookName(self::ACTION_PACKAGE_CONNECTED), + $packageName, + $this->status, + $container instanceof PackageProxyContainer + ); + + return true; + } + + /** + * @param Module ...$defaultModules + * + * @return bool + * + * @throws \Throwable + */ + public function boot(Module ...$defaultModules): bool + { + try { + // don't allow to boot the application multiple times. + $this->assertStatus(self::STATUS_IDLE, 'execute boot'); + + // Add default Modules to the Application. + array_map([$this, 'addModule'], $defaultModules); + + do_action( + $this->hookName(self::ACTION_INIT), + $this + ); + // we want to lock adding new Modules and Containers now + // to process everything and be able to compile the container. + $this->progress(self::STATUS_INITIALIZED); + + if (count($this->executables) > 0) { + $this->doExecute(); + } + + do_action( + $this->hookName(self::ACTION_READY), + $this + ); + } catch (\Throwable $throwable) { + $this->progress(self::STATUS_FAILED); + do_action($this->hookName(self::ACTION_FAILED_BOOT), $throwable); + + if ($this->properties->isDebug()) { + throw $throwable; + } + + return false; + } + + $this->progress(self::STATUS_BOOTED); + + return true; + } + + /** + * @param Module $module + * @param string $status + * @return bool + */ + private function addModuleServices(Module $module, string $status): bool + { + $services = null; + $addCallback = null; + switch ($status) { + case self::MODULE_REGISTERED: + $services = $module instanceof ServiceModule ? $module->services() : null; + $addCallback = [$this->containerConfigurator, 'addService']; + break; + case self::MODULE_REGISTERED_FACTORIES: + $services = $module instanceof FactoryModule ? $module->factories() : null; + $addCallback = [$this->containerConfigurator, 'addFactory']; + break; + case self::MODULE_EXTENDED: + $services = $module instanceof ExtendingModule ? $module->extensions() : null; + $addCallback = [$this->containerConfigurator, 'addExtension']; + break; + } + + if (!$services) { + return false; + } + + $ids = []; + array_walk( + $services, + static function (callable $service, string $id) use ($addCallback, &$ids) { + /** @var callable(string, callable) $addCallback */ + $addCallback($id, $service); + /** @var list $ids */ + $ids[] = $id; + } + ); + /** @var list $ids */ + $this->moduleProgress($module->id(), $status, $ids); + + return true; + } + + /** + * @return void + * + * @throws \Throwable + */ + private function doExecute(): void + { + foreach ($this->executables as $executable) { + $success = $executable->run($this->container()); + $this->moduleProgress( + $executable->id(), + $success + ? self::MODULE_EXECUTED + : self::MODULE_EXECUTION_FAILED + ); + } + } + + /** + * @param string $moduleId + * @param string $type + * @param list|null $serviceIds + * + * @return void + */ + private function moduleProgress(string $moduleId, string $type, ?array $serviceIds = null) + { + isset($this->moduleStatus[$type]) or $this->moduleStatus[$type] = []; + $this->moduleStatus[$type][] = $moduleId; + + if (!$serviceIds || !$this->properties->isDebug()) { + $this->moduleStatus[self::MODULES_ALL][] = "{$moduleId} {$type}"; + + return; + } + + $description = sprintf('%s %s (%s)', $moduleId, $type, implode(', ', $serviceIds)); + $this->moduleStatus[self::MODULES_ALL][] = $description; + } + + /** + * @return array> + */ + public function modulesStatus(): array + { + return $this->moduleStatus; + } + + /** + * @return array + */ + public function connectedPackages(): array + { + return $this->connectedPackages; + } + + /** + * @param string $packageName + * @return bool + */ + public function isPackageConnected(string $packageName): bool + { + return $this->connectedPackages[$packageName] ?? false; + } + + /** + * @param string $moduleId + * @param string $status + * + * @return bool + */ + public function moduleIs(string $moduleId, string $status): bool + { + return in_array($moduleId, $this->moduleStatus[$status] ?? [], true); + } + + /** + * Return the filter name to be used to extend modules of the plugin. + * + * If the plugin is single file `my-plugin.php` in plugins folder the filter name will be: + * `inpsyde.modularity.my-plugin`. + * + * If the plugin is in a sub-folder e.g. `my-plugin/index.php` the filter name will be: + * `inpsyde.modularity.my-plugin` anyway, so the file name is not relevant. + * + * @param string $suffix + * + * @return string + * @see Package::name() + * + */ + public function hookName(string $suffix = ''): string + { + $filter = self::HOOK_PREFIX . $this->properties->baseName(); + + if ($suffix) { + $filter .= '.' . $suffix; + } + + return $filter; + } + + /** + * @return Properties + */ + public function properties(): Properties + { + return $this->properties; + } + + /** + * @return ContainerInterface + * + * @throws \Exception + */ + public function container(): ContainerInterface + { + $this->assertStatus(self::STATUS_INITIALIZED, 'access Container', '>='); + + return $this->containerConfigurator->createReadOnlyContainer(); + } + + /** + * @return string + */ + public function name(): string + { + return $this->properties->baseName(); + } + + /** + * @param int $status + */ + private function progress(int $status): void + { + $this->status = $status; + } + + /** + * @param int $status + * + * @return bool + */ + public function statusIs(int $status): bool + { + return $this->status === $status; + } + + /** + * @param int $status + * @param string $action + * @param string $operator + * + * @throws \Exception + * @psalm-suppress ArgumentTypeCoercion + */ + private function assertStatus(int $status, string $action, string $operator = '=='): void + { + if (!version_compare((string) $this->status, (string) $status, $operator)) { + throw new \Exception(sprintf("Can't %s at this point of application.", $action)); + } + } +} diff --git a/lib/packages/Inpsyde/Modularity/Properties/BaseProperties.php b/lib/packages/Inpsyde/Modularity/Properties/BaseProperties.php new file mode 100644 index 000000000..11f4be1d6 --- /dev/null +++ b/lib/packages/Inpsyde/Modularity/Properties/BaseProperties.php @@ -0,0 +1,217 @@ +sanitizeBaseName($baseName); + $basePath = (string) trailingslashit($basePath); + if ($baseUrl) { + $baseUrl = (string) trailingslashit($baseUrl); + } + + $this->baseName = $baseName; + $this->basePath = $basePath; + $this->baseUrl = $baseUrl; + $this->properties = array_replace(Properties::DEFAULT_PROPERTIES, $properties); + } + + /** + * @param string $name + * + * @return string + */ + protected function sanitizeBaseName(string $name): string + { + substr_count($name, '/') and $name = dirname($name); + + return strtolower(pathinfo($name, PATHINFO_FILENAME)); + } + + /** + * @return string + */ + public function baseName(): string + { + return $this->baseName; + } + + /** + * @return string + */ + public function basePath(): string + { + return $this->basePath; + } + + /** + * @return string|null + */ + public function baseUrl(): ?string + { + return $this->baseUrl; + } + + /** + * @return string + */ + public function author(): string + { + return (string) $this->get(self::PROP_AUTHOR); + } + + /** + * @return string + */ + public function authorUri(): string + { + return (string) $this->get(self::PROP_AUTHOR_URI); + } + + /** + * @return string + */ + public function description(): string + { + return (string) $this->get(self::PROP_DESCRIPTION); + } + + /** + * @return string + */ + public function textDomain(): string + { + return (string) $this->get(self::PROP_TEXTDOMAIN); + } + + /** + * @return string + */ + public function domainPath(): string + { + return (string) $this->get(self::PROP_DOMAIN_PATH); + } + + /** + * @return string + */ + public function name(): string + { + return (string) $this->get(self::PROP_NAME); + } + + /** + * @return string + */ + public function uri(): string + { + return (string) $this->get(self::PROP_URI); + } + + /** + * @return string + */ + public function version(): string + { + return (string) $this->get(self::PROP_VERSION); + } + + /** + * @return string|null + */ + public function requiresWp(): ?string + { + $value = $this->get(self::PROP_REQUIRES_WP); + + return $value && is_string($value) ? $value : null; + } + + /** + * @return string|null + */ + public function requiresPhp(): ?string + { + $value = $this->get(self::PROP_REQUIRES_PHP); + + return $value && is_string($value) ? $value : null; + } + + /** + * @return array + */ + public function tags(): array + { + return (array) $this->get(self::PROP_TAGS); + } + + /** + * @param string $key + * @param null $default + * @return mixed + */ + public function get(string $key, $default = null) + { + return $this->properties[$key] ?? $default; + } + + /** + * @param string $key + * @return bool + */ + public function has(string $key): bool + { + return isset($this->properties[$key]); + } + + /** + * @return bool + * @see Properties::isDebug() + */ + public function isDebug(): bool + { + if ($this->isDebug === null) { + $this->isDebug = defined('WP_DEBUG') && WP_DEBUG; + } + + return $this->isDebug; + } +} diff --git a/lib/packages/Inpsyde/Modularity/Properties/LibraryProperties.php b/lib/packages/Inpsyde/Modularity/Properties/LibraryProperties.php new file mode 100644 index 000000000..16e10451b --- /dev/null +++ b/lib/packages/Inpsyde/Modularity/Properties/LibraryProperties.php @@ -0,0 +1,209 @@ + 0) { + $properties[self::PROP_AUTHOR] = implode(', ', $names); + } + + // Custom settings which can be stored in composer.json "extra.modularity" + $extra = $composerJsonData['extra']['modularity'] ?? []; + foreach (self::EXTRA_KEYS as $key) { + $properties[$key] = $extra[$key] ?? ''; + } + + // PHP requirement in composer.json "require" or "require-dev" + $properties[self::PROP_REQUIRES_PHP] = self::extractPhpVersion($composerJsonData); + + // composer.json might have "version" in root + $version = $composerJsonData['version'] ?? null; + if ($version && is_string($version)) { + $properties[self::PROP_VERSION] = $version; + } + + [$baseName, $name] = static::buildNames($composerJsonData); + $basePath = dirname($composerJsonFile); + if (empty($properties[self::PROP_NAME])) { + $properties[self::PROP_NAME] = $name; + } + + return new self( + $baseName, + $basePath, + $baseUrl, + $properties + ); + } + + /** + * @param array $composerJsonData + * + * @return array{string, string} + */ + private static function buildNames(array $composerJsonData): array + { + $composerName = (string) ($composerJsonData['name'] ?? ''); + $packageNamePieces = explode('/', $composerName, 2); + $basename = implode('-', $packageNamePieces); + // "inpsyde/foo-bar-baz" => "Inpsyde Foo Bar Baz" + $name = mb_convert_case( + str_replace(['-', '_', '.'], ' ', implode(' ', $packageNamePieces)), + MB_CASE_TITLE + ); + + return [$basename, $name]; + } + + /** + * Check PHP version in require, require-dev. + * + * Attempt to parse requirements to find the _minimum_ accepted version (consistent with WP). + * Composer requirements are parsed in a way that, for example: + * `>=7.2` returns `7.2` + * `^7.3` returns `7.3` + * `5.6 || >= 7.1` returns `5.6` + * `>= 7.1 < 8` returns `7.1` + * + * @param array $composerData + * @param string $key + * + * @return string|null + */ + private static function extractPhpVersion(array $composerData, string $key = 'require'): ?string + { + $nextKey = ($key === 'require') + ? 'require-dev' + : null; + $base = (array) ($composerData[$key] ?? []); + $requirement = $base['php'] ?? null; + $version = ($requirement && is_string($requirement)) + ? trim($requirement) + : null; + if (!$version) { + return $nextKey + ? static::extractPhpVersion($composerData, $nextKey) + : null; + } + + static $matcher; + $matcher or $matcher = static function (string $version): ?string { + $version = trim($version); + if (!$version) { + return null; + } + + // versions range like `>= 7.2.4 < 8` + if (preg_match('{>=?([\s0-9\.]+)<}', $version, $matches)) { + return trim($matches[1], " \t\n\r\0\x0B."); + } + + // aliases like `dev-src#abcde as 7.4` + if (preg_match('{as\s*([\s0-9\.]+)}', $version, $matches)) { + return trim($matches[1], " \t\n\r\0\x0B."); + } + + // Basic requirements like 7.2, >=7.2, ^7.2, ~7.2 + if (preg_match('{^(?:[>=\s~\^]+)?([0-9\.]+)}', $version, $matches)) { + return trim($matches[1], " \t\n\r\0\x0B."); + } + + return null; + }; + + // support for simpler requirements like `7.3`, `>=7.4` or alternative like `5.6 || >=7` + + $alternatives = explode('||', $version); + $found = null; + foreach ($alternatives as $alternative) { + /** @var callable(string):?string $matcher */ + $itemFound = $matcher($alternative); + if ($itemFound && (!$found || version_compare($itemFound, $found, '<'))) { + $found = $itemFound; + } + } + + if ($found) { + return $found; + } + + return $nextKey + ? static::extractPhpVersion($composerData, $nextKey) + : null; + } + + /** + * @param string $url + * + * @return static + * + * @throws \Exception + */ + public function withBaseUrl(string $url): LibraryProperties + { + if ($this->baseUrl !== null) { + throw new \Exception(sprintf('%s::$baseUrl property is not overridable.', __CLASS__)); + } + + $this->baseUrl = trailingslashit($url); + + return $this; + } +} diff --git a/lib/packages/Inpsyde/Modularity/Properties/PluginProperties.php b/lib/packages/Inpsyde/Modularity/Properties/PluginProperties.php new file mode 100644 index 000000000..3c4a7d97f --- /dev/null +++ b/lib/packages/Inpsyde/Modularity/Properties/PluginProperties.php @@ -0,0 +1,163 @@ + 'Author', + self::PROP_AUTHOR_URI => 'AuthorURI', + self::PROP_DESCRIPTION => 'Description', + self::PROP_DOMAIN_PATH => 'DomainPath', + self::PROP_NAME => 'Name', + self::PROP_TEXTDOMAIN => 'TextDomain', + self::PROP_URI => 'PluginURI', + self::PROP_VERSION => 'Version', + self::PROP_REQUIRES_WP => 'RequiresWP', + self::PROP_REQUIRES_PHP => 'RequiresPHP', + + // additional headers + self::PROP_NETWORK => 'Network', + ]; + + /** + * @var string + */ + private $pluginFile; + + /** + * @var bool|null + */ + protected $isMu; + + /** + * @var bool|null + */ + protected $isActive; + + /** + * @var bool|null + */ + protected $isNetworkActive; + + /** + * @param string $pluginMainFile + * + * @return PluginProperties + */ + public static function new(string $pluginMainFile): PluginProperties + { + return new self($pluginMainFile); + } + + /** + * PluginProperties constructor. + * + * @param string $pluginMainFile + */ + protected function __construct(string $pluginMainFile) + { + if (!function_exists('get_plugin_data')) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + + $pluginData = get_plugin_data($pluginMainFile); + $properties = Properties::DEFAULT_PROPERTIES; + + // Map pluginData to internal structure. + foreach (self::HEADERS as $key => $pluginDataKey) { + $properties[$key] = $pluginData[$pluginDataKey] ?? ''; + unset($pluginData[$pluginDataKey]); + } + $properties = array_merge($properties, $pluginData); + + $this->pluginFile = $pluginMainFile; + + $baseName = plugin_basename($pluginMainFile); + $basePath = plugin_dir_path($pluginMainFile); + $baseUrl = plugins_url('/', $pluginMainFile); + + parent::__construct( + $baseName, + $basePath, + $baseUrl, + $properties + ); + } + + /** + * @return bool + * + * @psalm-suppress PossiblyFalseArgument + */ + public function network(): bool + { + return (bool) $this->get(self::PROP_NETWORK, false); + } + + /** + * @return bool + */ + public function isActive(): bool + { + if ($this->isActive === null) { + if (!function_exists('is_plugin_active')) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + $this->isActive = is_plugin_active($this->pluginFile); + } + + return $this->isActive; + } + + /** + * @return bool + */ + public function isNetworkActive(): bool + { + if ($this->isNetworkActive === null) { + if (!function_exists('is_plugin_active_for_network')) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + $this->isNetworkActive = is_plugin_active_for_network($this->pluginFile); + } + + return $this->isNetworkActive; + } + + /** + * @return bool + */ + public function isMuPlugin(): bool + { + if ($this->isMu === null) { + /** + * @psalm-suppress UndefinedConstant + * @psalm-suppress MixedArgument + */ + $muPluginDir = wp_normalize_path(WPMU_PLUGIN_DIR); + $this->isMu = strpos($this->pluginFile, $muPluginDir) === 0; + } + + return $this->isMu; + } +} diff --git a/lib/packages/Inpsyde/Modularity/Properties/Properties.php b/lib/packages/Inpsyde/Modularity/Properties/Properties.php new file mode 100644 index 000000000..995c316cd --- /dev/null +++ b/lib/packages/Inpsyde/Modularity/Properties/Properties.php @@ -0,0 +1,139 @@ + '', + self::PROP_AUTHOR_URI => '', + self::PROP_DESCRIPTION => '', + self::PROP_DOMAIN_PATH => '', + self::PROP_NAME => '', + self::PROP_TEXTDOMAIN => '', + self::PROP_URI => '', + self::PROP_VERSION => '', + self::PROP_REQUIRES_WP => null, + self::PROP_REQUIRES_PHP => null, + self::PROP_TAGS => [], + ]; + + /** + * @param string $key + * @param null $default + * + * @return mixed + */ + public function get(string $key, $default = null); + + /** + * @param string $key + * + * @return bool + */ + public function has(string $key): bool; + + /** + * @return bool + */ + public function isDebug(): bool; + + /** + * @return string + */ + public function baseName(): string; + + /** + * @return string + */ + public function basePath(): string; + + /** + * @return string|null + */ + public function baseUrl(): ?string; + + /** + * @return string + */ + public function author(): string; + + /** + * @return string + */ + public function authorUri(): string; + + /** + * @return string + */ + public function description(): string; + + /** + * @return string + */ + public function textDomain(): string; + + /** + * @return string + */ + public function domainPath(): string; + + /** + * The name of the plugin, theme or library. + * + * @return string + */ + public function name(): string; + + /** + * The home page of the plugin, theme or library. + * @return string + */ + public function uri(): string; + + /** + * @return string + */ + public function version(): string; + + /** + * Optional. Specify the minimum required WordPress version. + * + * @return string|null + */ + public function requiresWp(): ?string; + + /** + * Optional. Specify the minimum required PHP version. + * + * @return string + */ + public function requiresPhp(): ?string; + + /** + * Optional. Currently, only available for Theme and Library. + * Plugins do not have support for "tags"/"keywords" in header. + * + * @link https://developer.wordpress.org/reference/classes/wp_theme/#properties + * @link https://getcomposer.org/doc/04-schema.md#keywords + * + * @return array + */ + public function tags(): array; +} diff --git a/lib/packages/Inpsyde/Modularity/Properties/ThemeProperties.php b/lib/packages/Inpsyde/Modularity/Properties/ThemeProperties.php new file mode 100644 index 000000000..3535c391e --- /dev/null +++ b/lib/packages/Inpsyde/Modularity/Properties/ThemeProperties.php @@ -0,0 +1,131 @@ + 'Author', + self::PROP_AUTHOR_URI => 'Author URI', + self::PROP_DESCRIPTION => 'Description', + self::PROP_DOMAIN_PATH => 'Domain Path', + self::PROP_NAME => 'Theme Name', + self::PROP_TEXTDOMAIN => 'Text Domain', + self::PROP_URI => 'Theme URI', + self::PROP_VERSION => 'Version', + self::PROP_REQUIRES_WP => 'Requires at least', + self::PROP_REQUIRES_PHP => 'Requires PHP', + + // additional headers + self::PROP_STATUS => 'Status', + self::PROP_TAGS => 'Tags', + self::PROP_TEMPLATE => 'Template', + ]; + + /** + * @param string $themeDirectory + * + * @return ThemeProperties + */ + public static function new(string $themeDirectory): ThemeProperties + { + return new self($themeDirectory); + } + + /** + * ThemeProperties constructor. + * + * @param string $themeDirectory + */ + protected function __construct(string $themeDirectory) + { + if (!function_exists('wp_get_theme')) { + require_once ABSPATH . 'wp-includes/theme.php'; + } + + $theme = wp_get_theme($themeDirectory); + $properties = Properties::DEFAULT_PROPERTIES; + + foreach (self::HEADERS as $key => $themeKey) { + /** @psalm-suppress DocblockTypeContradiction */ + $properties[$key] = $theme->get($themeKey) ?? ''; + } + + $baseName = $theme->get_stylesheet(); + $basePath = $theme->get_template_directory(); + $baseUrl = (string) trailingslashit($theme->get_stylesheet_directory_uri()); + + parent::__construct( + $baseName, + $basePath, + $baseUrl, + $properties + ); + } + + /** + * If the theme is published. + * + * @return string + */ + public function status(): string + { + return (string) $this->get(self::PROP_STATUS); + } + + public function template(): string + { + return (string) $this->get(self::PROP_TEMPLATE); + } + + /** + * @return bool + */ + public function isChildTheme(): bool + { + return (bool) $this->template(); + } + + /** + * @return bool + */ + public function isCurrentTheme(): bool + { + return get_stylesheet() === $this->baseName(); + } + + /** + * @return ThemeProperties|null + */ + public function parentThemeProperties(): ?ThemeProperties + { + $template = $this->template(); + if (!$template) { + return null; + } + + $parent = wp_get_theme($template, get_theme_root($template)); + + return static::new($parent->get_template_directory()); + } +} diff --git a/lib/packages/Psr/Container/ContainerExceptionInterface.php b/lib/packages/Psr/Container/ContainerExceptionInterface.php new file mode 100644 index 000000000..0cc7d5e86 --- /dev/null +++ b/lib/packages/Psr/Container/ContainerExceptionInterface.php @@ -0,0 +1,13 @@ + Date: Mon, 28 Aug 2023 14:35:30 +0200 Subject: [PATCH 17/37] Fix CS --- src/Payment/MollieOrder.php | 1 + src/Payment/MolliePayment.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Payment/MollieOrder.php b/src/Payment/MollieOrder.php index 8ae1105a1..7f63813b2 100644 --- a/src/Payment/MollieOrder.php +++ b/src/Payment/MollieOrder.php @@ -159,6 +159,7 @@ public function getPaymentRequestData($order, $customerId, $voucherDefaultCatego if ($cardToken && isset($paymentRequestData['payment'])) { $paymentRequestData['payment']['cardToken'] = $cardToken; } + //phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $applePayToken = wc_clean(wp_unslash($_POST["token"] ?? '')); if ($applePayToken && isset($paymentRequestData['payment'])) { $encodedApplePayToken = json_encode($applePayToken); diff --git a/src/Payment/MolliePayment.php b/src/Payment/MolliePayment.php index f06b2c74c..3d955c79a 100644 --- a/src/Payment/MolliePayment.php +++ b/src/Payment/MolliePayment.php @@ -117,6 +117,7 @@ public function getPaymentRequestData($order, $customerId, $voucherDefaultCatego if ($cardToken) { $paymentRequestData['cardToken'] = $cardToken; } + //phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $applePayToken = wc_clean(wp_unslash($_POST["token"] ?? '')); if ($applePayToken) { $encodedApplePayToken = json_encode($applePayToken); From 99fb5c3ced51bca440772cd58776733cc8846290 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 28 Aug 2023 14:40:53 +0200 Subject: [PATCH 18/37] Fix CS --- src/Assets/AssetsModule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Assets/AssetsModule.php b/src/Assets/AssetsModule.php index 630d7c283..81f413448 100644 --- a/src/Assets/AssetsModule.php +++ b/src/Assets/AssetsModule.php @@ -559,7 +559,7 @@ function (PaymentMethodRegistry $paymentMethodRegistry) use ($dataService, $gate add_action( 'init', - function () use ($hasBlocksEnabled, $settingsHelper, $pluginUrl, $pluginPath) { + function () use ($container, $hasBlocksEnabled, $settingsHelper, $pluginUrl, $pluginPath) { self::registerFrontendScripts($pluginUrl, $pluginPath); // Enqueue Scripts From e926131de14d2324e7b944bd6eb1df2f7045036e Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 28 Aug 2023 14:46:02 +0200 Subject: [PATCH 19/37] Update .lock file --- .idea/php.xml | 20 +++- composer.lock | 294 ++++++++++++++++++++++++-------------------------- 2 files changed, 159 insertions(+), 155 deletions(-) diff --git a/.idea/php.xml b/.idea/php.xml index 32cb2411d..d1c03b3be 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -139,12 +139,17 @@ + + + + + - - + + @@ -237,6 +242,17 @@ + + + + + + + + + + + diff --git a/composer.lock b/composer.lock index 662f89f23..4c4ccd357 100644 --- a/composer.lock +++ b/composer.lock @@ -4,11 +4,11 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "08ed061076326ed4c72999e92368f69c", + "content-hash": "3af0049724d455e70ac6c21785577726", "packages": [ { "name": "composer/ca-bundle", - "version": "dev-main", + "version": "1.3.6", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", @@ -31,7 +31,6 @@ "symfony/phpunit-bridge": "^4.2 || ^5", "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -158,16 +157,16 @@ }, { "name": "mollie/mollie-api-php", - "version": "v2.58.0-beta", + "version": "v2.61.0", "source": { "type": "git", "url": "https://github.com/mollie/mollie-api-php.git", - "reference": "4940ecd1d57ddea6b1ce7ebd98df63e54834aebb" + "reference": "d3ec7a191985aa57bec9b4425a665e95b4ba346a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/4940ecd1d57ddea6b1ce7ebd98df63e54834aebb", - "reference": "4940ecd1d57ddea6b1ce7ebd98df63e54834aebb", + "url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/d3ec7a191985aa57bec9b4425a665e95b4ba346a", + "reference": "d3ec7a191985aa57bec9b4425a665e95b4ba346a", "shasum": "" }, "require": { @@ -244,9 +243,9 @@ ], "support": { "issues": "https://github.com/mollie/mollie-api-php/issues", - "source": "https://github.com/mollie/mollie-api-php/tree/v2.58.0-beta" + "source": "https://github.com/mollie/mollie-api-php/tree/v2.61.0" }, - "time": "2023-06-23T09:10:23+00:00" + "time": "2023-07-31T15:37:46+00:00" }, { "name": "psr/container", @@ -355,16 +354,16 @@ "packages-dev": [ { "name": "amphp/amp", - "version": "2.x-dev", + "version": "v2.6.2", "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "c5ea79065f98f93f7b16a4d5a504fe5d69451447" + "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/c5ea79065f98f93f7b16a4d5a504fe5d69451447", - "reference": "c5ea79065f98f93f7b16a4d5a504fe5d69451447", + "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", + "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", "shasum": "" }, "require": { @@ -432,7 +431,7 @@ "support": { "irc": "irc://irc.freenode.org/amphp", "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/master" + "source": "https://github.com/amphp/amp/tree/v2.6.2" }, "funding": [ { @@ -440,20 +439,20 @@ "type": "github" } ], - "time": "2022-08-21T11:55:21+00:00" + "time": "2022-02-20T17:52:18+00:00" }, { "name": "amphp/byte-stream", - "version": "1.x-dev", + "version": "v1.8.1", "source": { "type": "git", "url": "https://github.com/amphp/byte-stream.git", - "reference": "18f86b65129d923e004df27e2a3d6f4159c3c743" + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/18f86b65129d923e004df27e2a3d6f4159c3c743", - "reference": "18f86b65129d923e004df27e2a3d6f4159c3c743", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", "shasum": "" }, "require": { @@ -497,7 +496,7 @@ } ], "description": "A stream abstraction to make working with non-blocking I/O simple.", - "homepage": "https://amphp.org/byte-stream", + "homepage": "http://amphp.org/byte-stream", "keywords": [ "amp", "amphp", @@ -509,7 +508,7 @@ "support": { "irc": "irc://irc.freenode.org/amphp", "issues": "https://github.com/amphp/byte-stream/issues", - "source": "https://github.com/amphp/byte-stream/tree/master" + "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" }, "funding": [ { @@ -517,7 +516,7 @@ "type": "github" } ], - "time": "2022-06-21T18:19:50+00:00" + "time": "2021-03-30T17:13:30+00:00" }, { "name": "antecedent/patchwork", @@ -668,16 +667,16 @@ }, { "name": "brain/monkey", - "version": "dev-master", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/Brain-WP/BrainMonkey.git", - "reference": "26b83e93933458e7b32614b4e730d1f4b0e53f38" + "reference": "a31c84515bb0d49be9310f52ef1733980ea8ffbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/26b83e93933458e7b32614b4e730d1f4b0e53f38", - "reference": "26b83e93933458e7b32614b4e730d1f4b0e53f38", + "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/a31c84515bb0d49be9310f52ef1733980ea8ffbb", + "reference": "a31c84515bb0d49be9310f52ef1733980ea8ffbb", "shasum": "" }, "require": { @@ -690,12 +689,11 @@ "phpcompatibility/php-compatibility": "^9.3.0", "phpunit/phpunit": "^5.7.26 || ^6.0 || ^7.0 || >=8.0 <8.5.12 || ^8.5.14 || ^9.0" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { "dev-version/1": "1.x-dev", - "dev-master": "2.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -735,11 +733,11 @@ "issues": "https://github.com/Brain-WP/BrainMonkey/issues", "source": "https://github.com/Brain-WP/BrainMonkey" }, - "time": "2023-05-01T16:33:47+00:00" + "time": "2021-11-11T15:53:55+00:00" }, { "name": "composer/package-versions-deprecated", - "version": "dev-master", + "version": "1.11.99.5", "source": { "type": "git", "url": "https://github.com/composer/package-versions-deprecated.git", @@ -763,7 +761,6 @@ "ext-zip": "^1.13", "phpunit/phpunit": "^6.5 || ^7" }, - "default-branch": true, "type": "composer-plugin", "extra": { "class": "PackageVersions\\Installer", @@ -813,7 +810,7 @@ }, { "name": "composer/pcre", - "version": "2.x-dev", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", @@ -864,7 +861,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/2.x" + "source": "https://github.com/composer/pcre/tree/2.1.0" }, "funding": [ { @@ -884,16 +881,16 @@ }, { "name": "composer/semver", - "version": "dev-main", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "fa1ec24f0ab1efe642671ec15c51a3ab879f59bf" + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/fa1ec24f0ab1efe642671ec15c51a3ab879f59bf", - "reference": "fa1ec24f0ab1efe642671ec15c51a3ab879f59bf", + "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", "shasum": "" }, "require": { @@ -903,7 +900,6 @@ "phpstan/phpstan": "^1.4", "symfony/phpunit-bridge": "^4.2 || ^5" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -944,9 +940,9 @@ "versioning" ], "support": { - "irc": "ircs://irc.libera.chat:6697/composer", + "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/main" + "source": "https://github.com/composer/semver/tree/3.3.2" }, "funding": [ { @@ -962,7 +958,7 @@ "type": "tidelift" } ], - "time": "2023-01-13T15:47:53+00:00" + "time": "2022-04-01T19:23:25+00:00" }, { "name": "composer/xdebug-handler", @@ -1144,7 +1140,7 @@ }, { "name": "doctrine/instantiator", - "version": "1.5.x-dev", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", @@ -1259,16 +1255,16 @@ }, { "name": "felixfbecker/language-server-protocol", - "version": "dev-master", + "version": "v1.5.2", "source": { "type": "git", "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "ae4c490773bb0d21ca6f5e08a737506f44e175ea" + "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/ae4c490773bb0d21ca6f5e08a737506f44e175ea", - "reference": "ae4c490773bb0d21ca6f5e08a737506f44e175ea", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/6e82196ffd7c62f7794d778ca52b69feec9f2842", + "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842", "shasum": "" }, "require": { @@ -1279,7 +1275,6 @@ "squizlabs/php_codesniffer": "^3.1", "vimeo/psalm": "^4.0" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -1310,33 +1305,32 @@ ], "support": { "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", - "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/master" + "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.2" }, - "time": "2022-06-19T17:15:06+00:00" + "time": "2022-03-02T22:36:06+00:00" }, { "name": "fzaninotto/faker", - "version": "dev-master", + "version": "v1.9.2", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "5ffe7db6c80f441f150fc88008d64e64af66634b" + "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/5ffe7db6c80f441f150fc88008d64e64af66634b", - "reference": "5ffe7db6c80f441f150fc88008d64e64af66634b", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/848d8125239d7dbf8ab25cb7f054f1a630e68c2e", + "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0 || ^8.0" + "php": "^5.3.3 || ^7.0" }, "require-dev": { "ext-intl": "*", "phpunit/phpunit": "^4.8.35 || ^5.7", "squizlabs/php_codesniffer": "^2.9.2" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -1365,23 +1359,23 @@ ], "support": { "issues": "https://github.com/fzaninotto/Faker/issues", - "source": "https://github.com/fzaninotto/Faker/tree/master" + "source": "https://github.com/fzaninotto/Faker/tree/v1.9.2" }, "abandoned": true, - "time": "2020-12-11T09:59:14+00:00" + "time": "2020-12-11T09:56:16+00:00" }, { "name": "hamcrest/hamcrest-php", - "version": "dev-master", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "d34238d1651eb62fc39ab4efe26df74dc293ebbb" + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/d34238d1651eb62fc39ab4efe26df74dc293ebbb", - "reference": "d34238d1651eb62fc39ab4efe26df74dc293ebbb", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", "shasum": "" }, "require": { @@ -1396,7 +1390,6 @@ "phpunit/php-file-iterator": "^1.4 || ^2.0", "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -1418,9 +1411,9 @@ ], "support": { "issues": "https://github.com/hamcrest/hamcrest-php/issues", - "source": "https://github.com/hamcrest/hamcrest-php/tree/master" + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" }, - "time": "2022-11-06T05:05:05+00:00" + "time": "2020-07-09T08:09:16+00:00" }, { "name": "inpsyde/composer-assets-compiler", @@ -1489,16 +1482,16 @@ }, { "name": "inpsyde/php-coding-standards", - "version": "dev-master", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/inpsyde/php-coding-standards.git", - "reference": "7880c1e0ad1099c5fa8613626ac2544336625327" + "reference": "bab7e00068c2b7a601e3cdce6b0bf6a0ccfe8355" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/inpsyde/php-coding-standards/zipball/7880c1e0ad1099c5fa8613626ac2544336625327", - "reference": "7880c1e0ad1099c5fa8613626ac2544336625327", + "url": "https://api.github.com/repos/inpsyde/php-coding-standards/zipball/bab7e00068c2b7a601e3cdce6b0bf6a0ccfe8355", + "reference": "bab7e00068c2b7a601e3cdce6b0bf6a0ccfe8355", "shasum": "" }, "require": { @@ -1507,14 +1500,13 @@ "dealerdirect/phpcodesniffer-composer-installer": "~0.7.0", "php": ">=7", "phpcompatibility/php-compatibility": "^9.3.5", - "squizlabs/php_codesniffer": "^3.6.0", + "squizlabs/php_codesniffer": "~3.6.0", "wp-coding-standards/wpcs": "^2.3" }, "require-dev": { "phpunit/phpunit": "~6.5.0 || ~9.5.0", "vimeo/psalm": "@stable" }, - "default-branch": true, "type": "phpcodesniffer-standard", "extra": { "branch-alias": { @@ -1547,27 +1539,26 @@ "phpcs", "psr-12", "standards", - "static analysis", "wordpress" ], "support": { "issues": "https://github.com/inpsyde/php-coding-standards/issues", - "source": "https://github.com/inpsyde/php-coding-standards/tree/master" + "source": "https://github.com/inpsyde/php-coding-standards/tree/1.0.0" }, - "time": "2022-12-21T13:29:27+00:00" + "time": "2022-02-28T11:55:53+00:00" }, { "name": "johnpbloch/wordpress-core", - "version": "5.9.x-dev", + "version": "5.9.7", "source": { "type": "git", "url": "https://github.com/johnpbloch/wordpress-core.git", - "reference": "8308d3d36c5a3b4e6693beb6c2751e54f976022a" + "reference": "5fdd25a8f28f480bf58e6e75b141e7d428fa19bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/johnpbloch/wordpress-core/zipball/8308d3d36c5a3b4e6693beb6c2751e54f976022a", - "reference": "8308d3d36c5a3b4e6693beb6c2751e54f976022a", + "url": "https://api.github.com/repos/johnpbloch/wordpress-core/zipball/5fdd25a8f28f480bf58e6e75b141e7d428fa19bb", + "reference": "5fdd25a8f28f480bf58e6e75b141e7d428fa19bb", "shasum": "" }, "require": { @@ -1575,7 +1566,7 @@ "php": ">=5.6.20" }, "provide": { - "wordpress/core-implementation": "5.9.x-dev" + "wordpress/core-implementation": "5.9.7" }, "type": "wordpress-core", "notification-url": "https://packagist.org/downloads/", @@ -1602,11 +1593,11 @@ "source": "https://core.trac.wordpress.org/browser", "wiki": "https://codex.wordpress.org/" }, - "time": "2023-05-20T04:20:39+00:00" + "time": "2023-05-20T04:40:18+00:00" }, { "name": "mockery/mockery", - "version": "1.3.x-dev", + "version": "1.3.6", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", @@ -1669,22 +1660,22 @@ ], "support": { "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.3" + "source": "https://github.com/mockery/mockery/tree/1.3.6" }, "time": "2022-09-07T15:05:49+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.x-dev", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "928a96f585b86224ebc78f8f09d0482cf15b04f5" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/928a96f585b86224ebc78f8f09d0482cf15b04f5", - "reference": "928a96f585b86224ebc78f8f09d0482cf15b04f5", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { @@ -1692,15 +1683,13 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3 <3.2.2" + "doctrine/common": "<2.13.3 || >=3,<3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", - "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, - "default-branch": true, "type": "library", "autoload": { "files": [ @@ -1724,7 +1713,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.x" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { @@ -1732,7 +1721,7 @@ "type": "tidelift" } ], - "time": "2023-03-08T17:24:01+00:00" + "time": "2023-03-08T13:26:56+00:00" }, { "name": "netresearch/jsonmapper", @@ -1787,16 +1776,16 @@ }, { "name": "nikic/php-parser", - "version": "4.x-dev", + "version": "v4.17.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17" + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", "shasum": "" }, "require": { @@ -1807,7 +1796,6 @@ "ircmaxell/php-yacc": "^0.0.7", "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, - "default-branch": true, "bin": [ "bin/php-parse" ], @@ -1838,9 +1826,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" }, - "time": "2023-06-25T14:52:30+00:00" + "time": "2023-08-13T19:53:39+00:00" }, { "name": "openlss/lib-array2xml", @@ -2159,25 +2147,25 @@ }, { "name": "phpdocumentor/reflection-common", - "version": "dev-master", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "a0eeab580cbdf4414fef6978732510a36ed0a9d6" + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/a0eeab580cbdf4414fef6978732510a36ed0a9d6", - "reference": "a0eeab580cbdf4414fef6978732510a36ed0a9d6", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", "shasum": "" }, "require": { - "php": ">=7.1" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-2.x": "2.x-dev" } }, "autoload": { @@ -2206,9 +2194,9 @@ ], "support": { "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master" + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" }, - "time": "2021-06-25T13:47:51+00:00" + "time": "2020-06-27T09:03:43+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -3593,16 +3581,16 @@ }, { "name": "symfony/console", - "version": "v5.4.26", + "version": "v5.4.28", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "b504a3d266ad2bb632f196c0936ef2af5ff6e273" + "reference": "f4f71842f24c2023b91237c72a365306f3c58827" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/b504a3d266ad2bb632f196c0936ef2af5ff6e273", - "reference": "b504a3d266ad2bb632f196c0936ef2af5ff6e273", + "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827", + "reference": "f4f71842f24c2023b91237c72a365306f3c58827", "shasum": "" }, "require": { @@ -3672,7 +3660,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.26" + "source": "https://github.com/symfony/console/tree/v5.4.28" }, "funding": [ { @@ -3688,7 +3676,7 @@ "type": "tidelift" } ], - "time": "2023-07-19T20:11:33+00:00" + "time": "2023-08-07T06:12:30+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3759,16 +3747,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -3783,7 +3771,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3821,7 +3809,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" }, "funding": [ { @@ -3837,20 +3825,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -3862,7 +3850,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3902,7 +3890,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" }, "funding": [ { @@ -3918,20 +3906,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -3943,7 +3931,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3986,7 +3974,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" }, "funding": [ { @@ -4002,20 +3990,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -4030,7 +4018,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4069,7 +4057,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" }, "funding": [ { @@ -4085,20 +4073,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", "shasum": "" }, "require": { @@ -4107,7 +4095,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4148,7 +4136,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" }, "funding": [ { @@ -4164,20 +4152,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -4186,7 +4174,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4231,7 +4219,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" }, "funding": [ { @@ -4247,7 +4235,7 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/service-contracts", From bf965f6ab4b067292625be16a86bace446e6f5d6 Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Tue, 29 Aug 2023 06:08:21 +0200 Subject: [PATCH 20/37] Removed filter from findRefundsByLine method --- src/Payment/MollieOrderService.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Payment/MollieOrderService.php b/src/Payment/MollieOrderService.php index a424eec17..819cbdb40 100644 --- a/src/Payment/MollieOrderService.php +++ b/src/Payment/MollieOrderService.php @@ -608,9 +608,7 @@ protected function findMollieRefunds($payment): array */ protected function findRefundsByLine($payment): array { - return array_filter($payment->_embedded->refunds, static function ($refund) { - return $refund; - }); + return $payment->_embedded->refunds; } /** From 33f6e0a99d4c6ec906f54d1d4a2829299a852d2a Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Tue, 29 Aug 2023 08:33:21 +0200 Subject: [PATCH 21/37] Remove backend Apply pay filter and hide it on the frontend using Apple Pay JS --- resources/js/applepay.js | 44 ++++++++++++++++------------- src/Gateway/GatewayModule.php | 53 ----------------------------------- 2 files changed, 24 insertions(+), 73 deletions(-) diff --git a/resources/js/applepay.js b/resources/js/applepay.js index 9776dbe32..85ba90713 100644 --- a/resources/js/applepay.js +++ b/resources/js/applepay.js @@ -1,27 +1,31 @@ (function (ApplePaySession) { - document.addEventListener('DOMContentLoaded', function () { - var applePayMethodElement = document.querySelector( - '.payment_method_mollie_wc_gateway_applepay', - ) + document.addEventListener('DOMContentLoaded', hideApplyPaymentMethodIfCantPay) + jQuery("body").on("updated_checkout", hideApplyPaymentMethodIfCantPay); - var woocommerceCheckoutForm = document.querySelector( - 'form.woocommerce-checkout', - ) - if (!woocommerceCheckoutForm) { - return - } + function hideApplyPaymentMethodIfCantPay(){ + var applePayMethodElement = document.querySelector( + '.payment_method_mollie_wc_gateway_applepay', + ) - if (!ApplePaySession || !ApplePaySession.canMakePayments()) { - applePayMethodElement && - applePayMethodElement.parentNode.removeChild(applePayMethodElement) - return - } + var woocommerceCheckoutForm = document.querySelector( + 'form.woocommerce-checkout, #order_review' + ) - woocommerceCheckoutForm.insertAdjacentHTML( - 'beforeend', - '', - ) - }) + if (!woocommerceCheckoutForm) { + return + } + + if (!ApplePaySession || !ApplePaySession.canMakePayments()) { + applePayMethodElement && + applePayMethodElement.parentNode.removeChild(applePayMethodElement) + return + } + + woocommerceCheckoutForm.insertAdjacentHTML( + 'beforeend', + '', + ) + } })(window.ApplePaySession) diff --git a/src/Gateway/GatewayModule.php b/src/Gateway/GatewayModule.php index 0bff208ee..6057087fd 100644 --- a/src/Gateway/GatewayModule.php +++ b/src/Gateway/GatewayModule.php @@ -196,7 +196,6 @@ public function run(ContainerInterface $container): bool $mollieGateways = $container->get('gateway.instances'); return array_merge($gateways, $mollieGateways); }); - add_filter('woocommerce_payment_gateways', [$this, 'maybeDisableApplePayGateway'], 20); add_filter('woocommerce_payment_gateways', static function ($gateways) use ($container) { $orderMandatoryGatewayDisabler = $container->get(OrderMandatoryGatewayDisabler::class); assert($orderMandatoryGatewayDisabler instanceof OrderMandatoryGatewayDisabler); @@ -349,58 +348,6 @@ public function maybeDisableBankTransferGateway(?array $gateways): array return $gateways; } - /** - * Disable Apple Pay Gateway - * - * @param ?array $gateways - * @return array - */ - public function maybeDisableApplePayGateway(?array $gateways): array - { - if (!is_array($gateways)) { - return []; - } - $isWcApiRequest = (bool)filter_input(INPUT_GET, 'wc-api', FILTER_SANITIZE_SPECIAL_CHARS); - $wooCommerceSession = mollieWooCommerceSession(); - - /* - * There is only one case where we want to filter the gateway and it's when the checkout - * page render the available payments methods. - * - * For any other case we want to be sure apple pay gateway is included. - */ - if ( - $isWcApiRequest || - !$wooCommerceSession instanceof \WC_Session || - !doing_action('woocommerce_payment_gateways') || - !wp_doing_ajax() && ! is_wc_endpoint_url('order-pay') || - is_admin() - ) { - return $gateways; - } - - if ($wooCommerceSession->get(self::APPLE_PAY_METHOD_ALLOWED_KEY, false)) { - return $gateways; - } - - $applePayGatewayClassName = 'mollie_wc_gateway_applepay'; - // phpcs:ignore - $postData = isset($_POST[self::POST_DATA_KEY]) ? wc_clean(wp_unslash($_POST[self::POST_DATA_KEY])) : ''; - parse_str($postData, $postData); - $applePayAllowed = isset($postData[self::APPLE_PAY_METHOD_ALLOWED_KEY]) - && $postData[self::APPLE_PAY_METHOD_ALLOWED_KEY]; - - if (!$applePayAllowed) { - unset($gateways[$applePayGatewayClassName]); - } - - if ($applePayAllowed) { - $wooCommerceSession->set(self::APPLE_PAY_METHOD_ALLOWED_KEY, true); - } - - return $gateways; - } - public function gatewaySurchargeHandling(Surcharge $surcharge) { new GatewaySurchargeHandler($surcharge); From 142feb2fa4228dc68a608c37364471ef87444552 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Wed, 30 Aug 2023 09:27:13 +0200 Subject: [PATCH 22/37] Update namespaces --- mollie-payments-for-woocommerce.php | 4 ++-- src/Activation/ActivationModule.php | 6 +++--- src/Assets/AssetsModule.php | 6 +++--- src/Gateway/GatewayModule.php | 8 ++++---- src/Gateway/Voucher/VoucherModule.php | 8 ++++---- src/Log/LogModule.php | 6 +++--- src/Notice/NoticeModule.php | 6 +++--- src/Payment/PaymentModule.php | 8 ++++---- src/SDK/SDKModule.php | 8 ++++---- src/Settings/SettingsModule.php | 8 ++++---- src/Shared/SharedModule.php | 8 ++++---- src/Subscription/SubscriptionModule.php | 6 +++--- src/Uninstall/UninstallModule.php | 4 ++-- 13 files changed, 43 insertions(+), 43 deletions(-) diff --git a/mollie-payments-for-woocommerce.php b/mollie-payments-for-woocommerce.php index 7d8b688e4..fa19ad816 100644 --- a/mollie-payments-for-woocommerce.php +++ b/mollie-payments-for-woocommerce.php @@ -19,8 +19,8 @@ namespace Mollie\WooCommerce; -use Inpsyde\Modularity\Package; -use Inpsyde\Modularity\Properties\PluginProperties; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Package; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Properties\PluginProperties; use Mollie\WooCommerce\Activation\ActivationModule; use Mollie\WooCommerce\Activation\ConstraintsChecker; use Mollie\WooCommerce\Assets\AssetsModule; diff --git a/src/Activation/ActivationModule.php b/src/Activation/ActivationModule.php index 7608a0140..27f334424 100644 --- a/src/Activation/ActivationModule.php +++ b/src/Activation/ActivationModule.php @@ -7,11 +7,11 @@ namespace Mollie\WooCommerce\Activation; use Automattic\WooCommerce\Utilities\FeaturesUtil; -use Inpsyde\Modularity\Module\ExecutableModule; -use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ExecutableModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ModuleClassNameIdTrait; use Mollie\WooCommerce\Notice\AdminNotice; use Mollie\WooCommerce\Shared\SharedDataDictionary; -use Psr\Container\ContainerInterface; +use Mollie\WooCommerce\Vendor\Psr\Container\ContainerInterface; class ActivationModule implements ExecutableModule { diff --git a/src/Assets/AssetsModule.php b/src/Assets/AssetsModule.php index 8de1b7702..72c64a506 100644 --- a/src/Assets/AssetsModule.php +++ b/src/Assets/AssetsModule.php @@ -7,15 +7,15 @@ namespace Mollie\WooCommerce\Assets; use Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry; -use Inpsyde\Modularity\Module\ExecutableModule; -use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ExecutableModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ModuleClassNameIdTrait; use Mollie\Api\Exceptions\ApiException; use Mollie\WooCommerce\Buttons\ApplePayButton\DataToAppleButtonScripts; use Mollie\WooCommerce\Buttons\PayPalButton\DataToPayPal; use Mollie\WooCommerce\Components\AcceptedLocaleValuesDictionary; use Mollie\WooCommerce\Settings\Settings; use Mollie\WooCommerce\Shared\Data; -use Psr\Container\ContainerInterface; +use Mollie\WooCommerce\Vendor\Psr\Container\ContainerInterface; class AssetsModule implements ExecutableModule { diff --git a/src/Gateway/GatewayModule.php b/src/Gateway/GatewayModule.php index 0bff208ee..5d0587dab 100644 --- a/src/Gateway/GatewayModule.php +++ b/src/Gateway/GatewayModule.php @@ -6,9 +6,9 @@ namespace Mollie\WooCommerce\Gateway; -use Inpsyde\Modularity\Module\ExecutableModule; -use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; -use Inpsyde\Modularity\Module\ServiceModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ExecutableModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ServiceModule; use Mollie\WooCommerce\BlockService\CheckoutBlockService; use Mollie\WooCommerce\Buttons\ApplePayButton\AppleAjaxRequests; use Mollie\WooCommerce\Buttons\ApplePayButton\ApplePayDirectHandler; @@ -37,7 +37,7 @@ use Mollie\WooCommerce\Subscription\MollieSepaRecurringGateway; use Mollie\WooCommerce\Subscription\MollieSubscriptionGateway; use Mollie\WooCommerce\PaymentMethods\Constants; -use Psr\Container\ContainerInterface; +use Mollie\WooCommerce\Vendor\Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface as Logger; class GatewayModule implements ServiceModule, ExecutableModule diff --git a/src/Gateway/Voucher/VoucherModule.php b/src/Gateway/Voucher/VoucherModule.php index 562755551..58774d8b8 100644 --- a/src/Gateway/Voucher/VoucherModule.php +++ b/src/Gateway/Voucher/VoucherModule.php @@ -22,11 +22,11 @@ namespace Mollie\WooCommerce\Gateway\Voucher; -use Inpsyde\Modularity\Module\ExecutableModule; -use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; -use Inpsyde\Modularity\Module\ServiceModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ExecutableModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ServiceModule; use Mollie\WooCommerce\PaymentMethods\Voucher; -use Psr\Container\ContainerInterface; +use Mollie\WooCommerce\Vendor\Psr\Container\ContainerInterface; class VoucherModule implements ExecutableModule, ServiceModule { diff --git a/src/Log/LogModule.php b/src/Log/LogModule.php index 8159f5daf..4483f692f 100644 --- a/src/Log/LogModule.php +++ b/src/Log/LogModule.php @@ -6,9 +6,9 @@ namespace Mollie\WooCommerce\Log; -use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; -use Inpsyde\Modularity\Module\ServiceModule; -use Psr\Container\ContainerInterface; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ServiceModule; +use Mollie\WooCommerce\Vendor\Psr\Container\ContainerInterface; use Psr\Log\AbstractLogger; use Psr\Log\LoggerInterface as Logger; use Psr\Log\NullLogger; diff --git a/src/Notice/NoticeModule.php b/src/Notice/NoticeModule.php index 8889b2c20..b789445b2 100644 --- a/src/Notice/NoticeModule.php +++ b/src/Notice/NoticeModule.php @@ -6,10 +6,10 @@ namespace Mollie\WooCommerce\Notice; -use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; -use Inpsyde\Modularity\Module\ServiceModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ServiceModule; use Mollie\WooCommerce\Notice\AdminNotice; -use Psr\Container\ContainerInterface; +use Mollie\WooCommerce\Vendor\Psr\Container\ContainerInterface; use Mollie\WooCommerce\Notice\NoticeInterface as Notice; class NoticeModule implements ServiceModule diff --git a/src/Payment/PaymentModule.php b/src/Payment/PaymentModule.php index 1bdef2705..884a3d4bc 100644 --- a/src/Payment/PaymentModule.php +++ b/src/Payment/PaymentModule.php @@ -6,9 +6,9 @@ namespace Mollie\WooCommerce\Payment; -use Inpsyde\Modularity\Module\ExecutableModule; -use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; -use Inpsyde\Modularity\Module\ServiceModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ExecutableModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ServiceModule; use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Resources\Refund; use Mollie\WooCommerce\Gateway\MolliePaymentGateway; @@ -18,7 +18,7 @@ use Mollie\WooCommerce\Settings\Settings; use Mollie\WooCommerce\Shared\Data; use Mollie\WooCommerce\Shared\SharedDataDictionary; -use Psr\Container\ContainerInterface; +use Mollie\WooCommerce\Vendor\Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface as Logger; use Psr\Log\LogLevel; use RuntimeException; diff --git a/src/SDK/SDKModule.php b/src/SDK/SDKModule.php index 7ade0a005..4544b6644 100644 --- a/src/SDK/SDKModule.php +++ b/src/SDK/SDKModule.php @@ -6,15 +6,15 @@ namespace Mollie\WooCommerce\SDK; -use Inpsyde\Modularity\Module\ExecutableModule; -use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; -use Inpsyde\Modularity\Module\ServiceModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ExecutableModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ServiceModule; use Mollie\Api\Resources\Refund; use Mollie\WooCommerce\Gateway\AbstractGateway; use Mollie\WooCommerce\Notice\AdminNotice; use Mollie\WooCommerce\Plugin; use Mollie\WooCommerce\SDK\HttpResponse; -use Psr\Container\ContainerInterface; +use Mollie\WooCommerce\Vendor\Psr\Container\ContainerInterface; class SDKModule implements ExecutableModule, ServiceModule { diff --git a/src/Settings/SettingsModule.php b/src/Settings/SettingsModule.php index 5cac11b53..9dffc59c2 100644 --- a/src/Settings/SettingsModule.php +++ b/src/Settings/SettingsModule.php @@ -6,16 +6,16 @@ namespace Mollie\WooCommerce\Settings; -use Inpsyde\Modularity\Module\ExecutableModule; -use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; -use Inpsyde\Modularity\Module\ServiceModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ExecutableModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ServiceModule; use Mollie\WooCommerce\Notice\AdminNotice; use Mollie\WooCommerce\SDK\Api; use Mollie\WooCommerce\Settings\Page\MollieSettingsPage; use Mollie\WooCommerce\Shared\Data; use Mollie\WooCommerce\Shared\Status; use Mollie\WooCommerce\Uninstall\CleanDb; -use Psr\Container\ContainerInterface; +use Mollie\WooCommerce\Vendor\Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface as Logger; class SettingsModule implements ServiceModule, ExecutableModule diff --git a/src/Shared/SharedModule.php b/src/Shared/SharedModule.php index 40f62690c..8298c565c 100644 --- a/src/Shared/SharedModule.php +++ b/src/Shared/SharedModule.php @@ -6,12 +6,12 @@ namespace Mollie\WooCommerce\Shared; -use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; -use Inpsyde\Modularity\Module\ServiceModule; -use Inpsyde\Modularity\Package; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ServiceModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Package; use Mollie\Api\CompatibilityChecker; use Mollie\WooCommerce\SDK\Api; -use Psr\Container\ContainerInterface; +use Mollie\WooCommerce\Vendor\Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface as Logger; class SharedModule implements ServiceModule diff --git a/src/Subscription/SubscriptionModule.php b/src/Subscription/SubscriptionModule.php index a6ca51ffb..71511e286 100644 --- a/src/Subscription/SubscriptionModule.php +++ b/src/Subscription/SubscriptionModule.php @@ -7,13 +7,13 @@ namespace Mollie\WooCommerce\Subscription; use DateTime; -use Inpsyde\Modularity\Module\ExecutableModule; -use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ExecutableModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ModuleClassNameIdTrait; use Mollie\WooCommerce\Gateway\MolliePaymentGateway; use Mollie\WooCommerce\Settings\Settings; use Mollie\WooCommerce\Shared\Data; use Mollie\WooCommerce\Shared\SharedDataDictionary; -use Psr\Container\ContainerInterface; +use Mollie\WooCommerce\Vendor\Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface as Logger; use Psr\Log\LogLevel; diff --git a/src/Uninstall/UninstallModule.php b/src/Uninstall/UninstallModule.php index 0cf437cdd..d5b343098 100644 --- a/src/Uninstall/UninstallModule.php +++ b/src/Uninstall/UninstallModule.php @@ -6,8 +6,8 @@ namespace Mollie\WooCommerce\Uninstall; -use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; -use Inpsyde\Modularity\Module\ServiceModule; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ServiceModule; use Mollie\WooCommerce\Shared\SharedDataDictionary; class UninstallModule implements ServiceModule From 0af4f3b71f45cd9c354f28c3fd8c5611b9cd150b Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Wed, 30 Aug 2023 09:27:55 +0200 Subject: [PATCH 23/37] Update composer after removing mozart --- .idea/WooCommerce.iml | 124 ++++++++++--------- .idea/php.xml | 131 ++++++++++---------- composer.lock | 272 +----------------------------------------- 3 files changed, 122 insertions(+), 405 deletions(-) diff --git a/.idea/WooCommerce.iml b/.idea/WooCommerce.iml index 067eda272..9aa75e6b5 100644 --- a/.idea/WooCommerce.iml +++ b/.idea/WooCommerce.iml @@ -9,80 +9,76 @@ - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + - + + + + + - - - - + - - - - - - - - - - + + + + - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/php.xml b/.idea/php.xml index 2715df582..1df2b9763 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -27,85 +27,76 @@ - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + - + + + + + - - - - + - - - - - - - - - - + + + + - - - - - + + + + + + + + + + + + + + + + + + + - - - - - + @@ -237,4 +228,4 @@ - + \ No newline at end of file diff --git a/composer.lock b/composer.lock index 88f633f10..f905d204a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0c2fbbd6cd339902d138c48e80ccc6c5", + "content-hash": "99dd93462bdd098a3d12154b8e71b543", "packages": [ { "name": "composer/ca-bundle", @@ -609,63 +609,6 @@ }, "time": "2021-11-11T15:53:55+00:00" }, - { - "name": "coenjacobs/mozart", - "version": "0.6.0", - "source": { - "type": "git", - "url": "https://github.com/coenjacobs/mozart.git", - "reference": "ac3ff9ed253a575e4e7309379f74424da9a56bd8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/ac3ff9ed253a575e4e7309379f74424da9a56bd8", - "reference": "ac3ff9ed253a575e4e7309379f74424da9a56bd8", - "shasum": "" - }, - "require": { - "league/flysystem": "^1.0", - "php": "^7.2", - "symfony/console": "^4|^5", - "symfony/finder": "^4|^5" - }, - "require-dev": { - "mheap/phpunit-github-actions-printer": "^1.4", - "phpunit/phpunit": "^8.5", - "squizlabs/php_codesniffer": "^3.5" - }, - "bin": [ - "bin/mozart" - ], - "type": "library", - "autoload": { - "psr-4": { - "CoenJacobs\\Mozart\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Coen Jacobs", - "email": "coenjacobs@gmail.com" - } - ], - "description": "Composes all dependencies as a package inside a WordPress plugin", - "support": { - "issues": "https://github.com/coenjacobs/mozart/issues", - "source": "https://github.com/coenjacobs/mozart/tree/0.6.0" - }, - "funding": [ - { - "url": "https://github.com/coenjacobs", - "type": "github" - } - ], - "time": "2021-01-17T15:41:04+00:00" - }, { "name": "composer/package-versions-deprecated", "version": "1.11.99.5", @@ -1599,156 +1542,6 @@ }, "time": "2023-05-20T04:40:18+00:00" }, - { - "name": "league/flysystem", - "version": "1.1.10", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/flysystem.git", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "league/mime-type-detection": "^1.3", - "php": "^7.2.5 || ^8.0" - }, - "conflict": { - "league/flysystem-sftp": "<1.0.6" - }, - "require-dev": { - "phpspec/prophecy": "^1.11.1", - "phpunit/phpunit": "^8.5.8" - }, - "suggest": { - "ext-ftp": "Allows you to use FTP server storage", - "ext-openssl": "Allows you to use FTPS server storage", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "League\\Flysystem\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frenky.net" - } - ], - "description": "Filesystem abstraction: Many filesystems, one API.", - "keywords": [ - "Cloud Files", - "WebDAV", - "abstraction", - "aws", - "cloud", - "copy.com", - "dropbox", - "file systems", - "files", - "filesystem", - "filesystems", - "ftp", - "rackspace", - "remote", - "s3", - "sftp", - "storage" - ], - "support": { - "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/1.1.10" - }, - "funding": [ - { - "url": "https://offset.earth/frankdejonge", - "type": "other" - } - ], - "time": "2022-10-04T09:16:37+00:00" - }, - { - "name": "league/mime-type-detection", - "version": "1.12.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "c7f2872fb273bf493811473dafc88d60ae829f48" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/c7f2872fb273bf493811473dafc88d60ae829f48", - "reference": "c7f2872fb273bf493811473dafc88d60ae829f48", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.2", - "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "League\\MimeTypeDetection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frankdejonge.nl" - } - ], - "description": "Mime-type detection for Flysystem", - "support": { - "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.12.0" - }, - "funding": [ - { - "url": "https://github.com/frankdejonge", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/flysystem", - "type": "tidelift" - } - ], - "time": "2023-08-03T07:14:11+00:00" - }, { "name": "mockery/mockery", "version": "1.3.6", @@ -3952,69 +3745,6 @@ ], "time": "2022-01-02T09:53:40+00:00" }, - { - "name": "symfony/finder", - "version": "v5.4.27", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ff4bce3c33451e7ec778070e45bd23f74214cd5d", - "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.27" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-07-31T08:02:31+00:00" - }, { "name": "symfony/polyfill-ctype", "version": "v1.28.0", From e5e0175b819ac67a2a3b085ec5a3ab7cbf990b1b Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Mon, 4 Sep 2023 13:12:17 +0200 Subject: [PATCH 24/37] Generate data for Sepa direct payment if the user is on administration pages. --- src/Assets/MollieCheckoutBlocksSupport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Assets/MollieCheckoutBlocksSupport.php b/src/Assets/MollieCheckoutBlocksSupport.php index c9be81b67..ef60d24ca 100644 --- a/src/Assets/MollieCheckoutBlocksSupport.php +++ b/src/Assets/MollieCheckoutBlocksSupport.php @@ -100,7 +100,7 @@ private function gatewayDataForWCBlocks(Data $dataService, array $gatewayInstanc $gatewayId = is_string($gateway->paymentMethod()->getProperty('id')) ? $gateway->paymentMethod( )->getProperty('id') : ""; - if ($gateway->enabled !== 'yes' || $gatewayId === 'directdebit') { + if ($gateway->enabled !== 'yes' || ($gatewayId === 'directdebit' && !is_admin())) { continue; } $content = $gateway->paymentMethod()->getProcessedDescriptionForBlock(); From b1a2a59ddddd51a8398c1c5a6a49bd5791d9b153 Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Mon, 4 Sep 2023 14:09:11 +0200 Subject: [PATCH 25/37] Limit gateway image to dimension 32x24px. --- resources/scss/mollie-gateway-icons.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/scss/mollie-gateway-icons.scss b/resources/scss/mollie-gateway-icons.scss index f57701889..802d93db2 100644 --- a/resources/scss/mollie-gateway-icons.scss +++ b/resources/scss/mollie-gateway-icons.scss @@ -1,9 +1,10 @@ .mollie-gateway-icon { vertical-align: bottom; - height: 24px; } label .mollie-gateway-icon{ float:right; + max-width: 32px; + max-height: 24px; } .mollie-gateway-icon svg{ float:right; From 2aee9f78de3a4cd0669ba151903a794297fcb35d Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Wed, 6 Sep 2023 09:24:01 +0200 Subject: [PATCH 26/37] Update namespace. --- uninstall.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uninstall.php b/uninstall.php index c4f9a4e4f..4874afb8a 100644 --- a/uninstall.php +++ b/uninstall.php @@ -4,8 +4,8 @@ namespace Mollie\WooCommerce; -use Inpsyde\Modularity\Package; -use Inpsyde\Modularity\Properties\PluginProperties; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Package; +use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Properties\PluginProperties; use Mollie\WooCommerce\Uninstall\CleanDb; use Mollie\WooCommerce\Uninstall\UninstallModule; use Throwable; From 2019926ed1cd2f4e0272b7997376e7e4750616b8 Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Fri, 8 Sep 2023 09:41:12 +0200 Subject: [PATCH 27/37] Fix bug that was causing the code to skip payment method filters. --- src/Assets/AssetsModule.php | 78 +++++++++++++--------- src/Assets/MollieCheckoutBlocksSupport.php | 31 ++++++--- 2 files changed, 70 insertions(+), 39 deletions(-) diff --git a/src/Assets/AssetsModule.php b/src/Assets/AssetsModule.php index 9cd245798..89d471761 100644 --- a/src/Assets/AssetsModule.php +++ b/src/Assets/AssetsModule.php @@ -32,7 +32,10 @@ public function enqueueBlockCheckoutScripts(Data $dataService, array $gatewayIns if (!has_block('woocommerce/checkout')) { return; } + wp_enqueue_script(MollieCheckoutBlocksSupport::getScriptHandle()); wp_enqueue_style('mollie-gateway-icons'); + + MollieCheckoutBlocksSupport::localizeWCBlocksData($dataService, $gatewayInstances); } public function registerButtonsBlockScripts(string $pluginUrl, string $pluginPath): void @@ -49,7 +52,7 @@ public function registerButtonsBlockScripts(string $pluginUrl, string $pluginPat '/public/js/paypalButtonBlockComponent.min.js' ), [], - (string) filemtime( + (string)filemtime( $this->getPluginPath( $pluginPath, '/public/js/paypalButtonBlockComponent.min.js' @@ -73,7 +76,7 @@ public function registerButtonsBlockScripts(string $pluginUrl, string $pluginPat '/public/js/applepayButtonBlockComponent.min.js' ), [], - (string) filemtime( + (string)filemtime( $this->getPluginPath( $pluginPath, '/public/js/applepayButtonBlockComponent.min.js' @@ -183,7 +186,7 @@ protected function registerFrontendScripts(string $pluginUrl, string $pluginPath 'babel-polyfill', $this->getPluginUrl($pluginUrl, '/public/js/babel-polyfill.min.js'), [], - (string) filemtime($this->getPluginPath($pluginPath, '/public/js/babel-polyfill.min.js')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/js/babel-polyfill.min.js')), true ); @@ -191,56 +194,56 @@ protected function registerFrontendScripts(string $pluginUrl, string $pluginPath 'mollie_wc_gateway_applepay', $this->getPluginUrl($pluginUrl, '/public/js/applepay.min.js'), [], - (string) filemtime($this->getPluginPath($pluginPath, '/public/js/applepay.min.js')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/js/applepay.min.js')), true ); wp_register_style( 'mollie-gateway-icons', $this->getPluginUrl($pluginUrl, '/public/css/mollie-gateway-icons.min.css'), [], - (string) filemtime($this->getPluginPath($pluginPath, '/public/css/mollie-gateway-icons.min.css')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/css/mollie-gateway-icons.min.css')), 'screen' ); wp_register_style( 'mollie-components', $this->getPluginUrl($pluginUrl, '/public/css/mollie-components.min.css'), [], - (string) filemtime($this->getPluginPath($pluginPath, '/public/css/mollie-components.min.css')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/css/mollie-components.min.css')), 'screen' ); wp_register_style( 'mollie-applepaydirect', $this->getPluginUrl($pluginUrl, '/public/css/mollie-applepaydirect.min.css'), [], - (string) filemtime($this->getPluginPath($pluginPath, '/public/css/mollie-applepaydirect.min.css')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/css/mollie-applepaydirect.min.css')), 'screen' ); wp_register_script( 'mollie_applepaydirect', $this->getPluginUrl($pluginUrl, '/public/js/applepayDirect.min.js'), ['underscore', 'jquery'], - (string) filemtime($this->getPluginPath($pluginPath, '/public/js/applepayDirect.min.js')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/js/applepayDirect.min.js')), true ); wp_register_script( 'mollie_paypalButton', $this->getPluginUrl($pluginUrl, '/public/js/paypalButton.min.js'), ['underscore', 'jquery'], - (string) filemtime($this->getPluginPath($pluginPath, '/public/js/paypalButton.min.js')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/js/paypalButton.min.js')), true ); wp_register_script( 'mollie_paypalButtonCart', $this->getPluginUrl($pluginUrl, '/public/js/paypalButtonCart.min.js'), ['underscore', 'jquery'], - (string) filemtime($this->getPluginPath($pluginPath, '/public/js/paypalButtonCart.min.js')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/js/paypalButtonCart.min.js')), true ); wp_register_script( 'mollie_applepaydirectCart', $this->getPluginUrl($pluginUrl, '/public/js/applepayDirectCart.min.js'), ['underscore', 'jquery'], - (string) filemtime($this->getPluginPath($pluginPath, '/public/js/applepayDirectCart.min.js')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/js/applepayDirectCart.min.js')), true ); wp_register_script('mollie', 'https://js.mollie.com/v1/mollie.js', [], date("d"), true); @@ -248,14 +251,14 @@ protected function registerFrontendScripts(string $pluginUrl, string $pluginPath 'mollie-components', $this->getPluginUrl($pluginUrl, '/public/js/mollie-components.min.js'), ['underscore', 'jquery', 'mollie', 'babel-polyfill'], - (string) filemtime($this->getPluginPath($pluginPath, '/public/js/mollie-components.min.js')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/js/mollie-components.min.js')), true ); wp_register_script( 'mollie-components-blocks', $this->getPluginUrl($pluginUrl, '/public/js/mollie-components-blocks.min.js'), ['underscore', 'jquery', 'mollie', 'babel-polyfill'], - (string) filemtime($this->getPluginPath($pluginPath, '/public/js/mollie-components-blocks.min.js')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/js/mollie-components-blocks.min.js')), true ); @@ -263,40 +266,39 @@ protected function registerFrontendScripts(string $pluginUrl, string $pluginPath 'unabledButton', $this->getPluginUrl($pluginUrl, '/public/css/unabledButton.min.css'), [], - (string) filemtime($this->getPluginPath($pluginPath, '/public/css/unabledButton.min.css')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/css/unabledButton.min.css')), 'screen' ); wp_register_script( 'gatewaySurcharge', $this->getPluginUrl($pluginUrl, '/public/js/gatewaySurcharge.min.js'), ['underscore', 'jquery'], - (string) filemtime($this->getPluginPath($pluginPath, '/public/js/gatewaySurcharge.min.js')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/js/gatewaySurcharge.min.js')), true ); wp_register_script( 'mollie-billie-classic-handles', $this->getPluginUrl($pluginUrl, '/public/js/mollieBillie.min.js'), ['underscore', 'jquery'], - (string) filemtime($this->getPluginPath($pluginPath, '/public/js/mollieBillie.min.js')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/js/mollieBillie.min.js')), true ); wp_register_script( 'mollie-in3-classic-handles', $this->getPluginUrl($pluginUrl, '/public/js/mollieIn3.min.js'), ['underscore', 'jquery'], - (string) filemtime($this->getPluginPath($pluginPath, '/public/js/mollieIn3.min.js')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/js/mollieIn3.min.js')), true ); } public function registerBlockScripts(string $pluginUrl, string $pluginPath): void { - wp_register_script( 'mollie_block_index', $this->getPluginUrl($pluginUrl, '/public/js/mollieBlockIndex.min.js'), ['wc-blocks-registry', 'underscore', 'jquery'], - (string) filemtime($this->getPluginPath($pluginPath, '/public/js/mollieBlockIndex.min.js')), + (string)filemtime($this->getPluginPath($pluginPath, '/public/js/mollieBlockIndex.min.js')), true ); } @@ -357,7 +359,7 @@ public function enqueueComponentsAssets(Settings $settingsHelper): void } $locale = get_locale(); - $locale = str_replace('_formal', '', $locale); + $locale = str_replace('_formal', '', $locale); $allowedLocaleValues = AcceptedLocaleValuesDictionary::ALLOWED_LOCALES_KEYS_MAP; if (!in_array($locale, $allowedLocaleValues, true)) { $locale = AcceptedLocaleValuesDictionary::DEFAULT_LOCALE_VALUE; @@ -436,7 +438,10 @@ protected function getPluginPath(string $pluginPath, string $path = ''): string */ protected function enqueueIconSettings(?string $current_section): void { - $uri = isset($_SERVER['REQUEST_URI']) ? wc_clean(wp_unslash($_SERVER['REQUEST_URI'])) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + $uri = isset($_SERVER['REQUEST_URI']) ? wc_clean( + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + wp_unslash($_SERVER['REQUEST_URI']) + ) : ''; if (is_string($uri) && strpos($uri, 'tab=mollie_settings')) { wp_enqueue_style('mollie-gateway-icons'); } @@ -534,16 +539,27 @@ protected function setupModuleActions(ContainerInterface $container): void add_action( 'woocommerce_blocks_loaded', function () use ($dataService, $gatewayInstances, $pluginUrl, $pluginPath, $hasBlocksEnabled) { - if ($hasBlocksEnabled && class_exists('Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType')) { + if ( + $hasBlocksEnabled && is_admin() && class_exists( + 'Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' + ) + ) { add_action( 'woocommerce_blocks_payment_method_type_registration', - function (PaymentMethodRegistry $paymentMethodRegistry) use ($dataService, $gatewayInstances, $pluginUrl, $pluginPath) { + function (PaymentMethodRegistry $paymentMethodRegistry) use ( + $dataService, + $gatewayInstances, + $pluginUrl, + $pluginPath + ) { $paymentMethodRegistry->register( new MollieCheckoutBlocksSupport( $dataService, $gatewayInstances, $this->getPluginUrl($pluginUrl, '/public/js/mollieBlockIndex.min.js'), - (string) filemtime($this->getPluginPath($pluginPath, '/public/js/mollieBlockIndex.min.js')) + (string)filemtime( + $this->getPluginPath($pluginPath, '/public/js/mollieBlockIndex.min.js') + ) ) ); } @@ -554,7 +570,7 @@ function (PaymentMethodRegistry $paymentMethodRegistry) use ($dataService, $gate add_action( 'init', - function () use ($hasBlocksEnabled, $settingsHelper, $pluginUrl, $pluginPath) { + function () use ($container, $hasBlocksEnabled, $settingsHelper, $pluginUrl, $pluginPath, $dataService) { self::registerFrontendScripts($pluginUrl, $pluginPath); // Enqueue Scripts @@ -568,6 +584,12 @@ function () use ($hasBlocksEnabled, $settingsHelper, $pluginUrl, $pluginPath) { }); if ($hasBlocksEnabled) { + /** @var array */ + $gatewayInstances = $container->get('gateway.instances'); + self::registerBlockScripts($pluginUrl, $pluginPath); + add_action('wp_enqueue_scripts', function () use ($dataService, $gatewayInstances) { + $this->enqueueBlockCheckoutScripts($dataService, $gatewayInstances); + }); $this->registerButtonsBlockScripts($pluginUrl, $pluginPath); } } @@ -615,12 +637,6 @@ function () use ($container, $hasBlocksEnabled, $pluginVersion, $dataService, $p true ); - if ($hasBlocksEnabled) { - /** @var array */ - $gatewayInstances = $container->get('gateway.instances'); - $this->enqueueBlockCheckoutScripts($dataService, $gatewayInstances); - } - $this->enqueueIconSettings($current_section); } } diff --git a/src/Assets/MollieCheckoutBlocksSupport.php b/src/Assets/MollieCheckoutBlocksSupport.php index ef60d24ca..fe69e72dc 100644 --- a/src/Assets/MollieCheckoutBlocksSupport.php +++ b/src/Assets/MollieCheckoutBlocksSupport.php @@ -10,9 +10,10 @@ final class MollieCheckoutBlocksSupport extends AbstractPaymentMethodType { + /** @var string $name */ protected $name = "mollie"; /** @var string $scriptHandle */ - protected $scriptHandle = "mollie_block_index"; + private static $scriptHandle = "mollie_block_index"; /** @var Data */ protected $dataService; /** @var array */ @@ -28,6 +29,7 @@ public function __construct( string $registerScriptUrl, string $registerScriptVersion ) { + $this->dataService = $dataService; $this->gatewayInstances = $gatewayInstances; $this->registerScriptUrl = $registerScriptUrl; @@ -39,27 +41,40 @@ public function initialize() // } + public static function getScriptHandle() + { + + return self::$scriptHandle; + } + public function get_payment_method_script_handles(): array { wp_register_script( - $this->scriptHandle, + self::$scriptHandle, $this->registerScriptUrl, ['wc-blocks-registry', 'underscore', 'jquery'], $this->registerScriptVersion, true ); + self::localizeWCBlocksData($this->dataService, $this->gatewayInstances); + + return [self::$scriptHandle]; + } + + public static function localizeWCBlocksData($dataService, $gatewayInstances) + { + wp_localize_script( - $this->scriptHandle, + self::$scriptHandle, 'mollieBlockData', [ - 'gatewayData' => $this->gatewayDataForWCBlocks($this->dataService, $this->gatewayInstances), + 'gatewayData' => self::gatewayDataForWCBlocks($dataService, $gatewayInstances), ] ); - return [$this->scriptHandle]; } - private function gatewayDataForWCBlocks(Data $dataService, array $gatewayInstances): array + public static function gatewayDataForWCBlocks(Data $dataService, array $gatewayInstances): array { $filters = $dataService->wooCommerceFiltersForCheckout(); $availableGateways = WC()->payment_gateways()->get_available_payment_gateways(); @@ -134,7 +149,7 @@ private function gatewayDataForWCBlocks(Data $dataService, array $gatewayInstanc $gateway->paymentMethod()->getProperty('allowed_countries') ) ? $gateway->paymentMethod()->getProperty('allowed_countries') : [], 'ariaLabel' => $gateway->paymentMethod()->getProperty('defaultDescription'), - 'supports' => $this->gatewaySupportsFeatures($gateway->paymentMethod(), $isSepaEnabled), + 'supports' => self::gatewaySupportsFeatures($gateway->paymentMethod(), $isSepaEnabled), 'errorMessage' => $gateway->paymentMethod()->getProperty('errorMessage'), 'companyPlaceholder' => $gateway->paymentMethod()->getProperty('companyPlaceholder'), 'phonePlaceholder' => $gateway->paymentMethod()->getProperty('phonePlaceholder'), @@ -147,7 +162,7 @@ private function gatewayDataForWCBlocks(Data $dataService, array $gatewayInstanc return $dataToScript; } - public function gatewaySupportsFeatures(PaymentMethodI $paymentMethod, bool $isSepaEnabled): array + public static function gatewaySupportsFeatures(PaymentMethodI $paymentMethod, bool $isSepaEnabled): array { $supports = (array)$paymentMethod->getProperty('supports'); $isSepaPaymentMethod = (bool)$paymentMethod->getProperty('SEPA'); From c44ff1ea52dcb70d2ee0910c50744db166cf2bfa Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Mon, 11 Sep 2023 10:36:47 +0200 Subject: [PATCH 28/37] Introduce new filters for API data. --- src/PaymentMethods/AbstractPaymentMethod.php | 11 +++++++++-- src/Settings/General/MollieGeneralSettings.php | 4 ++-- src/Shared/SharedDataDictionary.php | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/PaymentMethods/AbstractPaymentMethod.php b/src/PaymentMethods/AbstractPaymentMethod.php index 5b8c0b723..c72a226bb 100644 --- a/src/PaymentMethods/AbstractPaymentMethod.php +++ b/src/PaymentMethods/AbstractPaymentMethod.php @@ -65,7 +65,7 @@ public function __construct( public function title(): string { - $useApiTitle = $this->getProperty(SharedDataDictionary::USE_API_TITLE) === 'yes'; + $useApiTitle = apply_filters('mollie_wc_gateway_use_api_title', $this->isUseApiTitleChecked(),$this->id); $title = $this->getProperty('title'); //new installations should use the api title if ($useApiTitle || $title === false) { @@ -134,7 +134,9 @@ public function getIconUrl(): string return $this->iconFactory->getExternalIconHtml($uploadedImageUrl); } - if (isset($this->apiPaymentMethod["image"]) && property_exists($this->apiPaymentMethod["image"], "svg") && !$this->isCreditCardSelectorEnabled()) { + $useAPIImage = apply_filters('mollie_wc_gateway_use_api_image', $this->isUseApiTitleChecked(), $this->id); + + if (isset($this->apiPaymentMethod["image"]) && property_exists($this->apiPaymentMethod["image"], "svg") && !$this->isCreditCardSelectorEnabled() && $useAPIImage) { return $this->iconFactory->getExternalIconHtml($this->apiPaymentMethod["image"]->svg); } return $this->iconFactory->getIconUrl( @@ -324,6 +326,11 @@ private function getApiTitle() return $apiTitle ?: $this->config['defaultTitle']; } + private function isUseApiTitleChecked(): bool + { + return $this->getProperty(SharedDataDictionary::USE_API_TITLE_AND_IMAGE) === 'yes'; + } + protected function titleIsDefault(): bool { $savedTitle = $this->getProperty('title'); diff --git a/src/Settings/General/MollieGeneralSettings.php b/src/Settings/General/MollieGeneralSettings.php index bfa0b9b42..b0d018b9c 100644 --- a/src/Settings/General/MollieGeneralSettings.php +++ b/src/Settings/General/MollieGeneralSettings.php @@ -53,11 +53,11 @@ public function gatewayFormFields( ], 'use_api_title' => [ 'title' => __( - 'Use API dynamic title', + 'Use API dynamic title and gateway logo', 'mollie-payments-for-woocommerce' ), 'type' => 'checkbox', - 'label' => __('Retrieve the gateway title from Mollie', 'mollie-payments-for-woocommerce'), + 'label' => __('Retrieve the gateway title and logo from the Mollie API', 'mollie-payments-for-woocommerce'), 'default' => 'no', ], 'description' => [ diff --git a/src/Shared/SharedDataDictionary.php b/src/Shared/SharedDataDictionary.php index fac6f7260..9408c7bad 100644 --- a/src/Shared/SharedDataDictionary.php +++ b/src/Shared/SharedDataDictionary.php @@ -140,5 +140,5 @@ class SharedDataDictionary /** * @var string */ - public const USE_API_TITLE = 'use_api_title'; + public const USE_API_TITLE_AND_IMAGE = 'use_api_title'; } From 4c654860d1ef9cbdab43ba5213795f9ec86955de Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Mon, 11 Sep 2023 10:40:04 +0200 Subject: [PATCH 29/37] Code style fix. --- src/PaymentMethods/AbstractPaymentMethod.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PaymentMethods/AbstractPaymentMethod.php b/src/PaymentMethods/AbstractPaymentMethod.php index c72a226bb..a86e10b3d 100644 --- a/src/PaymentMethods/AbstractPaymentMethod.php +++ b/src/PaymentMethods/AbstractPaymentMethod.php @@ -65,7 +65,7 @@ public function __construct( public function title(): string { - $useApiTitle = apply_filters('mollie_wc_gateway_use_api_title', $this->isUseApiTitleChecked(),$this->id); + $useApiTitle = apply_filters('mollie_wc_gateway_use_api_title', $this->isUseApiTitleChecked(), $this->id); $title = $this->getProperty('title'); //new installations should use the api title if ($useApiTitle || $title === false) { From 3f3bd6afa646dd97e47211b7225b9435f4f640fe Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Mon, 11 Sep 2023 10:49:29 +0200 Subject: [PATCH 30/37] Change filter name from api_image to api_icon. --- src/PaymentMethods/AbstractPaymentMethod.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PaymentMethods/AbstractPaymentMethod.php b/src/PaymentMethods/AbstractPaymentMethod.php index a86e10b3d..1b16d1f3b 100644 --- a/src/PaymentMethods/AbstractPaymentMethod.php +++ b/src/PaymentMethods/AbstractPaymentMethod.php @@ -134,7 +134,7 @@ public function getIconUrl(): string return $this->iconFactory->getExternalIconHtml($uploadedImageUrl); } - $useAPIImage = apply_filters('mollie_wc_gateway_use_api_image', $this->isUseApiTitleChecked(), $this->id); + $useAPIImage = apply_filters('mollie_wc_gateway_use_api_icon', $this->isUseApiTitleChecked(), $this->id); if (isset($this->apiPaymentMethod["image"]) && property_exists($this->apiPaymentMethod["image"], "svg") && !$this->isCreditCardSelectorEnabled() && $useAPIImage) { return $this->iconFactory->getExternalIconHtml($this->apiPaymentMethod["image"]->svg); From 36d130020a4be6d46757acc3da25fe51b0ec2f31 Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Mon, 11 Sep 2023 14:42:27 +0200 Subject: [PATCH 31/37] Fix merge error. --- src/Assets/AssetsModule.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Assets/AssetsModule.php b/src/Assets/AssetsModule.php index c0bf4dcf4..9b46d9503 100644 --- a/src/Assets/AssetsModule.php +++ b/src/Assets/AssetsModule.php @@ -591,6 +591,12 @@ function () use ($container, $hasBlocksEnabled, $settingsHelper, $pluginUrl, $pl }); if ($hasBlocksEnabled) { + /** @var array */ + $gatewayInstances = $container->get('gateway.instances'); + self::registerBlockScripts($pluginUrl, $pluginPath); + add_action('wp_enqueue_scripts', function () use ($dataService, $gatewayInstances) { + $this->enqueueBlockCheckoutScripts($dataService, $gatewayInstances); + }); $this->registerButtonsBlockScripts($pluginUrl, $pluginPath); } } From 699e2139340df966bc1e78711eed903105207780 Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Tue, 12 Sep 2023 10:24:41 +0200 Subject: [PATCH 32/37] Remove max-width limitation. --- resources/scss/mollie-gateway-icons.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/scss/mollie-gateway-icons.scss b/resources/scss/mollie-gateway-icons.scss index 802d93db2..f023a5f37 100644 --- a/resources/scss/mollie-gateway-icons.scss +++ b/resources/scss/mollie-gateway-icons.scss @@ -3,7 +3,6 @@ } label .mollie-gateway-icon{ float:right; - max-width: 32px; max-height: 24px; } .mollie-gateway-icon svg{ From 068d53a470e70e7d6ff390f5ea2484b982b1d99b Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Tue, 12 Sep 2023 11:02:06 +0200 Subject: [PATCH 33/37] Force 24px max-height for mollie icons. --- resources/scss/mollie-gateway-icons.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/scss/mollie-gateway-icons.scss b/resources/scss/mollie-gateway-icons.scss index f023a5f37..4921954e2 100644 --- a/resources/scss/mollie-gateway-icons.scss +++ b/resources/scss/mollie-gateway-icons.scss @@ -3,7 +3,7 @@ } label .mollie-gateway-icon{ float:right; - max-height: 24px; + max-height: 24px !important; } .mollie-gateway-icon svg{ float:right; From 3add968ad935f1c11a88942269681ce8312302ca Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Wed, 13 Sep 2023 06:45:03 +0200 Subject: [PATCH 34/37] Set dueDate when active_expiry_days_setting is activated. --- src/PaymentMethods/Banktransfer.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/PaymentMethods/Banktransfer.php b/src/PaymentMethods/Banktransfer.php index cf49f934b..5df6538cc 100644 --- a/src/PaymentMethods/Banktransfer.php +++ b/src/PaymentMethods/Banktransfer.php @@ -99,10 +99,12 @@ public function addPaymentArguments(array $args, WC_Order $order) $expiry_date = date("Y-m-d", strtotime(sprintf('+%s days', $expiry_days))); // Add dueDate at the correct location - if (isset($args['payment'])) { - $args['payment']['dueDate'] = $expiry_date; - } else { - $args['dueDate'] = $expiry_date; + if($this->isExpiredDateSettingActivated()) { + if (isset($args['payment'])) { + $args['payment']['dueDate'] = $expiry_date; + } else { + $args['dueDate'] = $expiry_date; + } } $email = (ctype_space($order->get_billing_email())) ? null : $order->get_billing_email(); @@ -114,7 +116,6 @@ public function addPaymentArguments(array $args, WC_Order $order) return $args; } - //TODO is this needed?? public function isExpiredDateSettingActivated() { $expiryDays = $this->getProperty( From 332796182961f85cb792354c1f1a36f88784251e Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Wed, 13 Sep 2023 06:50:46 +0200 Subject: [PATCH 35/37] Fix code format on Banktransfer.php --- src/PaymentMethods/Banktransfer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PaymentMethods/Banktransfer.php b/src/PaymentMethods/Banktransfer.php index 5df6538cc..ab946c46c 100644 --- a/src/PaymentMethods/Banktransfer.php +++ b/src/PaymentMethods/Banktransfer.php @@ -99,13 +99,14 @@ public function addPaymentArguments(array $args, WC_Order $order) $expiry_date = date("Y-m-d", strtotime(sprintf('+%s days', $expiry_days))); // Add dueDate at the correct location - if($this->isExpiredDateSettingActivated()) { + if ($this->isExpiredDateSettingActivated()) { if (isset($args['payment'])) { $args['payment']['dueDate'] = $expiry_date; } else { $args['dueDate'] = $expiry_date; } } + $email = (ctype_space($order->get_billing_email())) ? null : $order->get_billing_email(); if ($email) { From d78e484acbcc3d3201618ef0060762c242d8e7cf Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Wed, 13 Sep 2023 10:38:22 +0200 Subject: [PATCH 36/37] update .pot file --- languages/en_GB.pot | 1529 +++++++++++++++++++++++-------------------- 1 file changed, 829 insertions(+), 700 deletions(-) diff --git a/languages/en_GB.pot b/languages/en_GB.pot index 14369918e..371856e51 100644 --- a/languages/en_GB.pot +++ b/languages/en_GB.pot @@ -1,1978 +1,2107 @@ -# Copyright (C) 2022 unnamed project -# This file is distributed under the same license as the unnamed project package. +# Copyright (C) 2023 Mollie +# This file is distributed under the GPLv2 or later. msgid "" msgstr "" -"Project-Id-Version: Mollie Payments for WooCommerce 7.3.3\n" +"Project-Id-Version: Mollie Payments for WooCommerce 7.4.0-beta\n" +"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/html\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Project-Id-Version: undefined\n" -"X-Poedit-Basepath: ..\n" -"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n" -"X-Poedit-SearchPath-0: .\n" -"X-Poedit-SearchPathExcluded-0: *.js\n" -"X-Poedit-SourceCharset: UTF-8\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: ../inc/settings/mollie_advanced_settings.php:12 +"POT-Creation-Date: 2023-09-13T08:36:45+00:00\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"X-Generator: WP-CLI 2.8.1\n" +"X-Domain: mollie-payments-for-woocommerce\n" + +#. Plugin Name of the plugin +msgid "Mollie Payments for WooCommerce" +msgstr "" + +#. Plugin URI of the plugin +#. Author URI of the plugin +msgid "https://www.mollie.com" +msgstr "" + +#. Description of the plugin +msgid "Accept payments in WooCommerce with the official Mollie plugin" +msgstr "" + +#. Author of the plugin +msgid "Mollie" +msgstr "" + +#: inc/settings/mollie_advanced_settings.php:13 msgctxt "Label {orderNumber} description for payment description options" msgid "Order number" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:13 +#: inc/settings/mollie_advanced_settings.php:14 msgctxt "Label {storeName} description for payment description options" msgid "Site Title" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:14 +#: inc/settings/mollie_advanced_settings.php:15 msgctxt "Label {customer.firstname} description for payment description options" msgid "Customer's first name" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:15 +#: inc/settings/mollie_advanced_settings.php:16 msgctxt "Label {customer.lastname} description for payment description options" msgid "Customer's last name" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:16 +#: inc/settings/mollie_advanced_settings.php:17 msgctxt "Label {customer.company} description for payment description options" msgid "Customer's company name" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:22 +#: inc/settings/mollie_advanced_settings.php:23 msgid "Mollie advanced settings" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:24, ../src/Settings/Page/MollieSettingsPage.php:185 +#: inc/settings/mollie_advanced_settings.php:25 +#: src/Settings/Page/MollieSettingsPage.php:186 msgid "The following options are required to use the plugin and are used by all Mollie payment methods" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:28 +#: inc/settings/mollie_advanced_settings.php:29 msgid "Order status after cancelled payment" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:31 -msgid "Pending" -msgstr "" - -#: ../inc/settings/mollie_advanced_settings.php:32 -msgid "Cancelled" -msgstr "" - -#: ../inc/settings/mollie_advanced_settings.php:34 +#: inc/settings/mollie_advanced_settings.php:35 msgid "Status for orders when a payment (not a Mollie order via the Orders API) is cancelled. Default: pending. Orders with status Pending can be paid with another payment method, customers can try again. Cancelled orders are final. Set this to Cancelled if you only have one payment method or don't want customers to re-try paying with a different payment method. This doesn't apply to payments for orders via the new Orders API and Klarna payments." msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:39 +#: inc/settings/mollie_advanced_settings.php:40 msgid "Payment screen language" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:42 +#: inc/settings/mollie_advanced_settings.php:43 msgid "Automatically send WordPress language" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:45, ../inc/settings/mollie_advanced_settings.php:105, ../src/Settings/General/MollieGeneralSettings.php:266 +#: inc/settings/mollie_advanced_settings.php:46 +#: inc/settings/mollie_advanced_settings.php:106 +#: src/Settings/General/MollieGeneralSettings.php:281 msgid "default" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:46 +#: inc/settings/mollie_advanced_settings.php:47 msgid "Detect using browser language" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:50 +#: inc/settings/mollie_advanced_settings.php:51 msgid "English" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:51 +#: inc/settings/mollie_advanced_settings.php:52 msgid "Dutch" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:52 +#: inc/settings/mollie_advanced_settings.php:53 msgid "Flemish (Belgium)" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:53 +#: inc/settings/mollie_advanced_settings.php:54 msgid "French" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:54 +#: inc/settings/mollie_advanced_settings.php:55 msgid "French (Belgium)" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:55 +#: inc/settings/mollie_advanced_settings.php:56 msgid "German" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:56 +#: inc/settings/mollie_advanced_settings.php:57 msgid "Austrian German" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:57 +#: inc/settings/mollie_advanced_settings.php:58 msgid "Swiss German" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:58 +#: inc/settings/mollie_advanced_settings.php:59 msgid "Spanish" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:59 +#: inc/settings/mollie_advanced_settings.php:60 msgid "Catalan" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:60 +#: inc/settings/mollie_advanced_settings.php:61 msgid "Portuguese" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:61 +#: inc/settings/mollie_advanced_settings.php:62 msgid "Italian" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:62 +#: inc/settings/mollie_advanced_settings.php:63 msgid "Norwegian" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:63 +#: inc/settings/mollie_advanced_settings.php:64 msgid "Swedish" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:64 +#: inc/settings/mollie_advanced_settings.php:65 msgid "Finnish" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:65 +#: inc/settings/mollie_advanced_settings.php:66 msgid "Danish" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:66 +#: inc/settings/mollie_advanced_settings.php:67 msgid "Icelandic" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:67 +#: inc/settings/mollie_advanced_settings.php:68 msgid "Hungarian" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:68 +#: inc/settings/mollie_advanced_settings.php:69 msgid "Polish" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:69 +#: inc/settings/mollie_advanced_settings.php:70 msgid "Latvian" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:70 +#: inc/settings/mollie_advanced_settings.php:71 msgid "Lithuanian" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:73 +#: inc/settings/mollie_advanced_settings.php:74 msgid "Sending a language (or locale) is required. The option 'Automatically send WordPress language' will try to get the customer's language in WordPress (and respects multilanguage plugins) and convert it to a format Mollie understands. If this fails, or if the language is not supported, it will fall back to American English. You can also select one of the locales currently supported by Mollie, that will then be used for all customers." msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:81 +#: inc/settings/mollie_advanced_settings.php:82 msgid "Store customer details at Mollie" msgstr "" -#. translators: Placeholder 1: enabled or disabled -#: ../inc/settings/mollie_advanced_settings.php:84 +#: inc/settings/mollie_advanced_settings.php:85 msgid "Should Mollie store customers name and email address for Single Click Payments? Default %1$s. Required if WooCommerce Subscriptions is being used! Read more about %2$s and how it improves your conversion." msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:88, ../src/Settings/Page/MollieSettingsPage.php:303 +#: inc/settings/mollie_advanced_settings.php:89 +#: src/Settings/Page/MollieSettingsPage.php:304 msgid "Enabled" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:89 +#: inc/settings/mollie_advanced_settings.php:90 msgid "Single Click Payments" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:97 +#: inc/settings/mollie_advanced_settings.php:98 msgid "Select API Method" msgstr "" -#. translators: Placeholder 1: opening link tag, placeholder 2: closing link tag -#: ../inc/settings/mollie_advanced_settings.php:114 +#: inc/settings/mollie_advanced_settings.php:115 msgid "Click %1$shere%2$s to read more about the differences between the Payments and Orders API" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:124 +#: inc/settings/mollie_advanced_settings.php:125 msgid "API Payment Description" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:141 +#: inc/settings/mollie_advanced_settings.php:141 msgctxt "Payment description options" msgid "Available variables" msgstr "" -#. translators: Placeholder 1: Opening paragraph tag, placeholder 2: Closing paragraph tag -#: ../inc/settings/mollie_advanced_settings.php:166 +#: inc/settings/mollie_advanced_settings.php:165 msgid "Select among the available variables the description to be used for this transaction.%1$s(Note: this only works when the method is set to Payments API)%2$s" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:177 +#: inc/settings/mollie_advanced_settings.php:176 msgid "Surcharge gateway fee label" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:183, ../src/Gateway/Surcharge.php:36 +#: inc/settings/mollie_advanced_settings.php:182 +#: src/Gateway/Surcharge.php:36 msgid "Gateway Fee" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:185 +#: inc/settings/mollie_advanced_settings.php:184 msgid "This is the label will appear in frontend when the surcharge applies" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:193 +#: inc/settings/mollie_advanced_settings.php:192 msgid "Remove Mollie data from Database on uninstall" msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:199 +#: inc/settings/mollie_advanced_settings.php:198 msgid "Remove options and scheduled actions from database when uninstalling the plugin." msgstr "" -#: ../inc/settings/mollie_advanced_settings.php:200 +#: inc/settings/mollie_advanced_settings.php:199 msgid "Clear now" msgstr "" -#: ../inc/settings/mollie_applepay_settings.php:12, ../src/PaymentMethods/Applepay.php:13 +#: inc/settings/mollie_applepay_settings.php:12 +#: src/PaymentMethods/Applepay.php:13 msgid "Apple Pay" msgstr "" -#: ../inc/settings/mollie_applepay_settings.php:14 +#: inc/settings/mollie_applepay_settings.php:14 msgid "The following options are required to use the Apple Pay gateway" msgstr "" -#: ../inc/settings/mollie_applepay_settings.php:19, ../src/Settings/General/MollieGeneralSettings.php:18 +#: inc/settings/mollie_applepay_settings.php:19 +#: src/Settings/General/MollieGeneralSettings.php:19 msgid "Enable/Disable" msgstr "" #. translators: Placeholder 1: Gateway title -#: ../inc/settings/mollie_applepay_settings.php:21, ../src/Settings/General/MollieGeneralSettings.php:25 +#: inc/settings/mollie_applepay_settings.php:21 +#: src/Settings/General/MollieGeneralSettings.php:26 msgid "Enable %s" msgstr "" -#: ../inc/settings/mollie_applepay_settings.php:29, ../src/Settings/General/MollieGeneralSettings.php:38 +#: inc/settings/mollie_applepay_settings.php:29 +#: src/Settings/General/MollieGeneralSettings.php:41 msgid "Title" msgstr "" -#. translators: Placeholder 1: Gateway title -#: ../inc/settings/mollie_applepay_settings.php:32, ../src/Settings/General/MollieGeneralSettings.php:42 +#: inc/settings/mollie_applepay_settings.php:32 +#: src/Settings/General/MollieGeneralSettings.php:45 msgid "This controls the title which the user sees during checkout. Default %s" msgstr "" -#: ../inc/settings/mollie_applepay_settings.php:46, ../inc/settings/mollie_applepay_settings.php:48, ../src/Settings/General/MollieGeneralSettings.php:66 +#: inc/settings/mollie_applepay_settings.php:46 +#: inc/settings/mollie_applepay_settings.php:48 +#: src/Settings/General/MollieGeneralSettings.php:78 msgid "Display logo" msgstr "" -#: ../inc/settings/mollie_applepay_settings.php:61, ../src/Settings/General/MollieGeneralSettings.php:52 +#: inc/settings/mollie_applepay_settings.php:61 +#: src/Settings/General/MollieGeneralSettings.php:64 msgid "Description" msgstr "" -#. translators: Placeholder 1: Gateway description -#: ../inc/settings/mollie_applepay_settings.php:64, ../src/Settings/General/MollieGeneralSettings.php:56 +#: inc/settings/mollie_applepay_settings.php:64 +#: src/Settings/General/MollieGeneralSettings.php:68 msgid "Payment method description that the customer will see on your checkout. Default %s" msgstr "" -#: ../inc/settings/mollie_applepay_settings.php:81 +#: inc/settings/mollie_applepay_settings.php:81 msgid "Apple Pay button settings" msgstr "" -#: ../inc/settings/mollie_applepay_settings.php:86 +#: inc/settings/mollie_applepay_settings.php:86 msgid "The following options are required to use the Apple Pay Direct Button" msgstr "" -#: ../inc/settings/mollie_applepay_settings.php:90, ../src/PaymentMethods/Applepay.php:34 +#: inc/settings/mollie_applepay_settings.php:90 +#: src/PaymentMethods/Applepay.php:34 msgid "Enable Apple Pay Button on Cart page" msgstr "" #. translators: Placeholder 1: enabled or disabled -#: ../inc/settings/mollie_applepay_settings.php:93, ../src/PaymentMethods/Applepay.php:36 +#: inc/settings/mollie_applepay_settings.php:93 +#: src/PaymentMethods/Applepay.php:36 msgid "Enable the Apple Pay direct buy button on the Cart page" msgstr "" -#: ../inc/settings/mollie_applepay_settings.php:106, ../src/PaymentMethods/Applepay.php:44 +#: inc/settings/mollie_applepay_settings.php:106 +#: src/PaymentMethods/Applepay.php:44 msgid "Enable Apple Pay Button on Product page" msgstr "" #. translators: Placeholder 1: enabled or disabled -#: ../inc/settings/mollie_applepay_settings.php:109, ../src/PaymentMethods/Applepay.php:46 +#: inc/settings/mollie_applepay_settings.php:109 +#: src/PaymentMethods/Applepay.php:46 msgid "Enable the Apple Pay direct buy button on the Product page" msgstr "" -#: ../inc/settings/mollie_components.php:9 +#: inc/settings/mollie_components.php:9 msgctxt "Mollie Components Settings" msgid "Base Styles" msgstr "" -#: ../inc/settings/mollie_components.php:18, ../inc/settings/mollie_components.php:158 +#: inc/settings/mollie_components.php:18 +#: inc/settings/mollie_components.php:158 msgctxt "Mollie Components Settings" msgid "Background Color" msgstr "" -#: ../inc/settings/mollie_components.php:24, ../inc/settings/mollie_components.php:147 +#: inc/settings/mollie_components.php:24 +#: inc/settings/mollie_components.php:147 msgctxt "Mollie Components Settings" msgid "Text Color" msgstr "" -#: ../inc/settings/mollie_components.php:30 +#: inc/settings/mollie_components.php:30 msgctxt "Mollie Components Settings" msgid "Placeholder Color" msgstr "" -#: ../inc/settings/mollie_components.php:36 +#: inc/settings/mollie_components.php:36 msgctxt "Mollie Components Settings" msgid "Font Size" msgstr "" -#: ../inc/settings/mollie_components.php:37 +#: inc/settings/mollie_components.php:37 msgctxt "Mollie Components Settings" msgid "Defines the component font size. Allowed units: 'em', 'px', 'rem'." msgstr "" -#: ../inc/settings/mollie_components.php:47 +#: inc/settings/mollie_components.php:47 msgctxt "Mollie Components Settings" msgid "Font Weight" msgstr "" -#: ../inc/settings/mollie_components.php:50 +#: inc/settings/mollie_components.php:50 msgctxt "Mollie Components Settings" msgid "Lighter" msgstr "" -#: ../inc/settings/mollie_components.php:51 +#: inc/settings/mollie_components.php:51 msgctxt "Mollie Components Settings" msgid "Regular" msgstr "" -#: ../inc/settings/mollie_components.php:52 +#: inc/settings/mollie_components.php:52 msgctxt "Mollie Components Settings" msgid "Bold" msgstr "" -#: ../inc/settings/mollie_components.php:58 +#: inc/settings/mollie_components.php:58 msgctxt "Mollie Components Settings" msgid "Letter Spacing" msgstr "" -#: ../inc/settings/mollie_components.php:64 +#: inc/settings/mollie_components.php:64 msgctxt "Mollie Components Settings" msgid "Line Height" msgstr "" -#: ../inc/settings/mollie_components.php:73 +#: inc/settings/mollie_components.php:73 msgctxt "Mollie Components Settings" msgid "Padding" msgstr "" -#: ../inc/settings/mollie_components.php:74 +#: inc/settings/mollie_components.php:74 msgctxt "Mollie Components Settings" msgid "Add padding to the components. Allowed units include `16px 16px 16px 16px` and `em`, `px`, `rem`." msgstr "" -#: ../inc/settings/mollie_components.php:84 +#: inc/settings/mollie_components.php:84 msgctxt "Mollie Components Settings" msgid "Align Text" msgstr "" -#: ../inc/settings/mollie_components.php:87 +#: inc/settings/mollie_components.php:87 msgctxt "Mollie Components Settings" msgid "Left" msgstr "" -#: ../inc/settings/mollie_components.php:88 +#: inc/settings/mollie_components.php:88 msgctxt "Mollie Components Settings" msgid "Right" msgstr "" -#: ../inc/settings/mollie_components.php:89 +#: inc/settings/mollie_components.php:89 msgctxt "Mollie Components Settings" msgid "Center" msgstr "" -#: ../inc/settings/mollie_components.php:90 +#: inc/settings/mollie_components.php:90 msgctxt "Mollie Components Settings" msgid "Justify" msgstr "" -#: ../inc/settings/mollie_components.php:96 +#: inc/settings/mollie_components.php:96 msgctxt "Mollie Components Settings" msgid "Transform Text " msgstr "" -#: ../inc/settings/mollie_components.php:99 +#: inc/settings/mollie_components.php:99 msgctxt "Mollie Components Settings" msgid "None" msgstr "" -#: ../inc/settings/mollie_components.php:104 +#: inc/settings/mollie_components.php:104 msgctxt "Mollie Components Settings" msgid "Capitalize" msgstr "" -#: ../inc/settings/mollie_components.php:109 +#: inc/settings/mollie_components.php:109 msgctxt "Mollie Components Settings" msgid "Uppercase" msgstr "" -#: ../inc/settings/mollie_components.php:114 +#: inc/settings/mollie_components.php:114 msgctxt "Mollie Components Settings" msgid "Lowercase" msgstr "" -#: ../inc/settings/mollie_components.php:119 +#: inc/settings/mollie_components.php:119 msgctxt "Mollie Components Settings" msgid "Full Width" msgstr "" -#: ../inc/settings/mollie_components.php:124 +#: inc/settings/mollie_components.php:124 msgctxt "Mollie Components Settings" msgid "Full Size Kana" msgstr "" -#: ../inc/settings/mollie_components.php:138 +#: inc/settings/mollie_components.php:138 msgctxt "Mollie Components Settings" msgid "Invalid Status Styles" msgstr "" -#: ../inc/settings/mollie_components.php:148 +#: inc/settings/mollie_components.php:148 msgctxt "Mollie Components Settings" msgid "Text Color for invalid input." msgstr "" -#: ../inc/settings/mollie_components.php:159 +#: inc/settings/mollie_components.php:159 msgctxt "Mollie Components Settings" msgid "Background Color for invalid input." msgstr "" -#. translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to settings. Placeholder 4: Closing link tag. -#: ../src/Activation/ActivationModule.php:167 +#: src/Activation/ActivationModule.php:141 msgid "%1$sMollie Payments for WooCommerce: API keys missing%2$s Please%3$s set your API keys here%4$s." msgstr "" -#: ../src/Activation/ConstraintsChecker.php:109 +#: src/Activation/ConstraintsChecker.php:106 msgid "%1$sMollie Payments for WooCommerce is inactive:%2$s" msgstr "" -#: ../src/Activation/ConstraintsChecker.php:113 +#: src/Activation/ConstraintsChecker.php:110 msgid "%1$sCorrect the above errors to use Mollie Payments for Woocommerce%2$s" msgstr "" -#: ../src/Assets/AssetsModule.php:432 +#: src/Assets/AssetsModule.php:386 msgid "Name on card" msgstr "" -#: ../src/Assets/AssetsModule.php:436 +#: src/Assets/AssetsModule.php:390 msgid "Card number" msgstr "" -#: ../src/Assets/AssetsModule.php:440 +#: src/Assets/AssetsModule.php:394 msgid "Expiry date" msgstr "" -#: ../src/Assets/AssetsModule.php:444 +#: src/Assets/AssetsModule.php:398 msgid "CVC/CVV" msgstr "" -#: ../src/Assets/AssetsModule.php:451 +#: src/Assets/AssetsModule.php:405 msgid "An unknown error occurred, please check the card fields." msgstr "" -#: ../src/Assets/AssetsModule.php:521 +#: src/Assets/AssetsModule.php:459 +msgid "No custom logo selected" +msgstr "" + +#: src/Assets/MollieCheckoutBlocksSupport.php:142 msgid "Please choose a billing country to see the available payment methods" msgstr "" -#: ../src/Assets/AssetsModule.php:570 -msgid "No custom logo selected" +#. translators: Placeholder 1: Payment method title +#: src/Buttons/ApplePayButton/AppleAjaxRequests.php:700 +#: src/Buttons/PayPalButton/PayPalAjaxRequests.php:113 +#: src/Buttons/PayPalButton/PayPalAjaxRequests.php:157 +#: src/Payment/PaymentService.php:716 +msgid "Could not create %s payment." +msgstr "" + +#: src/Buttons/ApplePayButton/ApplePayDirectHandler.php:42 +msgid "%1$sServer not compliant with Apple requirements%2$s Check %3$sApple Server requirements page%4$s to fix it in order to make the Apple Pay button work" +msgstr "" + +#: src/Buttons/ApplePayButton/ApplePayDirectHandler.php:58 +msgid "%1$sApple Pay Validation Error%2$s Check %3$sApple Server requirements page%4$s to fix it in order to make the Apple Pay button work" +msgstr "" + +#: src/Gateway/GatewayModule.php:655 +msgid "Error processing %1$s payment, the %2$s field is required." +msgstr "" + +#: src/Gateway/GatewayModule.php:669 +msgid "Please enter your %1$s, this is required for %2$s payments" msgstr "" -#: ../src/Gateway/MolliePaymentGateway.php:271, ../src/Settings/Page/MollieSettingsPage.php:313 +#: src/Gateway/MolliePaymentGateway.php:269 +#: src/Settings/Page/MollieSettingsPage.php:314 msgid "Test mode enabled." msgstr "" #. translators: The surrounding %s's Will be replaced by a link to the global setting page -#: ../src/Gateway/MolliePaymentGateway.php:276 +#: src/Gateway/MolliePaymentGateway.php:274 msgid "No API key provided. Please %1$sset you Mollie API key%2$s first." msgstr "" #. translators: Placeholder 1: payment method title. The surrounding %s's Will be replaced by a link to the Mollie profile -#: ../src/Gateway/MolliePaymentGateway.php:291 +#: src/Gateway/MolliePaymentGateway.php:289 msgid "%1$s not enabled in your Mollie profile. You can enable it by editing your %2$sMollie profile%3$s." msgstr "" #. translators: Placeholder 1: WooCommerce currency, placeholder 2: Supported Mollie currencies -#: ../src/Gateway/MolliePaymentGateway.php:306 +#: src/Gateway/MolliePaymentGateway.php:304 msgid "Current shop currency %1$s not supported by Mollie. Read more about %2$ssupported currencies and payment methods.%3$s " msgstr "" -#: ../src/Gateway/MolliePaymentGateway.php:577 +#: src/Gateway/MolliePaymentGateway.php:575 msgid "You have cancelled your payment. Please complete your order with a different payment method." msgstr "" -#: ../src/Gateway/MolliePaymentGateway.php:597, ../src/Gateway/MolliePaymentGateway.php:611 +#: src/Gateway/MolliePaymentGateway.php:596 +#: src/Gateway/MolliePaymentGateway.php:610 msgid "Your payment was not successful. Please complete your order with a different payment method." msgstr "" -#: ../src/Gateway/MolliePaymentGateway.php:647 +#: src/Gateway/MolliePaymentGateway.php:646 msgid "Could not load order %s" msgstr "" -#: ../src/Gateway/MolliePaymentGateway.php:906 +#: src/Gateway/MolliePaymentGateway.php:899 msgid "Order cancelled" msgstr "" #. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Gateway/MolliePaymentGateway.php:943 +#: src/Gateway/MolliePaymentGateway.php:933 msgid "%1$s payment still pending (%2$s) but customer already returned to the store. Status should be updated automatically in the future, if it doesn't this might indicate a communication issue between the site and Mollie." msgstr "" -#: ../src/Gateway/MolliePaymentGateway.php:949, ../src/Payment/MollieObject.php:687, ../src/Payment/MollieObject.php:655, ../src/Payment/MollieOrder.php:275, ../src/Payment/MollieOrder.php:332, ../src/Payment/MollieOrder.php:377, ../src/Payment/MollieOrder.php:459, ../src/Payment/MollieOrder.php:522, ../src/Payment/MollieOrder.php:941, ../src/Payment/MollieOrderService.php:165, ../src/Payment/MollieOrderService.php:428, ../src/Payment/MollieOrderService.php:491, ../src/Payment/MollieOrderService.php:705, ../src/Payment/MolliePayment.php:223, ../src/Payment/MolliePayment.php:310, ../src/Payment/MolliePayment.php:379, ../src/Payment/MolliePayment.php:402, ../src/Payment/PaymentService.php:788, ../src/Subscription/MollieSepaRecurringGateway.php:138, ../src/Subscription/MollieSepaRecurringGateway.php:205, ../src/Subscription/MollieSubscriptionGateway.php:470 +#: src/Gateway/MolliePaymentGateway.php:939 +#: src/Payment/MollieObject.php:682 +#: src/Payment/MollieObject.php:714 +#: src/Payment/MollieOrder.php:281 +#: src/Payment/MollieOrder.php:338 +#: src/Payment/MollieOrder.php:382 +#: src/Payment/MollieOrder.php:463 +#: src/Payment/MollieOrder.php:534 +#: src/Payment/MollieOrder.php:877 +#: src/Payment/MollieOrderService.php:183 +#: src/Payment/MollieOrderService.php:487 +#: src/Payment/MollieOrderService.php:550 +#: src/Payment/MollieOrderService.php:763 +#: src/Payment/MolliePayment.php:236 +#: src/Payment/MolliePayment.php:323 +#: src/Payment/MolliePayment.php:399 +#: src/Payment/MolliePayment.php:423 +#: src/Payment/PaymentService.php:801 +#: src/Subscription/MollieSepaRecurringGateway.php:137 +#: src/Subscription/MollieSepaRecurringGateway.php:204 +#: src/Subscription/MollieSubscriptionGateway.php:458 msgid "test mode" msgstr "" -#: ../src/Gateway/MolliePaymentGateway.php:964 +#: src/Gateway/MolliePaymentGateway.php:950 msgid ", payment pending." msgstr "" -#: ../src/Gateway/MolliePaymentGateway.php:996 +#: src/Gateway/MolliePaymentGateway.php:982 msgid "Your order has been cancelled." msgstr "" -#: ../src/Gateway/Surcharge.php:81 -msgid "A surchage fee might apply" -msgstr "" - #. translators: Placeholder 1: Fee amount tag. Placeholder 2: Currency. -#: ../src/Gateway/Surcharge.php:275 +#: src/Gateway/Surcharge.php:257 msgid " + %1$s %2$s fee might apply" msgstr "" #. translators: Placeholder 1: Fee amount tag. -#: ../src/Gateway/Surcharge.php:292 +#: src/Gateway/Surcharge.php:274 msgid " + %1$s%% fee might apply" msgstr "" #. translators: Placeholder 1: Fee amount tag. Placeholder 2: Currency. Placeholder 3: Percentage amount. -#: ../src/Gateway/Surcharge.php:315 +#: src/Gateway/Surcharge.php:297 msgid " + %1$s %2$s + %3$s%% fee might apply" msgstr "" -#: ../src/Gateway/Surcharge.php:348 +#: src/Gateway/Surcharge.php:330 msgid " (incl. VAT)" msgstr "" -#. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Payment/MollieObject.php:682 -msgid "%1$s payment failed via Mollie (%2$s)." +#: src/Gateway/Voucher/VoucherModule.php:79 +#: src/Settings/Page/MollieSettingsPage.php:50 +#: src/Settings/Page/MollieSettingsPage.php:183 +msgid "Mollie Settings" +msgstr "" + +#: src/Gateway/Voucher/VoucherModule.php:109 +#: src/Gateway/Voucher/VoucherModule.php:149 +#: src/Gateway/Voucher/VoucherModule.php:172 +msgid "Mollie Voucher Category" +msgstr "" + +#: src/Gateway/Voucher/VoucherModule.php:112 +#: src/Gateway/Voucher/VoucherModule.php:151 +#: src/Gateway/Voucher/VoucherModule.php:176 +msgid "--Please choose an option--" +msgstr "" + +#: src/Gateway/Voucher/VoucherModule.php:113 +#: src/Gateway/Voucher/VoucherModule.php:152 +#: src/Gateway/Voucher/VoucherModule.php:181 +#: src/Gateway/Voucher/VoucherModule.php:243 +#: src/Gateway/Voucher/VoucherModule.php:298 +msgid "No Category" +msgstr "" + +#: src/Gateway/Voucher/VoucherModule.php:114 +#: src/Gateway/Voucher/VoucherModule.php:153 +#: src/Gateway/Voucher/VoucherModule.php:184 +#: src/Gateway/Voucher/VoucherModule.php:244 +#: src/Gateway/Voucher/VoucherModule.php:299 +#: src/PaymentMethods/Voucher.php:57 +msgid "Meal" +msgstr "" + +#: src/Gateway/Voucher/VoucherModule.php:115 +#: src/Gateway/Voucher/VoucherModule.php:154 +#: src/Gateway/Voucher/VoucherModule.php:187 +#: src/Gateway/Voucher/VoucherModule.php:245 +#: src/Gateway/Voucher/VoucherModule.php:300 +#: src/PaymentMethods/Voucher.php:58 +msgid "Eco" +msgstr "" + +#: src/Gateway/Voucher/VoucherModule.php:116 +#: src/Gateway/Voucher/VoucherModule.php:155 +#: src/Gateway/Voucher/VoucherModule.php:190 +#: src/Gateway/Voucher/VoucherModule.php:246 +#: src/Gateway/Voucher/VoucherModule.php:301 +#: src/PaymentMethods/Voucher.php:59 +msgid "Gift" +msgstr "" + +#: src/Gateway/Voucher/VoucherModule.php:157 +#: src/Gateway/Voucher/VoucherModule.php:194 +msgid "Select a voucher category to apply to all products with this category" +msgstr "" + +#: src/Gateway/Voucher/VoucherModule.php:228 +#: src/PaymentMethods/Voucher.php:53 +msgid "Select the default products category" msgstr "" -#: ../src/Payment/MollieObject.php:650 +#: src/Gateway/Voucher/VoucherModule.php:232 +msgid "Products voucher category" +msgstr "" + +#: src/Gateway/Voucher/VoucherModule.php:239 +#: src/Gateway/Voucher/VoucherModule.php:297 +msgid "Same as default category" +msgstr "" + +#. translators: Placeholder 1: Default order status, placeholder 2: Link to 'Hold Stock' setting +#: src/Gateway/Voucher/VoucherModule.php:251 +msgid "In order to process it, all products in the order must have a category. To disable the product from voucher selection select \"No category\" option." +msgstr "" + +#: src/Gateway/Voucher/VoucherModule.php:294 +msgid "Mollie Voucher category" +msgstr "" + +#. translators: Placeholder 1: payment method title, placeholder 2: payment ID +#: src/Payment/MollieObject.php:677 msgid "%1$s renewal payment failed via Mollie (%2$s). You will need to manually review the payment and adjust product stocks if you use them." msgstr "" #. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Payment/MollieObject.php:721 +#: src/Payment/MollieObject.php:709 +msgid "%1$s payment failed via Mollie (%2$s)." +msgstr "" + +#. translators: Placeholder 1: payment method title, placeholder 2: payment ID +#: src/Payment/MollieObject.php:743 msgid "Mollie webhook called, but payment also started via %s, so the order status is not updated." msgstr "" #. translators: Placeholder 1: PayPal consumer name, placeholder 2: PayPal email, placeholder 3: PayPal transaction ID -#: ../src/Payment/MollieObject.php:740, ../src/PaymentMethods/InstructionStrategies/PaypalInstructionStrategy.php:20 +#: src/Payment/MollieObject.php:765 +#: src/PaymentMethods/InstructionStrategies/PaypalInstructionStrategy.php:19 msgid "Payment completed by %1$s - %2$s (PayPal transaction ID: %3$s)" msgstr "" #. translators: do not translate between {} -#: ../src/Payment/MollieObject.php:881 +#: src/Payment/MollieObject.php:909 msgctxt "Payment description for {orderNumber}" msgid "Order {orderNumber}" msgstr "" #. translators: do not translate between {} -#: ../src/Payment/MollieObject.php:891 +#: src/Payment/MollieObject.php:919 msgctxt "Payment description for {storeName}" msgid "StoreName {storeName}" msgstr "" #. translators: do not translate between {} -#: ../src/Payment/MollieObject.php:901 +#: src/Payment/MollieObject.php:929 msgctxt "Payment description for {customer.firstname}" msgid "Customer Firstname {customer.firstname}" msgstr "" #. translators: do not translate between {} -#: ../src/Payment/MollieObject.php:911 +#: src/Payment/MollieObject.php:939 msgctxt "Payment description for {customer.lastname}" msgid "Customer Lastname {customer.lastname}" msgstr "" #. translators: do not translate between {} -#: ../src/Payment/MollieObject.php:921 +#: src/Payment/MollieObject.php:949 msgctxt "Payment description for {customer.company}" msgid "Customer Company {customer.company}" msgstr "" -#: ../src/Payment/MollieObject.php:936 -msgid "Order" -msgstr "" - #. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Payment/MollieOrder.php:271, ../src/Payment/MolliePayment.php:221, ../src/Subscription/MollieSepaRecurringGateway.php:211 +#: src/Payment/MollieOrder.php:277 +#: src/Payment/MolliePayment.php:234 +#: src/Subscription/MollieSepaRecurringGateway.php:210 msgid "Order completed using %1$s payment (%2$s)." msgstr "" #. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Payment/MollieOrder.php:330 +#: src/Payment/MollieOrder.php:336 msgid "Order authorized using %1$s payment (%2$s). Set order to completed in WooCommerce when you have shipped the products, to capture the payment. Do this within 28 days, or the order will expire. To handle individual order lines, process the order via the Mollie Dashboard." msgstr "" #. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Payment/MollieOrder.php:375 +#: src/Payment/MollieOrder.php:380 msgid "Order completed at Mollie for %1$s order (%2$s). At least one order line completed. Remember: Completed status for an order at Mollie is not the same as Completed status in WooCommerce!" msgstr "" #. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Payment/MollieOrder.php:457 +#: src/Payment/MollieOrder.php:461 msgid "%1$s order (%2$s) cancelled ." msgstr "" #. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Payment/MollieOrder.php:520 +#: src/Payment/MollieOrder.php:532 msgid "%1$s order expired (%2$s) but not cancelled because of another pending payment (%3$s)." msgstr "" -#: ../src/Payment/MollieOrder.php:616 +#: src/Payment/MollieOrder.php:627 msgctxt "Order note error" msgid "The sum of refunds for all order lines is not identical to the refund amount, so this refund will be processed as a payment amount refund, not an order line refund." msgstr "" -#. translators: Placeholder 1: Number of items. Placeholder 2: Name of item. Placeholder 3: Currency. Placeholder 4: Amount. -#: ../src/Payment/MollieOrder.php:747 -msgid "%1$sx %2$s cancelled for %3$s%4$s in WooCommerce and at Mollie." -msgstr "" - -#. translators: Placeholder 1: Number of items. Placeholder 2: Name of item. Placeholder 3: Currency. Placeholder 4: Amount. Placeholder 5: Reason. Placeholder 6: Refund Id. -#: ../src/Payment/MollieOrder.php:763 -msgid "%1$sx %2$s refunded for %3$s%4$s in WooCommerce and at Mollie.%5$s Refund ID: %6$s." -msgstr "" - -#. translators: Placeholder 1: payment status. -#: ../src/Payment/MollieOrder.php:823 +#: src/Payment/MollieOrder.php:759 msgctxt "Order note error" msgid "Can not refund order amount that has status %1$s at Mollie." msgstr "" -#. translators: Placeholder 1: Currency. Placeholder 2: Refund amount. Placeholder 3: Reason. Placeholder 4: Refund id. -#: ../src/Payment/MollieOrder.php:845 +#: src/Payment/MollieOrder.php:781 msgid "Amount refund of %1$s%2$s refunded in WooCommerce and at Mollie.%3$s Refund ID: %4$s." msgstr "" #. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Payment/MollieOrder.php:936 +#: src/Payment/MollieOrder.php:872 msgid "%1$s order (%2$s) expired ." msgstr "" +#: src/Payment/MollieOrder.php:1095 +msgid "%1$sx %2$s cancelled for %3$s%4$s in WooCommerce and at Mollie." +msgstr "" + +#: src/Payment/MollieOrder.php:1119 +msgid "%1$sx %2$s refunded for %3$s%4$s in WooCommerce and at Mollie.%5$s Refund ID: %6$s." +msgstr "" + #. translators: Placeholder 1: payment method title, placeholder 2: payment status, placeholder 3: payment ID -#: ../src/Payment/MollieOrderService.php:162 +#: src/Payment/MollieOrderService.php:180 msgid "%1$s payment %2$s (%3$s), not processed." msgstr "" -#: ../src/Payment/MollieOrderService.php:391 +#: src/Payment/MollieOrderService.php:447 msgid "New chargeback %s processed! Order note and order status updated." msgstr "" #. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Payment/MollieOrderService.php:423 +#: src/Payment/MollieOrderService.php:482 msgid "%1$s payment charged back via Mollie (%2$s). You will need to manually review the payment (and adjust product stocks if you use it)." msgstr "" #. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Payment/MollieOrderService.php:485 +#: src/Payment/MollieOrderService.php:544 msgid "%1$s payment charged back via Mollie (%2$s). Subscription status updated, please review (and adjust product stocks if you use it)." msgstr "" #. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Payment/MollieOrderService.php:692 +#: src/Payment/MollieOrderService.php:750 msgid "%1$s payment %2$s via Mollie (%3$s %4$s). You will need to manually review the payment (and adjust product stocks if you use it)." msgstr "" -#: ../src/Payment/MollieOrderService.php:805 +#: src/Payment/MollieOrderService.php:935 msgid "New refund %s processed in Mollie Dashboard! Order note added, but order not updated." msgstr "" +#: src/Payment/MollieOrderService.php:979 +msgid "Refund %s applied to Woocommerce order." +msgstr "" + #. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Payment/MolliePayment.php:308 +#: src/Payment/MolliePayment.php:321 msgid "%1$s payment (%2$s) cancelled ." msgstr "" #. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Payment/MolliePayment.php:377 +#: src/Payment/MolliePayment.php:397 msgid "%1$s payment expired (%2$s) but not cancelled because of another pending payment (%3$s)." msgstr "" #. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Payment/MolliePayment.php:400 +#: src/Payment/MolliePayment.php:421 msgid "%1$s payment expired (%2$s)." msgstr "" #. translators: Placeholder 1: currency, placeholder 2: refunded amount, placeholder 3: optional refund reason, placeholder 4: payment ID, placeholder 5: refund ID -#: ../src/Payment/MolliePayment.php:476 +#: src/Payment/MolliePayment.php:497 msgid "Refunded %1$s%2$s%3$s - Payment: %4$s, Refund: %5$s" msgstr "" #. translators: Placeholder 1: order number -#: ../src/Payment/MollieSubscription.php:80 +#: src/Payment/MollieSubscription.php:78 msgctxt "Default payment description for subscription recurring payments" msgid "Order %1$s" msgstr "" -#: ../src/Payment/OrderItemsRefunder.php:121 +#: src/Payment/OrderItemsRefunder.php:121 msgid "One of the WooCommerce order items does not have the refund item ID meta value associated to Mollie Order item." msgstr "" -#: ../src/Payment/OrderItemsRefunder.php:166 +#: src/Payment/OrderItemsRefunder.php:166 msgid "Impossible to retrieve the order item ID related to the remote item: %1$s. Try to do a refund by amount." msgstr "" -#: ../src/Payment/OrderItemsRefunder.php:190 +#: src/Payment/OrderItemsRefunder.php:190 msgid "Empty WooCommerce order items or mollie order lines." msgstr "" -#: ../src/Payment/OrderLines.php:509 +#: src/Payment/OrderLines.php:509 msgid "Shipping" msgstr "" -#: ../src/Payment/PaymentModule.php:194 -msgid "Unpaid order cancelled - time limit reached." -msgstr "" - -#: ../src/Payment/PaymentModule.php:213 +#: src/Payment/PaymentModule.php:215 msgid "%1$s items refunded in WooCommerce and at Mollie." msgstr "" -#: ../src/Payment/PaymentModule.php:231 +#: src/Payment/PaymentModule.php:233 msgid "%1$s items cancelled in WooCommerce and at Mollie." msgstr "" -#: ../src/Payment/PaymentModule.php:350 +#: src/Payment/PaymentModule.php:352 msgctxt "Order note info" msgid "Processing a payment, no capture needed" msgstr "" -#: ../src/Payment/PaymentModule.php:364 +#: src/Payment/PaymentModule.php:366 msgctxt "Order note info" msgid "Order already canceled at Mollie, can not be shipped/captured." msgstr "" -#: ../src/Payment/PaymentModule.php:372 +#: src/Payment/PaymentModule.php:374 msgctxt "Order note info" msgid "Order already completed at Mollie, can not be shipped/captured." msgstr "" -#: ../src/Payment/PaymentModule.php:381 +#: src/Payment/PaymentModule.php:383 msgctxt "Order note info" msgid "Order successfully updated to shipped at Mollie, capture of funds underway." msgstr "" -#: ../src/Payment/PaymentModule.php:387 +#: src/Payment/PaymentModule.php:389 msgctxt "Order note info" msgid "Order not paid or authorized at Mollie yet, can not be shipped." msgstr "" -#: ../src/Payment/PaymentModule.php:421 +#: src/Payment/PaymentModule.php:423 msgctxt "Order note info" msgid "Order contains Mollie payment method, but not a valid Mollie Order ID. Canceling order failed." msgstr "" -#: ../src/Payment/PaymentModule.php:442 +#: src/Payment/PaymentModule.php:444 msgctxt "Order note info" msgid "Order already canceled at Mollie, can not be canceled again." msgstr "" -#: ../src/Payment/PaymentModule.php:452 +#: src/Payment/PaymentModule.php:454 msgctxt "Order note info" msgid "Order also cancelled at Mollie." msgstr "" -#: ../src/Payment/PaymentModule.php:458 +#: src/Payment/PaymentModule.php:460 msgctxt "Order note info" msgid "Order could not be canceled at Mollie, because order status is " msgstr "" -#: ../src/Payment/PaymentService.php:620 +#: src/Payment/PaymentService.php:622 msgid "Subscription switch failed, no valid mandate found. Place a completely new order to change your subscription." msgstr "" -#: ../src/Payment/PaymentService.php:626 +#: src/Payment/PaymentService.php:628 msgid "Failed switching subscriptions, no valid mandate." msgstr "" -#: ../src/Payment/PaymentService.php:635 +#: src/Payment/PaymentService.php:638 msgid "Order completed internally because of an existing valid mandate at Mollie." msgstr "" -#. translators: Placeholder 1: Payment method title -#: ../src/Payment/PaymentService.php:708, ../src/Buttons/ApplePayButton/AppleAjaxRequests.php:723, ../src/Buttons/PayPalButton/PayPalAjaxRequests.php:113, ../src/Buttons/PayPalButton/PayPalAjaxRequests.php:159 -msgid "Could not create %s payment." -msgstr "" - -#: ../src/Payment/PaymentService.php:766, ../src/Subscription/MollieSepaRecurringGateway.php:127, ../src/Subscription/MollieSubscriptionGateway.php:461 +#: src/Payment/PaymentService.php:779 +#: src/Subscription/MollieSepaRecurringGateway.php:126 +#: src/Subscription/MollieSubscriptionGateway.php:449 msgid "Awaiting payment confirmation." msgstr "" #. translators: Placeholder 1: Payment method title, placeholder 2: payment ID -#: ../src/Payment/PaymentService.php:786 -msgid "%s payment started (%s)." +#: src/Payment/PaymentService.php:799 +#: src/Subscription/MollieSepaRecurringGateway.php:135 +#: src/Subscription/MollieSubscriptionGateway.php:456 +msgid "%1$s payment started (%2$s)." msgstr "" -#: ../src/Payment/RefundLineItemsBuilder.php:126 +#: src/Payment/PaymentService.php:869 +msgid "Payment failed due to: Mollie is out of service. Please try again later." +msgstr "" + +#: src/Payment/RefundLineItemsBuilder.php:126 msgid "Mollie doesn't allow a partial refund of the full amount or quantity of at least one order line. Trying to process this as an amount refund instead." msgstr "" -#: ../src/PaymentMethods/Applepay.php:14 +#: src/PaymentMethods/Applepay.php:14 msgid "To accept payments via Apple Pay" msgstr "" -#: ../src/PaymentMethods/Bancontact.php:14 +#: src/PaymentMethods/Bancontact.php:13 msgid "Bancontact" msgstr "" -#: ../src/PaymentMethods/Banktransfer.php:33 +#: src/PaymentMethods/Banktransfer.php:32 msgid "Bank Transfer" msgstr "" -#: ../src/PaymentMethods/Banktransfer.php:55, ../src/Settings/General/MollieGeneralSettings.php:235 +#: src/PaymentMethods/Banktransfer.php:54 +#: src/Settings/General/MollieGeneralSettings.php:252 msgid "Activate expiry time setting" msgstr "" -#: ../src/PaymentMethods/Banktransfer.php:56, ../src/Settings/General/MollieGeneralSettings.php:236 +#: src/PaymentMethods/Banktransfer.php:55 +#: src/Settings/General/MollieGeneralSettings.php:253 msgid "Enable expiry time for payments" msgstr "" -#: ../src/PaymentMethods/Banktransfer.php:57 +#: src/PaymentMethods/Banktransfer.php:56 msgid "Enable this option if you want to be able to set the time after which the payment will expire. This will turn all transactions into payments instead of orders" msgstr "" -#: ../src/PaymentMethods/Banktransfer.php:62, ../src/Settings/General/MollieGeneralSettings.php:242 +#: src/PaymentMethods/Banktransfer.php:61 +#: src/Settings/General/MollieGeneralSettings.php:259 msgid "Expiry time" msgstr "" #. translators: Placeholder 1: Default expiry days. -#: ../src/PaymentMethods/Banktransfer.php:65 +#: src/PaymentMethods/Banktransfer.php:64 msgid "Number of DAYS after the payment will expire. Default %d days" msgstr "" -#: ../src/PaymentMethods/Banktransfer.php:74 +#: src/PaymentMethods/Banktransfer.php:73 msgid "Skip Mollie payment screen" msgstr "" -#: ../src/PaymentMethods/Banktransfer.php:75 +#: src/PaymentMethods/Banktransfer.php:74 msgid "Skip Mollie payment screen when Bank Transfer is selected" msgstr "" -#: ../src/PaymentMethods/Banktransfer.php:76 +#: src/PaymentMethods/Banktransfer.php:75 msgid "Enable this option if you want to skip redirecting your user to the Mollie payment screen, instead this will redirect your user directly to the WooCommerce order received page displaying instructions how to complete the Bank Transfer payment." msgstr "" -#: ../src/PaymentMethods/Belfius.php:13 +#: src/PaymentMethods/Belfius.php:13 msgid "Belfius Direct Net" msgstr "" -#: ../src/PaymentMethods/Creditcard.php:16 +#: src/PaymentMethods/Billie.php:13 +msgid "Billie" +msgstr "" + +#: src/PaymentMethods/Billie.php:14 +msgid "To accept payments via Billie, all default WooCommerce checkout fields should be enabled and required." +msgstr "" + +#: src/PaymentMethods/Billie.php:29 +msgid "Company field is empty. The company field is required." +msgstr "" + +#: src/PaymentMethods/Billie.php:33 +msgid "Please enter your company name here." +msgstr "" + +#: src/PaymentMethods/Creditcard.php:16 msgid "Credit card" msgstr "" -#: ../src/PaymentMethods/Creditcard.php:52 +#: src/PaymentMethods/Creditcard.php:52 msgid "Enable Mollie Components" msgstr "" -#. translators: Placeholder 1: Mollie Components. -#: ../src/PaymentMethods/Creditcard.php:55 +#: src/PaymentMethods/Creditcard.php:55 msgid "Use the Mollie Components for this Gateway. Read more about %s and how it improves your conversion." msgstr "" -#: ../src/PaymentMethods/Creditcard.php:59, ../src/Settings/Page/Components.php:21, ../src/Settings/Page/MollieSettingsPage.php:703 +#: src/PaymentMethods/Creditcard.php:59 +#: src/Settings/Page/Components.php:21 +#: src/Settings/Page/MollieSettingsPage.php:733 msgid "Mollie Components" msgstr "" -#: ../src/PaymentMethods/Creditcard.php:92 +#: src/PaymentMethods/Creditcard.php:92 msgid "Customize Icons" msgstr "" -#: ../src/PaymentMethods/Creditcard.php:99 +#: src/PaymentMethods/Creditcard.php:99 msgid "Enable Icons Selector" msgstr "" -#: ../src/PaymentMethods/Creditcard.php:100 +#: src/PaymentMethods/Creditcard.php:100 msgid "Show customized creditcard icons on checkout page" msgstr "" -#: ../src/PaymentMethods/Creditcard.php:108 +#: src/PaymentMethods/Creditcard.php:108 msgid "Show American Express Icon" msgstr "" -#: ../src/PaymentMethods/Creditcard.php:113 +#: src/PaymentMethods/Creditcard.php:113 msgid "Show Carta Si Icon" msgstr "" -#: ../src/PaymentMethods/Creditcard.php:118 +#: src/PaymentMethods/Creditcard.php:118 msgid "Show Carte Bancaire Icon" msgstr "" -#: ../src/PaymentMethods/Creditcard.php:123 +#: src/PaymentMethods/Creditcard.php:123 msgid "Show Maestro Icon" msgstr "" -#: ../src/PaymentMethods/Creditcard.php:128 +#: src/PaymentMethods/Creditcard.php:128 msgid "Show Mastercard Icon" msgstr "" -#: ../src/PaymentMethods/Creditcard.php:133 +#: src/PaymentMethods/Creditcard.php:133 msgid "Show Visa Icon" msgstr "" -#: ../src/PaymentMethods/Creditcard.php:138 +#: src/PaymentMethods/Creditcard.php:138 msgid "Show VPay Icon" msgstr "" -#: ../src/PaymentMethods/Directdebit.php:13 +#: src/PaymentMethods/Directdebit.php:13 msgid "SEPA Direct Debit" msgstr "" -#: ../src/PaymentMethods/Directdebit.php:14 +#: src/PaymentMethods/Directdebit.php:14 msgid "SEPA Direct Debit is used for recurring payments with WooCommerce Subscriptions, and will not be shown in the WooCommerce checkout for regular payments! You also need to enable iDEAL and/or other \"first\" payment methods if you want to use SEPA Direct Debit." msgstr "" -#: ../src/PaymentMethods/Eps.php:13 +#: src/PaymentMethods/Eps.php:13 msgid "EPS" msgstr "" -#: ../src/PaymentMethods/Giftcard.php:30 +#: src/PaymentMethods/Giftcard.php:30 msgctxt "Placeholder 1: giftcard issuer, Placeholder 2: amount value, Placeholder 3: currency" msgid "Mollie - Giftcard details: %1$s %2$s %3$s." msgstr "" -#: ../src/PaymentMethods/Giftcard.php:42 +#: src/PaymentMethods/Giftcard.php:42 msgctxt "Placeholder 1: remainder method, Placeholder 2: amount value, Placeholder 3: currency" msgid " Remainder: %1$s %2$s %3$s." msgstr "" -#: ../src/PaymentMethods/Giftcard.php:60 +#: src/PaymentMethods/Giftcard.php:60 msgid "Gift cards" msgstr "" -#: ../src/PaymentMethods/Giftcard.php:62, ../src/PaymentMethods/Giftcard.php:105 +#: src/PaymentMethods/Giftcard.php:62 +#: src/PaymentMethods/Giftcard.php:105 msgid "Select your gift card" msgstr "" -#: ../src/PaymentMethods/Giftcard.php:78 +#: src/PaymentMethods/Giftcard.php:78 msgid "Show gift cards dropdown" msgstr "" -#: ../src/PaymentMethods/Giftcard.php:84 +#: src/PaymentMethods/Giftcard.php:84 msgid "If you disable this, a dropdown with various gift cards will not be shown in the WooCommerce checkout, so users will select a gift card on the Mollie payment page after checkout." msgstr "" -#: ../src/PaymentMethods/Giftcard.php:93, ../src/PaymentMethods/Ideal.php:46, ../src/PaymentMethods/Kbc.php:48 +#: src/PaymentMethods/Giftcard.php:93 +#: src/PaymentMethods/Ideal.php:46 +#: src/PaymentMethods/Kbc.php:48 msgid "Issuers empty option" msgstr "" -#: ../src/PaymentMethods/Giftcard.php:99 +#: src/PaymentMethods/Giftcard.php:99 msgid "This text will be displayed as the first option in the gift card dropdown, but only if the above 'Show gift cards dropdown' is enabled." msgstr "" -#: ../src/PaymentMethods/Giropay.php:13 +#: src/PaymentMethods/Giropay.php:13 msgid "Giropay" msgstr "" -#: ../src/PaymentMethods/Ideal.php:15 +#: src/PaymentMethods/Ideal.php:15 msgid "iDEAL" msgstr "" -#: ../src/PaymentMethods/Ideal.php:17, ../src/PaymentMethods/Ideal.php:55, ../src/PaymentMethods/Kbc.php:16, ../src/PaymentMethods/Kbc.php:60 +#: src/PaymentMethods/Ideal.php:17 +#: src/PaymentMethods/Ideal.php:55 +#: src/PaymentMethods/Kbc.php:16 +#: src/PaymentMethods/Kbc.php:60 msgid "Select your bank" msgstr "" -#: ../src/PaymentMethods/Ideal.php:34 +#: src/PaymentMethods/Ideal.php:34 msgid "Show iDEAL banks dropdown" msgstr "" -#: ../src/PaymentMethods/Ideal.php:37 +#: src/PaymentMethods/Ideal.php:37 msgid "If you disable this, a dropdown with various iDEAL banks will not be shown in the WooCommerce checkout, so users will select a iDEAL bank on the Mollie payment page after checkout." msgstr "" -#: ../src/PaymentMethods/Ideal.php:49 +#: src/PaymentMethods/Ideal.php:49 msgid "This text will be displayed as the first option in the iDEAL issuers drop down, if nothing is entered, \"Select your bank\" will be shown. Only if the above 'Show iDEAL banks dropdown' is enabled." msgstr "" -#: ../src/PaymentMethods/In3.php:13 +#: src/PaymentMethods/In3.php:13 msgid "in3" msgstr "" -#: ../src/PaymentMethods/In3.php:15 +#: src/PaymentMethods/In3.php:15 msgid "Pay in 3 instalments, 0% interest" msgstr "" -#: ../src/PaymentMethods/Kbc.php:14 +#: src/PaymentMethods/In3.php:25 +msgid "Required field is empty. Phone and birthdate fields are required." +msgstr "" + +#: src/PaymentMethods/In3.php:29 +msgid "Please enter your phone here. +00.." +msgstr "" + +#: src/PaymentMethods/In3.php:30 +msgid "Please enter your birthdate here." +msgstr "" + +#. translators: Placeholder 1: PayPal consumer name, placeholder 2: PayPal email, placeholder 3: PayPal transaction ID +#: src/PaymentMethods/InstructionStrategies/ApplepayInstructionStrategy.php:19 +msgid "Payment completed by %1$s - %2$s (Apple Pay transaction ID: %3$s)" +msgstr "" + +#. translators: Placeholder 1: consumer name, placeholder 2: consumer IBAN, placeholder 3: consumer BIC +#: src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:28 +#: src/PaymentMethods/InstructionStrategies/DirectDebitInstructionTrait.php:20 +msgid "Payment completed by %1$s (IBAN (last 4 digits): %2$s, BIC: %3$s)" +msgstr "" + +#: src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:37 +msgid "Please complete your payment by transferring the total amount to the following bank account:" +msgstr "" + +#. translators: Placeholder 1: 'Stichting Mollie Payments' +#: src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:41 +msgid "Beneficiary: %s" +msgstr "" + +#. translators: Placeholder 1: Payment details bank account +#: src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:43 +msgid "IBAN: %s" +msgstr "" + +#. translators: Placeholder 1: Payment details bic +#: src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:45 +msgid "BIC: %s" +msgstr "" + +#. translators: Placeholder 1: Payment reference e.g. RF49-0000-4716-6216 (SEPA) or +++513/7587/59959+++ (Belgium) +#: src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:49 +msgid "Payment reference: %s" +msgstr "" + +#. translators: Placeholder 1: Payment reference e.g. RF49-0000-4716-6216 (SEPA) or +++513/7587/59959+++ (Belgium) +#: src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:52 +msgid "Please provide the payment reference %s" +msgstr "" + +#. translators: Placeholder 1: Payment expiry date +#: src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:62 +msgid "The payment will expire on %s." +msgstr "" + +#. translators: Placeholder 1: Payment expiry date +#: src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:68 +msgid "The payment will expire on %s. Please make sure you transfer the total amount before this date." +msgstr "" + +#. translators: Placeholder 1: card holder +#: src/PaymentMethods/InstructionStrategies/CreditcardInstructionStrategy.php:19 +msgid "Payment completed by %s" +msgstr "" + +#: src/PaymentMethods/InstructionStrategies/DefaultInstructionStrategy.php:19 +msgid "We have not received a definite payment status." +msgstr "" + +#: src/PaymentMethods/InstructionStrategies/DefaultInstructionStrategy.php:25 +msgid "We have not received a definite payment status. You will receive an email as soon as we receive a confirmation of the bank/merchant." +msgstr "" + +#. translators: Placeholder 1: payment method +#: src/PaymentMethods/InstructionStrategies/DefaultInstructionStrategy.php:33 +msgid "Payment completed with %s" +msgstr "" + +#. translators: Placeholder 1: Mollie_WC_Gateway_MyBank consumer name, placeholder 2: Consumer Account number +#: src/PaymentMethods/InstructionStrategies/MybankInstructionStrategy.php:18 +msgid "Payment completed by %1$s - %2$s" +msgstr "" + +#. translators: Placeholder 1: customer billing email +#: src/PaymentMethods/InstructionStrategies/Przelewy24InstructionStrategy.php:19 +msgid "Payment completed by %s." +msgstr "" + +#: src/PaymentMethods/Kbc.php:14 msgid "KBC/CBC Payment Button" msgstr "" -#: ../src/PaymentMethods/Kbc.php:33 +#: src/PaymentMethods/Kbc.php:33 msgid "Show KBC/CBC banks dropdown" msgstr "" -#: ../src/PaymentMethods/Kbc.php:39 +#: src/PaymentMethods/Kbc.php:39 msgid "If you disable this, a dropdown with various KBC/CBC banks will not be shown in the WooCommerce checkout, so users will select a KBC/CBC bank on the Mollie payment page after checkout." msgstr "" -#: ../src/PaymentMethods/Kbc.php:54 +#: src/PaymentMethods/Kbc.php:54 msgid "This text will be displayed as the first option in the KBC/CBC issuers drop down, if nothing is entered, \"Select your bank\" will be shown. Only if the above ''Show KBC/CBC banks dropdown' is enabled." msgstr "" -#: ../src/PaymentMethods/Klarnapaylater.php:13 -msgid "Klarna Pay later" -msgstr "" - +#: src/PaymentMethods/Klarna.php:13 msgid "Pay with Klarna" msgstr "" -#: ../src/PaymentMethods/Klarnapaylater.php:14, ../src/PaymentMethods/Klarnapaynow.php:14, ../src/PaymentMethods/Klarnasliceit.php:15 +#: src/PaymentMethods/Klarna.php:14 +#: src/PaymentMethods/Klarnapaylater.php:14 +#: src/PaymentMethods/Klarnapaynow.php:14 +#: src/PaymentMethods/Klarnasliceit.php:14 msgid "To accept payments via Klarna, all default WooCommerce checkout fields should be enabled and required." msgstr "" -#: ../src/PaymentMethods/Klarnapaynow.php:13 +#: src/PaymentMethods/Klarnapaylater.php:13 +msgid "Klarna Pay later" +msgstr "" + +#: src/PaymentMethods/Klarnapaynow.php:13 msgid "Klarna Pay Now" msgstr "" -#: ../src/PaymentMethods/Klarnasliceit.php:14 +#: src/PaymentMethods/Klarnasliceit.php:13 msgid "Klarna Slice it" msgstr "" -#: ../src/PaymentMethods/Mybank.php:14 +#: src/PaymentMethods/Mybank.php:13 msgid "MyBank" msgstr "" -#: ../src/PaymentMethods/Mybank.php:15 +#: src/PaymentMethods/Mybank.php:14 msgid "To accept payments via MyBank" msgstr "" -#: ../src/PaymentMethods/Paypal.php:14 +#. translators: Placeholder 1: Lock icon. Placeholder 2: Mollie logo. +#: src/PaymentMethods/PaymentFieldsStrategies/CreditcardFieldsStrategy.php:25 +msgid "%1$s Secure payments provided by %2$s" +msgstr "" + +#: src/PaymentMethods/PaymentFieldsStrategies/CreditcardFieldsStrategy.php:43 +msgid "Secure payments provided by" +msgstr "" + +#: src/PaymentMethods/Paypal.php:13 msgid "PayPal" msgstr "" -#: ../src/PaymentMethods/Paypal.php:34 +#: src/PaymentMethods/Paypal.php:33 msgid "Display on cart page" msgstr "" -#: ../src/PaymentMethods/Paypal.php:38 +#: src/PaymentMethods/Paypal.php:37 msgid "Enable the PayPal button to be used in the cart page." msgstr "" -#: ../src/PaymentMethods/Paypal.php:46 +#: src/PaymentMethods/Paypal.php:45 msgid "Display on product page" msgstr "" -#: ../src/PaymentMethods/Paypal.php:50 +#: src/PaymentMethods/Paypal.php:49 msgid "Enable the PayPal button to be used in the product page." msgstr "" -#: ../src/PaymentMethods/Paypal.php:59 +#: src/PaymentMethods/Paypal.php:58 msgctxt "Mollie PayPal Button Settings" msgid "Button text language and color" msgstr "" -#: ../src/PaymentMethods/Paypal.php:60 +#: src/PaymentMethods/Paypal.php:59 msgctxt "Mollie PayPal Button Settings" msgid "Select the text and the colour of the button." msgstr "" -#: ../src/PaymentMethods/Paypal.php:70 +#: src/PaymentMethods/Paypal.php:69 msgid "Minimum amount to display button" msgstr "" -#: ../src/PaymentMethods/Paypal.php:74 +#: src/PaymentMethods/Paypal.php:73 msgid "If the product or the cart total amount is under this number, then the button will not show up." msgstr "" -#: ../src/PaymentMethods/Paypal.php:89 +#: src/PaymentMethods/Paypal.php:88 msgctxt "Mollie PayPal button Settings" msgid "English -- Buy with PayPal - Pill blue" msgstr "" -#: ../src/PaymentMethods/Paypal.php:90 +#: src/PaymentMethods/Paypal.php:89 msgctxt "Mollie PayPal button Settings" msgid "English -- Buy with PayPal - Rounded blue" msgstr "" -#: ../src/PaymentMethods/Paypal.php:91 +#: src/PaymentMethods/Paypal.php:90 msgctxt "Mollie PayPal button Settings" msgid "English -- Buy with PayPal - Pill golden" msgstr "" -#: ../src/PaymentMethods/Paypal.php:92 +#: src/PaymentMethods/Paypal.php:91 msgctxt "Mollie PayPal button Settings" msgid "English -- Buy with PayPal - Rounded golden" msgstr "" -#: ../src/PaymentMethods/Paypal.php:93 +#: src/PaymentMethods/Paypal.php:92 msgctxt "Mollie PayPal button Settings" msgid "English -- Buy with PayPal - Pill gray" msgstr "" -#: ../src/PaymentMethods/Paypal.php:94 +#: src/PaymentMethods/Paypal.php:93 msgctxt "Mollie PayPal button Settings" msgid "English -- Buy with PayPal - Rounded gray" msgstr "" -#: ../src/PaymentMethods/Paypal.php:95 +#: src/PaymentMethods/Paypal.php:94 msgctxt "Mollie PayPal button Settings" msgid "English -- Buy with PayPal - Pill white" msgstr "" -#: ../src/PaymentMethods/Paypal.php:96 +#: src/PaymentMethods/Paypal.php:95 msgctxt "Mollie PayPal button Settings" msgid "English -- Buy with PayPal - Rounded white" msgstr "" -#: ../src/PaymentMethods/Paypal.php:97 +#: src/PaymentMethods/Paypal.php:96 msgctxt "Mollie PayPal button Settings" msgid "English -- Checkout with PayPal - Pill black" msgstr "" -#: ../src/PaymentMethods/Paypal.php:98 +#: src/PaymentMethods/Paypal.php:97 msgctxt "Mollie PayPal button Settings" msgid "English -- Checkout with PayPal - Rounded black" msgstr "" -#: ../src/PaymentMethods/Paypal.php:99 +#: src/PaymentMethods/Paypal.php:98 msgctxt "Mollie PayPal button Settings" msgid "English -- Checkout with PayPal - Pill blue" msgstr "" -#: ../src/PaymentMethods/Paypal.php:100 +#: src/PaymentMethods/Paypal.php:99 msgctxt "Mollie PayPal button Settings" msgid "English -- Checkout with PayPal - Rounded blue" msgstr "" -#: ../src/PaymentMethods/Paypal.php:101 +#: src/PaymentMethods/Paypal.php:100 msgctxt "Mollie PayPal button Settings" msgid "English -- Checkout with PayPal - Pill golden" msgstr "" -#: ../src/PaymentMethods/Paypal.php:102 +#: src/PaymentMethods/Paypal.php:101 msgctxt "Mollie PayPal button Settings" msgid "English -- Checkout with PayPal - Rounded golden" msgstr "" -#: ../src/PaymentMethods/Paypal.php:103 +#: src/PaymentMethods/Paypal.php:102 msgctxt "Mollie PayPal button Settings" msgid "English -- Checkout with PayPal - Pill gray" msgstr "" -#: ../src/PaymentMethods/Paypal.php:104 +#: src/PaymentMethods/Paypal.php:103 msgctxt "Mollie PayPal button Settings" msgid "English -- Checkout with PayPal - Rounded gray" msgstr "" -#: ../src/PaymentMethods/Paypal.php:105 +#: src/PaymentMethods/Paypal.php:104 msgctxt "Mollie PayPal button Settings" msgid "English -- Checkout with PayPal - Pill white" msgstr "" -#: ../src/PaymentMethods/Paypal.php:106 +#: src/PaymentMethods/Paypal.php:105 msgctxt "Mollie PayPal button Settings" msgid "English -- Checkout with PayPal - Rounded white" msgstr "" -#: ../src/PaymentMethods/Paypal.php:107 +#: src/PaymentMethods/Paypal.php:106 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Buy with PayPal - Pill black" msgstr "" -#: ../src/PaymentMethods/Paypal.php:108 +#: src/PaymentMethods/Paypal.php:107 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Buy with PayPal - Rounded black" msgstr "" -#: ../src/PaymentMethods/Paypal.php:109 +#: src/PaymentMethods/Paypal.php:108 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Buy with PayPal - Pill blue" msgstr "" -#: ../src/PaymentMethods/Paypal.php:110 +#: src/PaymentMethods/Paypal.php:109 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Buy with PayPal - Rounded blue" msgstr "" -#: ../src/PaymentMethods/Paypal.php:111 +#: src/PaymentMethods/Paypal.php:110 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Buy with PayPal - Pill golden" msgstr "" -#: ../src/PaymentMethods/Paypal.php:112 +#: src/PaymentMethods/Paypal.php:111 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Buy with PayPal - Rounded golden" msgstr "" -#: ../src/PaymentMethods/Paypal.php:113 +#: src/PaymentMethods/Paypal.php:112 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Buy with PayPal - Pill gray" msgstr "" -#: ../src/PaymentMethods/Paypal.php:114 +#: src/PaymentMethods/Paypal.php:113 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Buy with PayPal - Rounded gray" msgstr "" -#: ../src/PaymentMethods/Paypal.php:115 +#: src/PaymentMethods/Paypal.php:114 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Buy with PayPal - Pill white" msgstr "" -#: ../src/PaymentMethods/Paypal.php:116 +#: src/PaymentMethods/Paypal.php:115 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Buy with PayPal - Rounded white" msgstr "" -#: ../src/PaymentMethods/Paypal.php:117 +#: src/PaymentMethods/Paypal.php:116 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Checkout with PayPal - Pill black" msgstr "" -#: ../src/PaymentMethods/Paypal.php:118 +#: src/PaymentMethods/Paypal.php:117 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Checkout with PayPal - Rounded black" msgstr "" -#: ../src/PaymentMethods/Paypal.php:119 +#: src/PaymentMethods/Paypal.php:118 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Checkout with PayPal - Pill blue" msgstr "" -#: ../src/PaymentMethods/Paypal.php:120 +#: src/PaymentMethods/Paypal.php:119 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Checkout with PayPal - Rounded blue" msgstr "" -#: ../src/PaymentMethods/Paypal.php:121 +#: src/PaymentMethods/Paypal.php:120 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Checkout with PayPal - Pill golden" msgstr "" -#: ../src/PaymentMethods/Paypal.php:122 +#: src/PaymentMethods/Paypal.php:121 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Checkout with PayPal - Rounded golden" msgstr "" -#: ../src/PaymentMethods/Paypal.php:123 +#: src/PaymentMethods/Paypal.php:122 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Checkout with PayPal - Pill gray" msgstr "" -#: ../src/PaymentMethods/Paypal.php:124 +#: src/PaymentMethods/Paypal.php:123 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Checkout with PayPal - Rounded gray" msgstr "" -#: ../src/PaymentMethods/Paypal.php:125 +#: src/PaymentMethods/Paypal.php:124 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Checkout with PayPal - Pill white" msgstr "" -#: ../src/PaymentMethods/Paypal.php:126 +#: src/PaymentMethods/Paypal.php:125 msgctxt "Mollie PayPal button Settings" msgid "Dutch -- Checkout with PayPal - Rounded white" msgstr "" -#: ../src/PaymentMethods/Paypal.php:127 +#: src/PaymentMethods/Paypal.php:126 msgctxt "Mollie PayPal button Settings" msgid "German -- Buy with PayPal - Pill black" msgstr "" -#: ../src/PaymentMethods/Paypal.php:128 +#: src/PaymentMethods/Paypal.php:127 msgctxt "Mollie PayPal button Settings" msgid "German -- Buy with PayPal - Rounded black" msgstr "" -#: ../src/PaymentMethods/Paypal.php:129 +#: src/PaymentMethods/Paypal.php:128 msgctxt "Mollie PayPal button Settings" msgid "German -- Buy with PayPal - Pill blue" msgstr "" -#: ../src/PaymentMethods/Paypal.php:130 +#: src/PaymentMethods/Paypal.php:129 msgctxt "Mollie PayPal button Settings" msgid "German -- Buy with PayPal - Rounded blue" msgstr "" -#: ../src/PaymentMethods/Paypal.php:131 +#: src/PaymentMethods/Paypal.php:130 msgctxt "Mollie PayPal button Settings" msgid "German -- Buy with PayPal - Pill golden" msgstr "" -#: ../src/PaymentMethods/Paypal.php:132 +#: src/PaymentMethods/Paypal.php:131 msgctxt "Mollie PayPal button Settings" msgid "German -- Buy with PayPal - Rounded golden" msgstr "" -#: ../src/PaymentMethods/Paypal.php:133 +#: src/PaymentMethods/Paypal.php:132 msgctxt "Mollie PayPal button Settings" msgid "German -- Buy with PayPal - Pill gray" msgstr "" -#: ../src/PaymentMethods/Paypal.php:134 +#: src/PaymentMethods/Paypal.php:133 msgctxt "Mollie PayPal button Settings" msgid "German -- Buy with PayPal - Rounded gray" msgstr "" -#: ../src/PaymentMethods/Paypal.php:135 +#: src/PaymentMethods/Paypal.php:134 msgctxt "Mollie PayPal button Settings" msgid "German -- Buy with PayPal - Pill white" msgstr "" -#: ../src/PaymentMethods/Paypal.php:136 +#: src/PaymentMethods/Paypal.php:135 msgctxt "Mollie PayPal button Settings" msgid "German -- Buy with PayPal - Rounded white" msgstr "" -#: ../src/PaymentMethods/Paypal.php:137 +#: src/PaymentMethods/Paypal.php:136 msgctxt "Mollie PayPal button Settings" msgid "German -- Checkout with PayPal - Pill black" msgstr "" -#: ../src/PaymentMethods/Paypal.php:138 +#: src/PaymentMethods/Paypal.php:137 msgctxt "Mollie PayPal button Settings" msgid "German -- Checkout with PayPal - Rounded black" msgstr "" -#: ../src/PaymentMethods/Paypal.php:139 +#: src/PaymentMethods/Paypal.php:138 msgctxt "Mollie PayPal button Settings" msgid "German -- Checkout with PayPal - Pill blue" msgstr "" -#: ../src/PaymentMethods/Paypal.php:140 +#: src/PaymentMethods/Paypal.php:139 msgctxt "Mollie PayPal button Settings" msgid "German -- Checkout with PayPal - Rounded blue" msgstr "" -#: ../src/PaymentMethods/Paypal.php:141 +#: src/PaymentMethods/Paypal.php:140 msgctxt "Mollie PayPal button Settings" msgid "German -- Checkout with PayPal - Pill golden" msgstr "" -#: ../src/PaymentMethods/Paypal.php:142 +#: src/PaymentMethods/Paypal.php:141 msgctxt "Mollie PayPal button Settings" msgid "German -- Checkout with PayPal - Rounded golden" msgstr "" -#: ../src/PaymentMethods/Paypal.php:143 +#: src/PaymentMethods/Paypal.php:142 msgctxt "Mollie PayPal button Settings" msgid "German -- Checkout with PayPal - Pill gray" msgstr "" -#: ../src/PaymentMethods/Paypal.php:144 +#: src/PaymentMethods/Paypal.php:143 msgctxt "Mollie PayPal button Settings" msgid "German -- Checkout with PayPal - Rounded gray" msgstr "" -#: ../src/PaymentMethods/Paypal.php:145 +#: src/PaymentMethods/Paypal.php:144 msgctxt "Mollie PayPal button Settings" msgid "German -- Checkout with PayPal - Pill white" msgstr "" -#: ../src/PaymentMethods/Paypal.php:146 +#: src/PaymentMethods/Paypal.php:145 msgctxt "Mollie PayPal button Settings" msgid "German -- Checkout with PayPal - Rounded white" msgstr "" -#: ../src/PaymentMethods/Paypal.php:147 +#: src/PaymentMethods/Paypal.php:146 msgctxt "Mollie PayPal button Settings" msgid "French -- Buy with PayPal - Gold" msgstr "" -#: ../src/PaymentMethods/Paypal.php:148 +#: src/PaymentMethods/Paypal.php:147 msgctxt "Mollie PayPal button Settings" msgid "French -- Checkout with PayPal - Gold" msgstr "" -#: ../src/PaymentMethods/Paypal.php:149 +#: src/PaymentMethods/Paypal.php:148 msgctxt "Mollie PayPal button Settings" msgid "French -- Checkout with PayPal - Silver" msgstr "" -#: ../src/PaymentMethods/Paypal.php:150 +#: src/PaymentMethods/Paypal.php:149 msgctxt "Mollie PayPal button Settings" msgid "Polish -- Buy with PayPal - Gold" msgstr "" -#: ../src/PaymentMethods/Paypal.php:151 +#: src/PaymentMethods/Paypal.php:150 msgctxt "Mollie PayPal button Settings" msgid "Polish -- Checkout with PayPal - Gold" msgstr "" -#: ../src/PaymentMethods/Paypal.php:152 +#: src/PaymentMethods/Paypal.php:151 msgctxt "Mollie PayPal button Settings" msgid "Polish -- Checkout with PayPal - Silver" msgstr "" -#: ../src/PaymentMethods/Paysafecard.php:14 +#: src/PaymentMethods/Paysafecard.php:13 msgid "paysafecard" msgstr "" -#: ../src/PaymentMethods/Przelewy24.php:14 +#: src/PaymentMethods/Przelewy24.php:13 msgid "Przelewy24" msgstr "" -#: ../src/PaymentMethods/Przelewy24.php:15 +#: src/PaymentMethods/Przelewy24.php:14 msgid "To accept payments via Przelewy24, a customer email is required for every payment." msgstr "" -#: ../src/PaymentMethods/Sofort.php:14 +#: src/PaymentMethods/Sofort.php:13 msgid "SOFORT Banking" msgstr "" -#: ../src/PaymentMethods/Voucher.php:35 +#: src/PaymentMethods/Voucher.php:34 msgid "Voucher" msgstr "" -#: ../src/PaymentMethods/Voucher.php:54, ../src/Gateway/Voucher/VoucherModule.php:220 -msgid "Select the default products category" -msgstr "" - -#: ../src/PaymentMethods/Voucher.php:57 +#: src/PaymentMethods/Voucher.php:56 msgid "No category" msgstr "" -#: ../src/PaymentMethods/Voucher.php:58, ../src/Gateway/Voucher/VoucherModule.php:113, ../src/Gateway/Voucher/VoucherModule.php:147, ../src/Gateway/Voucher/VoucherModule.php:178, ../src/Gateway/Voucher/VoucherModule.php:233, ../src/Gateway/Voucher/VoucherModule.php:293 -msgid "Meal" -msgstr "" - -#: ../src/PaymentMethods/Voucher.php:59, ../src/Gateway/Voucher/VoucherModule.php:114, ../src/Gateway/Voucher/VoucherModule.php:148, ../src/Gateway/Voucher/VoucherModule.php:181, ../src/Gateway/Voucher/VoucherModule.php:234, ../src/Gateway/Voucher/VoucherModule.php:294 -msgid "Eco" -msgstr "" - -#: ../src/PaymentMethods/Voucher.php:60, ../src/Gateway/Voucher/VoucherModule.php:115, ../src/Gateway/Voucher/VoucherModule.php:149, ../src/Gateway/Voucher/VoucherModule.php:184, ../src/Gateway/Voucher/VoucherModule.php:235, ../src/Gateway/Voucher/VoucherModule.php:295 -msgid "Gift" -msgstr "" - #. translators: Placeholder 1: Default order status, placeholder 2: Link to 'Hold Stock' setting -#: ../src/PaymentMethods/Voucher.php:64 +#: src/PaymentMethods/Voucher.php:63 msgid "In order to process it, all products in the order must have a category. This selector will assign the default category for the shop products" msgstr "" -#: ../src/SDK/Api.php:49 -msgid "Invalid API key(s). Get them on the %1$sDevelopers page in the Mollie dashboard%2$s. The API key(s) must start with 'live_' or 'test_', be at least 30 characters and must not contain any special characters." -msgstr "" - -#: ../src/SDK/Api.php:47 +#: src/SDK/Api.php:47 msgid "No API key provided. Please set your Mollie API keys below." msgstr "" -#: ../src/Settings/Settings.php:174 -msgid "%1$sMollie Payments for WooCommerce%2$s Unable to upload the file. Size must be under 500kb." -msgstr "" - -#: ../src/Settings/Settings.php:216 -msgid "Gateway Disabled" -msgstr "" - -#: ../src/Settings/Settings.php:237 -msgid "Return to payments" -msgstr "" - -#: ../src/Settings/Settings.php:252, ../src/Settings/General/MollieGeneralSettings.php:86 -msgid "Sell to specific countries" -msgstr "" - -#: ../src/Settings/Settings.php:264 -msgid "Choose countries…" -msgstr "" - -#: ../src/Settings/Settings.php:265 -msgid "Country" -msgstr "" - -#: ../src/Settings/Settings.php:274 -msgid "Select all" -msgstr "" - -#: ../src/Settings/Settings.php:275 -msgid "Select none" -msgstr "" - -#: ../src/Settings/Settings.php:470 -msgid "Error" -msgstr "" - -#: ../src/Settings/Settings.php:484 -msgid "Mollie status:" -msgstr "" - -#: ../src/Settings/Settings.php:485 -msgid "Connected" -msgstr "" - -#: ../src/Settings/SettingsModule.php:171 -msgid "Mollie settings" -msgstr "" - -#: ../src/Settings/SettingsModule.php:177 -msgid "Logs" -msgstr "" - -#. translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag. Placeholder 4: Closing link tag. -#: ../src/Settings/SettingsModule.php:187 -msgid "%1$sMollie Payments for WooCommerce%2$s The test mode is active, %3$s disable it%4$s before deploying into production." -msgstr "" - -#: ../src/Shared/Data.php:628 -msgid "Item #%1$s stock incremented from %2$s to %3$s." -msgstr "" - -#. translators: Placeholder 1: Plugin title. Placeholder 2: Min WooCommerce version. Placeholder 3: WooCommerce version used. -#: ../src/Shared/Status.php:74 -msgid "The %1$s plugin requires at least WooCommerce version %2$s, you are using version %3$s. Please update your WooCommerce plugin." -msgstr "" - -#: ../src/Shared/Status.php:87 -msgid "Mollie API client not installed. Please make sure the plugin is installed correctly." -msgstr "" - -#: ../src/Shared/Status.php:96 -msgid "Mollie Payments for WooCommerce requires the JSON extension for PHP. Enable it in your server or ask your webhoster to enable it for you." -msgstr "" - -#. translators: Placeholder 1: Min PHP version. Placeholder 2: PHP version used. Placeholder 3: Opening link tag. placeholder 4: Closing link tag. -#: ../src/Shared/Status.php:111 -msgid "Mollie Payments for WooCommerce require PHP %1$s or higher, you have PHP %2$s. Please upgrade and view %3$sthis FAQ%4$s" -msgstr "" - -#: ../src/Shared/Status.php:123 -msgid "Mollie Payments for WooCommerce requires the PHP extension JSON to be enabled. Please enable the 'json' extension in your PHP configuration." -msgstr "" - -#: ../src/Shared/Status.php:130 -msgid "Mollie Payments for WooCommerce requires the PHP extension cURL to be enabled. Please enable the 'curl' extension in your PHP configuration." -msgstr "" - -#: ../src/Shared/Status.php:138 -msgid "Mollie Payments for WooCommerce require PHP cURL functions to be available. Please make sure all of these functions are available." -msgstr "" - -#. translators: Placeholder 1: Payment method title, placeholder 2: payment ID -#: ../src/Subscription/MollieSepaRecurringGateway.php:136, ../src/Subscription/MollieSubscriptionGateway.php:468 -msgid "%1$s payment started (%2$s)." -msgstr "" - -#. translators: Placeholder 1: Payment method title, placeholder 2: payment ID -#: ../src/Subscription/MollieSubscriptionGateway.php:199 -msgid "Updated subscription from 'On hold' to 'Active' until payment fails, because a SEPA Direct Debit payment takes some time to process." -msgstr "" - -#: ../src/Subscription/MollieSubscriptionGateway.php:299 -msgid "The customer (%s) could not be used or found. " -msgstr "" - -#: ../src/Subscription/MollieSubscriptionGateway.php:326 -msgid "The customer (%s) does not have a valid mandate." -msgstr "" - -#. translators: Placeholder 1: Payment method title -#: ../src/Subscription/MollieSubscriptionGateway.php:366 -msgid "Could not create %s renewal payment." -msgstr "" - -#. translators: Placeholder 1: payment method title, placeholder 2: payment ID -#: ../src/Subscription/SubscriptionModule.php:106 -msgid "%1$s payment failed (%2$s)." -msgstr "" - -#. translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to documentation. Placeholder 4: Closing link tag. -#: ../src/Buttons/ApplePayButton/ApplePayDirectHandler.php:42 -msgid "%1$sServer not compliant with Apple requirements%2$s Check %3$sApple Server requirements page%4$s to fix it in order to make the Apple Pay button work" -msgstr "" - -#. translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to documentation. Placeholder 4: Closing link tag. -#: ../src/Buttons/ApplePayButton/ApplePayDirectHandler.php:58 -msgid "%1$sApple Pay Validation Error%2$s Check %3$sApple Server requirements page%4$s to fix it in order to make the Apple Pay button work" -msgstr "" - -#: ../src/Gateway/Voucher/VoucherModule.php:78, ../src/Settings/Page/MollieSettingsPage.php:49, ../src/Settings/Page/MollieSettingsPage.php:182 -msgid "Mollie Settings" -msgstr "" - -#: ../src/Gateway/Voucher/VoucherModule.php:108, ../src/Gateway/Voucher/VoucherModule.php:143, ../src/Gateway/Voucher/VoucherModule.php:166 -msgid "Mollie Voucher Category" -msgstr "" - -#: ../src/Gateway/Voucher/VoucherModule.php:111, ../src/Gateway/Voucher/VoucherModule.php:145, ../src/Gateway/Voucher/VoucherModule.php:170 -msgid "--Please choose an option--" -msgstr "" - -#: ../src/Gateway/Voucher/VoucherModule.php:112, ../src/Gateway/Voucher/VoucherModule.php:146, ../src/Gateway/Voucher/VoucherModule.php:175, ../src/Gateway/Voucher/VoucherModule.php:232, ../src/Gateway/Voucher/VoucherModule.php:292 -msgid "No Category" -msgstr "" - -#: ../src/Gateway/Voucher/VoucherModule.php:151, ../src/Gateway/Voucher/VoucherModule.php:188 -msgid "Select a voucher category to apply to all products with this category" -msgstr "" - -#: ../src/Gateway/Voucher/VoucherModule.php:224 -msgid "Products voucher category" -msgstr "" - -#: ../src/Gateway/Voucher/VoucherModule.php:231, ../src/Gateway/Voucher/VoucherModule.php:291 -msgid "Same as default category" -msgstr "" - -#. translators: Placeholder 1: Default order status, placeholder 2: Link to 'Hold Stock' setting -#: ../src/Gateway/Voucher/VoucherModule.php:241 -msgid "In order to process it, all products in the order must have a category. To disable the product from voucher selection select \"No category\" option." -msgstr "" - -#: ../src/Gateway/Voucher/VoucherModule.php:288 -msgid "Mollie Voucher category" -msgstr "" - -#: ../src/PaymentMethods/InstructionStrategies/ApplepayInstructionStrategy.php:20 -msgid "Payment completed by %1$s - %2$s (Apple Pay transaction ID: %3$s)" -msgstr "" - -#. translators: Placeholder 1: consumer name, placeholder 2: consumer IBAN, placeholder 3: consumer BIC -#: ../src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:26, ../src/PaymentMethods/InstructionStrategies/DirectdebitInstructionStrategy.php:20, ../src/PaymentMethods/InstructionStrategies/IdealInstructionStrategy.php:20, ../src/PaymentMethods/InstructionStrategies/SofortInstructionStrategy.php:20 -msgid "Payment completed by %1$s (IBAN (last 4 digits): %2$s, BIC: %3$s)" -msgstr "" - -#: ../src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:35 -msgid "Please complete your payment by transferring the total amount to the following bank account:" -msgstr "" - -#. translators: Placeholder 1: 'Stichting Mollie Payments' -#: ../src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:39 -msgid "Beneficiary: %s" -msgstr "" - -#. translators: Placeholder 1: Payment details bank account -#: ../src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:41 -msgid "IBAN: %s" -msgstr "" - -#. translators: Placeholder 1: Payment details bic -#: ../src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:43 -msgid "BIC: %s" -msgstr "" - -#. translators: Placeholder 1: Payment reference e.g. RF49-0000-4716-6216 (SEPA) or +++513/7587/59959+++ (Belgium) -#: ../src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:50 -msgid "Please provide the payment reference %s" -msgstr "" - -#: ../src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:47 -msgid "Payment reference: %s" -msgstr "" - -#. translators: Placeholder 1: Payment expiry date -#: ../src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:66 -msgid "The payment will expire on %s. Please make sure you transfer the total amount before this date." -msgstr "" - -#: ../src/PaymentMethods/InstructionStrategies/BanktransferInstructionStrategy.php:60 -msgid "The payment will expire on %s." -msgstr "" - -#. translators: Placeholder 1: card holder -#: ../src/PaymentMethods/InstructionStrategies/CreditcardInstructionStrategy.php:20 -msgid "Payment completed by %s" -msgstr "" - -#. translators: Placeholder 1: payment method -#: ../src/PaymentMethods/InstructionStrategies/DefaultInstructionStrategy.php:34 -msgid "Payment completed with %s" -msgstr "" - -#: ../src/PaymentMethods/InstructionStrategies/DefaultInstructionStrategy.php:26 -msgid "We have not received a definite payment status. You will receive an email as soon as we receive a confirmation of the bank/merchant." -msgstr "" - -#: ../src/PaymentMethods/InstructionStrategies/DefaultInstructionStrategy.php:20 -msgid "We have not received a definite payment status." -msgstr "" - -#: ../src/PaymentMethods/InstructionStrategies/MybankInstructionStrategy.php:19 -msgid "Payment completed by %1$s - %2$s" -msgstr "" - -#. translators: Placeholder 1: customer billing email -#: ../src/PaymentMethods/InstructionStrategies/Przelewy24InstructionStrategy.php:20 -msgid "Payment completed by %s." +#: src/SDK/Api.php:49 +msgid "Invalid API key(s). Get them on the %1$sDevelopers page in the Mollie dashboard%2$s. The API key(s) must start with 'live_' or 'test_', be at least 30 characters and must not contain any special characters." msgstr "" -#. translators: Placeholder 1: Lock icon. Placeholder 2: Mollie logo. -#: ../src/PaymentMethods/PaymentFieldsStrategies/CreditcardFieldsStrategy.php:25 -msgid "%1$s Secure payments provided by %2$s" +#. translators: Placeholder 1: Gateway title +#: src/Settings/General/MollieGeneralSettings.php:35 +msgid "%s display settings" msgstr "" -#: ../src/PaymentMethods/PaymentFieldsStrategies/CreditcardFieldsStrategy.php:41 -msgid "Secure payments provided by" +#: src/Settings/General/MollieGeneralSettings.php:55 +msgid "Use API dynamic title and gateway logo" msgstr "" -#. translators: Placeholder 1: Gateway title -#: ../src/Settings/General/MollieGeneralSettings.php:34 -msgid "%s display settings" +#: src/Settings/General/MollieGeneralSettings.php:60 +msgid "Retrieve the gateway title and logo from the Mollie API" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:71 +#: src/Settings/General/MollieGeneralSettings.php:83 msgid "Display logo on checkout page. Default enabled" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:79 +#: src/Settings/General/MollieGeneralSettings.php:91 msgid "Sales countries" msgstr "" +#: src/Settings/General/MollieGeneralSettings.php:98 +#: src/Settings/Settings.php:188 +msgid "Sell to specific countries" +msgstr "" + #. translators: Placeholder 1: Gateway title -#: ../src/Settings/General/MollieGeneralSettings.php:99 +#: src/Settings/General/MollieGeneralSettings.php:111 msgid "%s custom logo" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:103 +#: src/Settings/General/MollieGeneralSettings.php:117 msgid "Enable custom logo" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:109 +#: src/Settings/General/MollieGeneralSettings.php:123 msgid "Enable the feature to add a custom logo for this gateway. This feature will have precedence over other logo options." msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:115 +#: src/Settings/General/MollieGeneralSettings.php:129 msgid "Upload custom logo" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:123 +#: src/Settings/General/MollieGeneralSettings.php:137 msgid "Upload a custom icon for this gateway. The feature must be enabled." msgstr "" #. translators: Placeholder 1: Gateway title -#: ../src/Settings/General/MollieGeneralSettings.php:134 +#: src/Settings/General/MollieGeneralSettings.php:148 msgid "%s surcharge" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:139 +#: src/Settings/General/MollieGeneralSettings.php:154 msgid "Payment Surcharge" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:145 +#: src/Settings/General/MollieGeneralSettings.php:160 msgid "No fee" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:149 +#: src/Settings/General/MollieGeneralSettings.php:164 msgid "Fixed fee" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:153 +#: src/Settings/General/MollieGeneralSettings.php:168 msgid "Percentage" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:157 +#: src/Settings/General/MollieGeneralSettings.php:172 msgid "Fixed fee and percentage" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:163 +#: src/Settings/General/MollieGeneralSettings.php:178 msgid "Choose a payment surcharge for this gateway" msgstr "" #. translators: Placeholder 1: currency -#: ../src/Settings/General/MollieGeneralSettings.php:172 +#: src/Settings/General/MollieGeneralSettings.php:187 msgid "Payment surcharge fixed amount in %s" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:176 +#: src/Settings/General/MollieGeneralSettings.php:192 msgid "Control the fee added on checkout. Default 0.00" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:186 +#: src/Settings/General/MollieGeneralSettings.php:202 msgid "Payment surcharge percentage amount %" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:189 +#: src/Settings/General/MollieGeneralSettings.php:205 msgid "Control the percentage fee added on checkout. Default 0.00" msgstr "" #. translators: Placeholder 1: currency -#: ../src/Settings/General/MollieGeneralSettings.php:200 +#: src/Settings/General/MollieGeneralSettings.php:216 msgid "Payment surcharge limit in %s" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:203 +#: src/Settings/General/MollieGeneralSettings.php:219 msgid "Limit the maximum fee added on checkout. Default 0, means no limit" msgstr "" #. translators: Placeholder 1: currency -#: ../src/Settings/General/MollieGeneralSettings.php:214 +#: src/Settings/General/MollieGeneralSettings.php:230 msgid "Surcharge only under this limit, in %s" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:217 +#: src/Settings/General/MollieGeneralSettings.php:233 msgid "Maximum order amount to apply surcharge. If the order is above this number the surcharge will not apply. Default 0, means no maximum" msgstr "" #. translators: Placeholder 1: gateway title -#: ../src/Settings/General/MollieGeneralSettings.php:230 +#: src/Settings/General/MollieGeneralSettings.php:246 msgid "%s advanced" msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:237 +#: src/Settings/General/MollieGeneralSettings.php:254 msgid "Enable this option if you want to be able to set the time after which the order will expire." msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:245 +#: src/Settings/General/MollieGeneralSettings.php:262 msgid "Number of MINUTES after the order will expire and will be canceled at Mollie and WooCommerce. A value of 0 means no expiry time will be considered." msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:258 +#: src/Settings/General/MollieGeneralSettings.php:275 msgid "Initial order status" msgstr "" -#. translators: Placeholder 1: Default order status, placeholder 2: Link to 'Hold Stock' setting -#: ../src/Settings/General/MollieGeneralSettings.php:277 +#: src/Settings/General/MollieGeneralSettings.php:292 msgid "Some payment methods take longer than a few hours to complete. The initial order state is then set to '%1$s'. This ensures the order is not cancelled when the setting %2$s is used." msgstr "" -#: ../src/Settings/General/MollieGeneralSettings.php:286 -msgid "Hold Stock (minutes)" -msgstr "" - -#: ../src/Settings/Page/MollieSettingsPage.php:111 +#: src/Settings/Page/MollieSettingsPage.php:112 msgid "Quickly integrate all major payment methods in WooCommerce, wherever you need them." msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:115 +#: src/Settings/Page/MollieSettingsPage.php:116 msgid " Simply drop them ready-made into your WooCommerce webshop with this powerful plugin by Mollie." msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:119 +#: src/Settings/Page/MollieSettingsPage.php:120 msgid " Mollie is dedicated to making payments better for WooCommerce. " msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:123 +#: src/Settings/Page/MollieSettingsPage.php:124 msgid "Please go to" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:126 +#: src/Settings/Page/MollieSettingsPage.php:127 msgid " the signup page" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:130 +#: src/Settings/Page/MollieSettingsPage.php:131 msgid " to create a new Mollie account and start receiving payments in a couple of minutes. " msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:134 +#: src/Settings/Page/MollieSettingsPage.php:135 msgid "Contact " msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:138 +#: src/Settings/Page/MollieSettingsPage.php:139 msgid " if you have any questions or comments about this plugin." msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:142 +#: src/Settings/Page/MollieSettingsPage.php:143 msgid "Our pricing is always per transaction. No startup fees, no monthly fees, and no gateway fees. No hidden fees, period." msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:148 +#: src/Settings/Page/MollieSettingsPage.php:149 msgid "Plugin Documentation" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:151 +#: src/Settings/Page/MollieSettingsPage.php:152 msgid "Contact Support" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:163 +#: src/Settings/Page/MollieSettingsPage.php:164 msgid "Log plugin events." msgstr "" #. translators: Placeholder 1: Location of the log files -#: ../src/Settings/Page/MollieSettingsPage.php:170 +#: src/Settings/Page/MollieSettingsPage.php:171 msgid "Log files are saved to %s" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:192 +#: src/Settings/Page/MollieSettingsPage.php:193 msgid "Live API key" msgstr "" #. translators: Placeholder 1: API key mode (live or test). The surrounding %s's Will be replaced by a link to the Mollie profile -#: ../src/Settings/Page/MollieSettingsPage.php:197, ../src/Settings/Page/MollieSettingsPage.php:230 +#: src/Settings/Page/MollieSettingsPage.php:198 +#: src/Settings/Page/MollieSettingsPage.php:229 msgid "The API key is used to connect to Mollie. You can find your %1$s API key in your %2$sMollie account%3$s" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:208 +#: src/Settings/Page/MollieSettingsPage.php:207 msgid "Live API key should start with live_" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:215 +#: src/Settings/Page/MollieSettingsPage.php:214 msgid "Enable test mode" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:218 +#: src/Settings/Page/MollieSettingsPage.php:217 msgid "Enable test mode if you want to test the plugin without using real payments." msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:225 +#: src/Settings/Page/MollieSettingsPage.php:224 msgid "Test API key" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:241 +#: src/Settings/Page/MollieSettingsPage.php:238 msgid "Test API key should start with test_" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:248 +#: src/Settings/Page/MollieSettingsPage.php:245 msgid "Debug Log" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:300 +#: src/Settings/Page/MollieSettingsPage.php:301 msgid "Gateway enabled" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:304 +#: src/Settings/Page/MollieSettingsPage.php:305 msgid "Gateway disabled" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:307 +#: src/Settings/Page/MollieSettingsPage.php:308 msgid "Disabled" msgstr "" #. translators: The surrounding %s's Will be replaced by a link to the Mollie profile -#: ../src/Settings/Page/MollieSettingsPage.php:318 +#: src/Settings/Page/MollieSettingsPage.php:319 msgid "The following payment methods are activated in your %1$sMollie profile%2$s:" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:333 +#: src/Settings/Page/MollieSettingsPage.php:334 msgid "Refresh" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:342 +#: src/Settings/Page/MollieSettingsPage.php:343 msgid "No payment methods available" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:357 +#: src/Settings/Page/MollieSettingsPage.php:358 msgid "Edit" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:365 +#: src/Settings/Page/MollieSettingsPage.php:366 msgid "Activate" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:411 +#: src/Settings/Page/MollieSettingsPage.php:417 msgid "You have WooCommerce Subscriptions activated, but not SEPA Direct Debit. Enable SEPA Direct Debit if you want to allow customers to pay subscriptions with iDEAL and/or other \"first\" payment methods." msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:437 +#: src/Settings/Page/MollieSettingsPage.php:443 msgid "You have the WooCommerce default Direct Bank Transfer (BACS) payment gateway enabled in WooCommerce. Mollie strongly advices only using Bank Transfer via Mollie and disabling the default WooCommerce BACS payment gateway to prevent possible conflicts." msgstr "" #. translators: Placeholder 1: Opening link tag. Placeholder 2: Closing link tag. Placeholder 3: Opening link tag. Placeholder 4: Closing link tag. -#: ../src/Settings/Page/MollieSettingsPage.php:461 +#: src/Settings/Page/MollieSettingsPage.php:467 msgid "You have activated Klarna. To accept payments, please make sure all default WooCommerce checkout fields are enabled and required. For more information, go to %1$sKlarna Pay Later documentation%2$s or %3$sKlarna Slice it documentation%4$s" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:702 +#: src/Settings/Page/MollieSettingsPage.php:732 msgid "General" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:707 +#: src/Settings/Page/MollieSettingsPage.php:737 msgid "Advanced" msgstr "" -#: ../src/Settings/Page/MollieSettingsPage.php:710 +#: src/Settings/Page/MollieSettingsPage.php:740 msgid "Apple Pay Button" msgstr "" + +#: src/Settings/Page/MollieSettingsPage.php:780 +msgid "You have activated Billie. To accept payments, please make sure all default WooCommerce checkout fields are enabled and required. The billing company field is required as well. Make sure to enable the billing company field in the WooCommerce settings if you are using Woocommerce blocks." +msgstr "" + +#: src/Settings/Settings.php:153 +msgid "Gateway Disabled" +msgstr "" + +#: src/Settings/Settings.php:173 +msgid "Return to payments" +msgstr "" + +#: src/Settings/Settings.php:199 +msgid "Choose countries…" +msgstr "" + +#: src/Settings/Settings.php:200 +msgid "Country" +msgstr "" + +#: src/Settings/Settings.php:208 +msgid "Select all" +msgstr "" + +#: src/Settings/Settings.php:209 +msgid "Select none" +msgstr "" + +#: src/Settings/Settings.php:403 +msgid "Error" +msgstr "" + +#: src/Settings/Settings.php:417 +msgid "Mollie status:" +msgstr "" + +#: src/Settings/Settings.php:418 +msgid "Connected" +msgstr "" + +#: src/Settings/Settings.php:653 +msgid "%1$sMollie Payments for WooCommerce%2$s Unable to upload the file. Only jpg, jpeg, png and gif files are allowed." +msgstr "" + +#: src/Settings/Settings.php:666 +msgid "%1$sMollie Payments for WooCommerce%2$s Unable to upload the file. Size must be under 500kb." +msgstr "" + +#: src/Settings/SettingsModule.php:184 +msgid "Mollie settings" +msgstr "" + +#: src/Settings/SettingsModule.php:190 +msgid "Logs" +msgstr "" + +#. translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag. Placeholder 4: Closing link tag. +#: src/Settings/SettingsModule.php:204 +msgid "%1$sMollie Payments for WooCommerce%2$s The test mode is active, %3$s disable it%4$s before deploying into production." +msgstr "" + +#. translators: Placeholder 1: Plugin title. Placeholder 2: Min WooCommerce version. Placeholder 3: WooCommerce version used. +#: src/Shared/Status.php:75 +msgid "The %1$s plugin requires at least WooCommerce version %2$s, you are using version %3$s. Please update your WooCommerce plugin." +msgstr "" + +#: src/Shared/Status.php:88 +msgid "Mollie API client not installed. Please make sure the plugin is installed correctly." +msgstr "" + +#: src/Shared/Status.php:97 +msgid "Mollie Payments for WooCommerce requires the JSON extension for PHP. Enable it in your server or ask your webhoster to enable it for you." +msgstr "" + +#. translators: Placeholder 1: Min PHP version. Placeholder 2: PHP version used. Placeholder 3: Opening link tag. placeholder 4: Closing link tag. +#: src/Shared/Status.php:112 +msgid "Mollie Payments for WooCommerce require PHP %1$s or higher, you have PHP %2$s. Please upgrade and view %3$sthis FAQ%4$s" +msgstr "" + +#: src/Shared/Status.php:124 +msgid "Mollie Payments for WooCommerce requires the PHP extension JSON to be enabled. Please enable the 'json' extension in your PHP configuration." +msgstr "" + +#: src/Shared/Status.php:131 +msgid "Mollie Payments for WooCommerce requires the PHP extension cURL to be enabled. Please enable the 'curl' extension in your PHP configuration." +msgstr "" + +#: src/Shared/Status.php:139 +msgid "Mollie Payments for WooCommerce require PHP cURL functions to be available. Please make sure all of these functions are available." +msgstr "" + +#. translators: Placeholder 1: Payment method title, placeholder 2: payment ID +#: src/Subscription/MollieSubscriptionGateway.php:197 +msgid "Updated subscription from 'On hold' to 'Active' until payment fails, because a SEPA Direct Debit payment takes some time to process." +msgstr "" + +#: src/Subscription/MollieSubscriptionGateway.php:285 +msgid "The customer (%s) could not be used or found. " +msgstr "" + +#. translators: Placeholder 1: Payment method title +#: src/Subscription/MollieSubscriptionGateway.php:354 +msgid "Could not create %s renewal payment." +msgstr "" + +#. translators: Placeholder 1: payment method title, placeholder 2: payment ID +#: src/Subscription/SubscriptionModule.php:110 +msgid "%1$s payment failed (%2$s)." +msgstr "" From 8f1b46ff9865f9cdf3c05e574d8085290048c303 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Wed, 13 Sep 2023 10:38:43 +0200 Subject: [PATCH 37/37] update version and wc required --- mollie-payments-for-woocommerce.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mollie-payments-for-woocommerce.php b/mollie-payments-for-woocommerce.php index fa19ad816..4fa52b05d 100644 --- a/mollie-payments-for-woocommerce.php +++ b/mollie-payments-for-woocommerce.php @@ -3,7 +3,7 @@ * Plugin Name: Mollie Payments for WooCommerce * Plugin URI: https://www.mollie.com * Description: Accept payments in WooCommerce with the official Mollie plugin - * Version: 7.3.12 + * Version: 7.4.0-beta * Author: Mollie * Author URI: https://www.mollie.com * Requires at least: 5.0 @@ -11,7 +11,7 @@ * Text Domain: mollie-payments-for-woocommerce * Domain Path: /languages * License: GPLv2 or later - * WC requires at least: 3.0 + * WC requires at least: 3.9 * WC tested up to: 8.0 * Requires PHP: 7.2 */