diff --git a/.idea/WooCommerce.iml b/.idea/WooCommerce.iml index c3c350cf3..9aa75e6b5 100644 --- a/.idea/WooCommerce.iml +++ b/.idea/WooCommerce.iml @@ -9,77 +9,76 @@ - - - + + + + + + + + + - + + + + + + - - - - - - - - - - - - - + - - - - - - - - - - + + + - - - - - - + + + + - - - - - - - - - + + + + + + + + + - - - - - + + + - - - - - + + + + + + + + + + + + + + + + + + + - - - - - + + diff --git a/.idea/php.xml b/.idea/php.xml index 32cb2411d..1df2b9763 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -27,124 +27,82 @@ + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - + + + + + + + + - - - + + - - - - - - - - - - - - - - - - - - - - - + + + + + - + + + - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - + + @@ -237,6 +195,17 @@ + + + + + + + + + + + diff --git a/composer.json b/composer.json index 8c69e2f1a..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", @@ -33,13 +33,14 @@ "inpsyde/php-coding-standards": "^1.0.0", "inpsyde/composer-assets-compiler": "^2.5", "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": { "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 56af50a0b..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": "ac968950c03d4d97b43bd6b0041f6a1d", + "content-hash": "99dd93462bdd098a3d12154b8e71b543", "packages": [ { "name": "composer/ca-bundle", @@ -82,79 +82,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.61.0", @@ -247,59 +174,6 @@ }, "time": "2023-07-31T15:37:46+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", @@ -1480,6 +1354,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": "1.0.0", @@ -1776,16 +1723,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.16.0", + "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": { @@ -1826,9 +1773,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", @@ -1996,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": { @@ -2034,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", @@ -2699,6 +2646,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", @@ -3581,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": { @@ -3660,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": [ { @@ -3676,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", @@ -3747,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": { @@ -3771,7 +3771,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3809,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": [ { @@ -3825,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": { @@ -3850,7 +3850,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3890,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": [ { @@ -3906,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": { @@ -3931,7 +3931,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3974,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": [ { @@ -3990,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": { @@ -4018,7 +4018,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4057,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": [ { @@ -4073,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": { @@ -4095,7 +4095,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4136,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": [ { @@ -4152,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": { @@ -4174,7 +4174,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4219,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": [ { @@ -4235,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", @@ -4725,8 +4725,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": true, "prefer-lowest": false, 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 "" 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 @@ + + 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/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/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 { diff --git a/resources/scss/mollie-gateway-icons.scss b/resources/scss/mollie-gateway-icons.scss index f57701889..4921954e2 100644 --- a/resources/scss/mollie-gateway-icons.scss +++ b/resources/scss/mollie-gateway-icons.scss @@ -1,9 +1,9 @@ .mollie-gateway-icon { vertical-align: bottom; - height: 24px; } label .mollie-gateway-icon{ float:right; + max-height: 24px !important; } .mollie-gateway-icon svg{ float:right; diff --git a/src/Activation/ActivationModule.php b/src/Activation/ActivationModule.php index 9d225c4ac..27f334424 100644 --- a/src/Activation/ActivationModule.php +++ b/src/Activation/ActivationModule.php @@ -7,14 +7,11 @@ namespace Mollie\WooCommerce\Activation; use Automattic\WooCommerce\Utilities\FeaturesUtil; -use Inpsyde\Modularity\Module\ExecutableModule; -use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; -use Inpsyde\Modularity\Package; +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 function Mollie\WooCommerce\mollie_wc_plugin_autoload; +use Mollie\WooCommerce\Vendor\Psr\Container\ContainerInterface; class ActivationModule implements ExecutableModule { 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(); diff --git a/src/Assets/AssetsModule.php b/src/Assets/AssetsModule.php index 17ed4a53c..9b46d9503 100644 --- a/src/Assets/AssetsModule.php +++ b/src/Assets/AssetsModule.php @@ -6,19 +6,16 @@ namespace Mollie\WooCommerce\Assets; -use Inpsyde\Modularity\Module\ExecutableModule; -use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry; +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\Gateway\MolliePaymentGateway; -use Mollie\WooCommerce\Gateway\MolliePaymentGatewayI; -use Mollie\WooCommerce\PaymentMethods\PaymentMethodI; use Mollie\WooCommerce\Settings\Settings; use Mollie\WooCommerce\Shared\Data; -use Mollie\WooCommerce\PaymentMethods\Constants; -use Psr\Container\ContainerInterface; +use Mollie\WooCommerce\Vendor\Psr\Container\ContainerInterface; class AssetsModule implements ExecutableModule { @@ -35,15 +32,10 @@ public function enqueueBlockCheckoutScripts(Data $dataService, array $gatewayIns if (!has_block('woocommerce/checkout')) { return; } - wp_enqueue_script('mollie_block_index'); + wp_enqueue_script(MollieCheckoutBlocksSupport::getScriptHandle()); wp_enqueue_style('mollie-gateway-icons'); - wp_localize_script( - 'mollie_block_index', - 'mollieBlockData', - [ - 'gatewayData' => $this->gatewayDataForWCBlocks($dataService, $gatewayInstances), - ] - ); + + MollieCheckoutBlocksSupport::localizeWCBlocksData($dataService, $gatewayInstances); } public function registerButtonsBlockScripts(string $pluginUrl, string $pluginPath): void @@ -372,7 +364,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,102 +428,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 === Constants::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, '/'); @@ -547,7 +443,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'); } @@ -638,6 +537,42 @@ 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 && 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 + ) { + $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) { @@ -709,12 +644,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 new file mode 100644 index 000000000..fe69e72dc --- /dev/null +++ b/src/Assets/MollieCheckoutBlocksSupport.php @@ -0,0 +1,175 @@ +dataService = $dataService; + $this->gatewayInstances = $gatewayInstances; + $this->registerScriptUrl = $registerScriptUrl; + $this->registerScriptVersion = $registerScriptVersion; + } + + public function initialize() + { + // + } + + public static function getScriptHandle() + { + + return self::$scriptHandle; + } + + public function get_payment_method_script_handles(): array + { + wp_register_script( + 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( + self::$scriptHandle, + 'mollieBlockData', + [ + 'gatewayData' => self::gatewayDataForWCBlocks($dataService, $gatewayInstances), + ] + ); + } + + public static 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) { + $gatewayId = is_string($gateway->paymentMethod()->getProperty('id')) ? $gateway->paymentMethod( + )->getProperty('id') : ""; + + if ($gateway->enabled !== 'yes' || ($gatewayId === 'directdebit' && !is_admin())) { + 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' => self::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 static function gatewaySupportsFeatures(PaymentMethodI $paymentMethod, bool $isSepaEnabled): array + { + $supports = (array)$paymentMethod->getProperty('supports'); + $isSepaPaymentMethod = (bool)$paymentMethod->getProperty('SEPA'); + if ($isSepaEnabled && $isSepaPaymentMethod) { + $supports[] = 'subscriptions'; + } + + return $supports; + } +} diff --git a/src/Gateway/GatewayModule.php b/src/Gateway/GatewayModule.php index 44829d109..bc5b2a184 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 @@ -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); @@ -670,6 +617,7 @@ public function buildPaymentMethod( Surcharge $surchargeService, array $apiMethod ): PaymentMethodI { + $paymentMethodClassName = 'Mollie\\WooCommerce\\PaymentMethods\\' . ucfirst($id); $paymentMethod = new $paymentMethodClassName( $iconFactory, diff --git a/src/Gateway/Voucher/VoucherModule.php b/src/Gateway/Voucher/VoucherModule.php index 1efd944e0..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 { @@ -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)); 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/MollieOrder.php b/src/Payment/MollieOrder.php index 6d01d3ed1..7f63813b2 100644 --- a/src/Payment/MollieOrder.php +++ b/src/Payment/MollieOrder.php @@ -159,8 +159,8 @@ 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; + //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); $paymentRequestData['payment']['applePayPaymentToken'] = $encodedApplePayToken; diff --git a/src/Payment/MollieOrderService.php b/src/Payment/MollieOrderService.php index 898c0686e..bb5b52dfe 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,10 +15,15 @@ use Mollie\WooCommerce\Shared\SharedDataDictionary; use Psr\Log\LoggerInterface as Logger; use Psr\Log\LogLevel; +use WC_Abstract_Order; use WC_Order; 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 @@ -129,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); @@ -163,17 +174,22 @@ 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 } + /** * @param WC_Order $order * @@ -185,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; } @@ -234,62 +259,84 @@ 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) { $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; } - $refundIds = $this->findRefundIds($payment); - // Check for new refund + $mollieRefunds = $this->findMollieRefunds($payment); + $mollieRefundIds = array_reduce($mollieRefunds, static function ($ids, $refund) { + $ids[] = $refund->id; + return $ids; + }, []); + $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__ + . " 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, stop processing for {$logId}" + __METHOD__ . " No new refunds." ); - return; } - // There are new refunds. - $refundsToProcess = array_diff($refundIds, $processedRefundIds); - $this->logger->debug( - __METHOD__ - . " Refunds that need to be processed for {$logId}: " - . json_encode($refundsToProcess) - ); - $order = wc_get_order($orderId); - $this->notifyProcessedRefunds($refundsToProcess, $logId, $order, $processedRefundIds); + /** 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); + }); + + $this->notifyRefundedRefundsAndCreateWCRefund($notifyRefundedRefunds, $logId, $order, $notedAndWCProcessedRefunds); + } else { + $this->logger->debug( + __METHOD__ . " No new processed refunds." + ); + } $order->save(); $this->processUpdateStateRefund($order, $payment); @@ -305,7 +352,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 +466,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); @@ -514,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) . ')' @@ -525,26 +575,29 @@ 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 findRefundIds($payment): array + protected function findMollieRefunds($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 +606,9 @@ 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 $payment->_embedded->refunds; } /** @@ -571,7 +622,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; } @@ -579,26 +630,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 findRefundIdsByLinks($payment): array + protected function findRefundsByLinks($payment): array { - $refundIds = []; + $activeRefunds = []; try { - // Get all refunds for this payment - $refunds = $payment->refunds(); - foreach ($refunds as $refund) { - $refundIds[] = $refund->id; + 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 $refundIds; + return $activeRefunds; } /** @@ -614,7 +663,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, @@ -637,7 +686,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 +702,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 +783,7 @@ protected function getPaymentMethodTitle($payment) } return $payment_method_title; } + /** * @param \WC_Order $order * @param string $new_status @@ -747,7 +797,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 +822,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')) { + 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 : []; } else { $processedRefundIds = []; } @@ -794,15 +845,85 @@ protected function getProcessedRefundIds(WC_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) + { + 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 string $logId * @param $order - * @param $processedRefundIds + * @param array $processedRefundIds * @return mixed */ - protected function notifyProcessedRefunds(array $refundsToProcess, string $logId, $order, $processedRefundIds) - { + protected function notifyNewRefunds( + array $refundsToProcess, + string $logId, + $order, + array $processedRefundIds + ) { + foreach ($refundsToProcess as $refundToProcess) { $this->logger->debug( __METHOD__ @@ -823,7 +944,7 @@ protected function notifyProcessedRefunds(array $refundsToProcess, string $logId } $order->update_meta_data( - '_mollie_processed_refund_ids', + self::META_KEY_PROCESSED_ORDERS, $processedRefundIds ); $this->logger->debug( @@ -833,6 +954,52 @@ protected function notifyProcessedRefunds(array $refundsToProcess, string $logId 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'; diff --git a/src/Payment/MolliePayment.php b/src/Payment/MolliePayment.php index 72d473ae2..3d955c79a 100644 --- a/src/Payment/MolliePayment.php +++ b/src/Payment/MolliePayment.php @@ -117,7 +117,8 @@ public function getPaymentRequestData($order, $customerId, $voucherDefaultCatego if ($cardToken) { $paymentRequestData['cardToken'] = $cardToken; } - $applePayToken = filter_input(INPUT_POST, 'token', FILTER_SANITIZE_SPECIAL_CHARS) ?? false; + //phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + $applePayToken = wc_clean(wp_unslash($_POST["token"] ?? '')); if ($applePayToken) { $encodedApplePayToken = json_encode($applePayToken); $paymentRequestData['applePayPaymentToken'] = $encodedApplePayToken; 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/PaymentMethods/AbstractPaymentMethod.php b/src/PaymentMethods/AbstractPaymentMethod.php index 6ed8880e4..1b16d1f3b 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) { @@ -83,6 +83,19 @@ 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,6 +130,15 @@ public function hasPaymentFields(): bool */ public function getIconUrl(): string { + if ($uploadedImageUrl = $this->getUploadedImage()) { + return $this->iconFactory->getExternalIconHtml($uploadedImageUrl); + } + + $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); + } return $this->iconFactory->getIconUrl( $this->getIdFromConfig() ); @@ -265,6 +287,7 @@ public function getMergedProperties(): array { return array_merge($this->config, $this->getSettings()); } + /** * Default values for the initial settings saved * @@ -303,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/PaymentMethods/Banktransfer.php b/src/PaymentMethods/Banktransfer.php index a34ced8b4..ab946c46c 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); } @@ -99,11 +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 (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(); if ($email) { @@ -114,7 +117,6 @@ public function addPaymentArguments(array $args, WC_Order $order) return $args; } - //TODO is this needed?? public function isExpiredDateSettingActivated() { $expiryDays = $this->getProperty( 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 ''; } 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/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/Settings/Settings.php b/src/Settings/Settings.php index 7842511ba..eeb7e43f9 100644 --- a/src/Settings/Settings.php +++ b/src/Settings/Settings.php @@ -104,7 +104,6 @@ public function processAdminOptionCustomLogo(WC_Payment_Gateway $gateway) && is_string($_FILES[$fileOptionName]['name']) && !empty($_FILES[$fileOptionName]['tmp_name']) && is_string($_FILES[$fileOptionName]['tmp_name']) - ) { $name = filter_var(wp_unslash($_FILES[$fileOptionName]['name']), FILTER_SANITIZE_FULL_SPECIAL_CHARS); $tempName = filter_var(wp_unslash($_FILES[$fileOptionName]['tmp_name']), FILTER_SANITIZE_FULL_SPECIAL_CHARS); @@ -651,12 +650,12 @@ protected function validateUploadedFile(string $fileName, string $fileTempName, $notice = new AdminNotice(); if ($extensionNotAllowed || $fileIsNotAnImage) { $message = sprintf( - esc_html__( - '%1$sMollie Payments for WooCommerce%2$s Unable to upload the file. Only jpg, jpeg, png and gif files are allowed.', - 'mollie-payments-for-woocommerce' - ), - '', - '' + esc_html__( + '%1$sMollie Payments for WooCommerce%2$s Unable to upload the file. Only jpg, jpeg, png and gif files are allowed.', + 'mollie-payments-for-woocommerce' + ), + '', + '' ); $notice->addNotice('notice-error is-dismissible', $message); return false; @@ -664,12 +663,12 @@ protected function validateUploadedFile(string $fileName, string $fileTempName, if ($invalidFileSize) { $message = sprintf( - esc_html__( - '%1$sMollie Payments for WooCommerce%2$s Unable to upload the file. Size must be under 500kb.', - 'mollie-payments-for-woocommerce' - ), - '', - '' + esc_html__( + '%1$sMollie Payments for WooCommerce%2$s Unable to upload the file. Size must be under 500kb.', + 'mollie-payments-for-woocommerce' + ), + '', + '' ); $notice->addNotice('notice-error is-dismissible', $message); return false; @@ -685,18 +684,18 @@ protected function processUploadedFile(string $name, string $tempName, WC_Paymen $targetLocation = $mollieUploadDirectory . '/'; $fileName = preg_replace( - '#\s+#', - '_', - $name + '#\s+#', + '_', + $name ); move_uploaded_file($tempName, $targetLocation . $fileName); $gatewaySettings["iconFileUrl"] = trailingslashit( - wp_upload_dir()['baseurl'] - ) . 'mollie-uploads/' . $gateway->id . '/' . $fileName; + wp_upload_dir()['baseurl'] + ) . 'mollie-uploads/' . $gateway->id . '/' . $fileName; $gatewaySettings["iconFilePath"] = trailingslashit( - wp_upload_dir()['basedir'] - ) . 'mollie-uploads/' . $gateway->id . '/' . $fileName; + wp_upload_dir()['basedir'] + ) . 'mollie-uploads/' . $gateway->id . '/' . $fileName; update_option(sprintf('%s_settings', $gateway->id), $gatewaySettings); } } 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/GatewaySurchargeHandler.php b/src/Shared/GatewaySurchargeHandler.php index a22abf16b..8cc943e88 100644 --- a/src/Shared/GatewaySurchargeHandler.php +++ b/src/Shared/GatewaySurchargeHandler.php @@ -136,7 +136,7 @@ public function updateSurchargeCheckoutBlock() $this->cartRemoveFee(); WC()->cart->calculate_totals(); $newTotal = (float) WC()->cart->get_totals()['total']; - $totalTax = WC()->cart->get_totals()['total_tax']; + $totalTax = WC()->cart->get_totals()['total_tax']; $noSurchargeData = [ 'amount' => false, @@ -171,7 +171,7 @@ public function updateSurchargeCheckoutBlock() $feeAmount = $this->surcharge->calculateFeeAmount(WC()->cart, $gatewaySettings); $label = $this->gatewayFeeLabel; - add_action('woocommerce_cart_calculate_fees', function () use ($label, $feeAmount) { + add_action('woocommerce_cart_calculate_fees', static function () use ($label, $feeAmount) { global $woocommerce; $woocommerce->cart->add_fee($label, $feeAmount, true, 'standard'); }); @@ -182,7 +182,7 @@ public function updateSurchargeCheckoutBlock() $feeAmountTaxed = $feeAmountTaxed + (float) WC()->cart->get_totals()['fee_tax']; } $newTotal = (float) WC()->cart->get_totals()['total']; - $totalTax = WC()->cart->get_totals()['total_tax']; + $totalTax = WC()->cart->get_totals()['total_tax']; $data = [ 'amount' => $feeAmountTaxed, 'name' => $this->gatewayFeeLabel, @@ -285,7 +285,7 @@ protected function orderRemoveFee($order) protected function cartRemoveFee() { $label = $this->gatewayFeeLabel; - add_action('woocommerce_before_calculate_totals', function () use ($label) { + add_action('woocommerce_before_calculate_totals', static function () use ($label) { $fees = WC()->cart->get_fees(); foreach ($fees as $key => $fee) { if ($fees[$key]->name === $label) { @@ -295,6 +295,7 @@ protected function cartRemoveFee() WC()->cart->fees_api()->set_fees($fees); }); } + protected function orderAddFee($order, $amount, $surchargeName) { $item_fee = new WC_Order_Item_Fee(); 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'; } 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 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;