diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53edcabf3..5d87b0920 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: with: php-version: ${{ matrix.php-versions }} coverage: none - tools: composer:v1 + tools: composer:v2 - name: Validate composer.json and composer.lock run: composer validate @@ -28,14 +28,14 @@ jobs: run: composer update --prefer-dist --no-progress - name: dump autoload - run: composer dump-autoload + run: composer dump-autoload --dev --optimize --strict-psr - name: check syntax run: find src -name '*.php' | xargs -n 1 -P4 php -l - name: Run PHPUnit run: ./vendor/bin/phpunit - + - name: Run Psalm run: ./vendor/bin/psalm --show-info=false --threads=2 diff --git a/.idea/WooCommerce.iml b/.idea/WooCommerce.iml index 6828e16ed..692525fb1 100644 --- a/.idea/WooCommerce.iml +++ b/.idea/WooCommerce.iml @@ -72,6 +72,7 @@ + diff --git a/.idea/php.xml b/.idea/php.xml index f41096f56..813e16952 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -132,6 +132,10 @@ + + + + @@ -241,7 +245,7 @@ - + diff --git a/composer.json b/composer.json index 4100eb24d..89100fc0f 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,8 @@ "inpsyde/modularity": "^1.7.4", "psr/container": "1.1.0", "psr/log":"^1.1.4", - "sniccowp/php-scoper-wordpress-excludes": "^6.6" + "sniccowp/php-scoper-wordpress-excludes": "^6.6", + "dhii/services": "^0.1.0" }, "require-dev": { "phpunit/phpunit": "^8", @@ -40,7 +41,8 @@ "autoload": { "psr-4": { "Mollie\\WooCommerce\\": "src/", - "Inpsyde\\EnvironmentChecker\\": "pluginEnvironmentChecker" + "Inpsyde\\EnvironmentChecker\\": "pluginEnvironmentChecker", + "Inpsyde\\PaymentGateway\\": "lib/payment-gateway/src/" } }, "autoload-dev": { diff --git a/composer.lock b/composer.lock index 2243f5e96..ecefdabfb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "afd1fef3a31e6c8742cf9df94a0ca170", + "content-hash": "4e52aea3a7eaecc473990bcc5f42517a", "packages": [ { "name": "composer/ca-bundle", - "version": "1.5.2", + "version": "1.5.4", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "48a792895a2b7a6ee65dd5442c299d7b835b6137" + "reference": "bc0593537a463e55cadf45fd938d23b75095b7e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/48a792895a2b7a6ee65dd5442c299d7b835b6137", - "reference": "48a792895a2b7a6ee65dd5442c299d7b835b6137", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/bc0593537a463e55cadf45fd938d23b75095b7e1", + "reference": "bc0593537a463e55cadf45fd938d23b75095b7e1", "shasum": "" }, "require": { @@ -64,7 +64,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.2" + "source": "https://github.com/composer/ca-bundle/tree/1.5.4" }, "funding": [ { @@ -80,20 +80,67 @@ "type": "tidelift" } ], - "time": "2024-09-25T07:49:53+00:00" + "time": "2024-11-27T15:35:25+00:00" + }, + { + "name": "dhii/services", + "version": "v0.1.0", + "source": { + "type": "git", + "url": "https://github.com/Dhii/services.git", + "reference": "09cad8199a59d2003ad19126213075aefecaf17b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dhii/services/zipball/09cad8199a59d2003ad19126213075aefecaf17b", + "reference": "09cad8199a59d2003ad19126213075aefecaf17b", + "shasum": "" + }, + "require": { + "php": "^7.1 | ^8.0", + "psr/container": "^1.0" + }, + "require-dev": { + "codeclimate/php-test-reporter": "<=0.3.2", + "phpunit/phpunit": "^7.0 | ^8.0 | ^9.0", + "slevomat/coding-standard": "^6.0", + "vimeo/psalm": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Dhii\\Services\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dhii Team", + "email": "development@dhii.co" + } + ], + "description": "A collection of useful DI service implementations.", + "support": { + "issues": "https://github.com/Dhii/services/issues", + "source": "https://github.com/Dhii/services/tree/v0.1.0" + }, + "time": "2022-01-06T14:57:20+00:00" }, { "name": "inpsyde/modularity", - "version": "1.10.0", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/inpsyde/modularity.git", - "reference": "2119d0e32706741a3c6dc0a85d908ec19ebf142e" + "reference": "c79bb3682f55e1a2ece67f36e70d04fa2ab8c65d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/inpsyde/modularity/zipball/2119d0e32706741a3c6dc0a85d908ec19ebf142e", - "reference": "2119d0e32706741a3c6dc0a85d908ec19ebf142e", + "url": "https://api.github.com/repos/inpsyde/modularity/zipball/c79bb3682f55e1a2ece67f36e70d04fa2ab8c65d", + "reference": "c79bb3682f55e1a2ece67f36e70d04fa2ab8c65d", "shasum": "" }, "require": { @@ -127,31 +174,31 @@ ], "authors": [ { - "name": "Inpsyde GmbH", - "email": "hello@inpsyde.com", - "homepage": "https://inpsyde.com/", + "name": "Syde GmbH", + "email": "hello@syde.com", + "homepage": "https://syde.com/", "role": "Company" } ], "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.10.0" + "source": "https://github.com/inpsyde/modularity/tree/1.11.0" }, - "time": "2024-09-03T10:42:50+00:00" + "time": "2024-11-28T09:34:00+00:00" }, { "name": "mollie/mollie-api-php", - "version": "v2.73.0", + "version": "v2.76.0", "source": { "type": "git", "url": "https://github.com/mollie/mollie-api-php.git", - "reference": "0a26175492d4c55bb461e44fe3e63546539b81c1" + "reference": "b6e9848e4893d1d306fba54da3ac6f4a31a40368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/0a26175492d4c55bb461e44fe3e63546539b81c1", - "reference": "0a26175492d4c55bb461e44fe3e63546539b81c1", + "url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/b6e9848e4893d1d306fba54da3ac6f4a31a40368", + "reference": "b6e9848e4893d1d306fba54da3ac6f4a31a40368", "shasum": "" }, "require": { @@ -228,9 +275,9 @@ ], "support": { "issues": "https://github.com/mollie/mollie-api-php/issues", - "source": "https://github.com/mollie/mollie-api-php/tree/v2.73.0" + "source": "https://github.com/mollie/mollie-api-php/tree/v2.76.0" }, - "time": "2024-09-30T13:16:57+00:00" + "time": "2024-12-18T12:26:03+00:00" }, { "name": "psr/container", @@ -337,22 +384,22 @@ }, { "name": "sniccowp/php-scoper-wordpress-excludes", - "version": "6.6.2", + "version": "6.7.1", "source": { "type": "git", "url": "https://github.com/snicco/php-scoper-wordpress-excludes.git", - "reference": "b87d7455bdf05c25f9a688fc3862bb3f2b7c8b15" + "reference": "d8e6b5fdc9e42300a8ab18b44b775836a7b52363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/snicco/php-scoper-wordpress-excludes/zipball/b87d7455bdf05c25f9a688fc3862bb3f2b7c8b15", - "reference": "b87d7455bdf05c25f9a688fc3862bb3f2b7c8b15", + "url": "https://api.github.com/repos/snicco/php-scoper-wordpress-excludes/zipball/d8e6b5fdc9e42300a8ab18b44b775836a7b52363", + "reference": "d8e6b5fdc9e42300a8ab18b44b775836a7b52363", "shasum": "" }, "require-dev": { "php": "^7.4", "php-stubs/wordpress-globals": "0.2.0", - "php-stubs/wordpress-stubs": "6.6.2", + "php-stubs/wordpress-stubs": "6.7.1", "sniccowp/php-scoper-excludes": "dev-master" }, "type": "library", @@ -378,9 +425,9 @@ ], "support": { "issues": "https://github.com/snicco/php-scoper-wordpress-excludes/issues", - "source": "https://github.com/snicco/php-scoper-wordpress-excludes/tree/6.6.2" + "source": "https://github.com/snicco/php-scoper-wordpress-excludes/tree/6.7.1" }, - "time": "2024-10-01T00:32:14+00:00" + "time": "2024-11-25T00:31:50+00:00" } ], "packages-dev": [ @@ -546,16 +593,16 @@ }, { "name": "antecedent/patchwork", - "version": "2.2.0", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/antecedent/patchwork.git", - "reference": "b07d4fb37c3c723c8755122160c089e077d5de65" + "reference": "1bf183a3e1bd094f231a2128b9ecc5363c269245" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antecedent/patchwork/zipball/b07d4fb37c3c723c8755122160c089e077d5de65", - "reference": "b07d4fb37c3c723c8755122160c089e077d5de65", + "url": "https://api.github.com/repos/antecedent/patchwork/zipball/1bf183a3e1bd094f231a2128b9ecc5363c269245", + "reference": "1bf183a3e1bd094f231a2128b9ecc5363c269245", "shasum": "" }, "require": { @@ -588,9 +635,9 @@ ], "support": { "issues": "https://github.com/antecedent/patchwork/issues", - "source": "https://github.com/antecedent/patchwork/tree/2.2.0" + "source": "https://github.com/antecedent/patchwork/tree/2.2.1" }, - "time": "2024-09-27T16:59:55+00:00" + "time": "2024-12-11T10:19:54+00:00" }, { "name": "automattic/phpcs-neutron-standard", @@ -693,16 +740,16 @@ }, { "name": "brain/monkey", - "version": "2.6.1", + "version": "2.6.2", "source": { "type": "git", "url": "https://github.com/Brain-WP/BrainMonkey.git", - "reference": "a31c84515bb0d49be9310f52ef1733980ea8ffbb" + "reference": "d95a9d895352c30f47604ad1b825ab8fa9d1a373" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/a31c84515bb0d49be9310f52ef1733980ea8ffbb", - "reference": "a31c84515bb0d49be9310f52ef1733980ea8ffbb", + "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/d95a9d895352c30f47604ad1b825ab8fa9d1a373", + "reference": "d95a9d895352c30f47604ad1b825ab8fa9d1a373", "shasum": "" }, "require": { @@ -718,8 +765,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-version/1": "1.x-dev", - "dev-master": "2.0.x-dev" + "dev-master": "2.x-dev", + "dev-version/1": "1.x-dev" } }, "autoload": { @@ -759,7 +806,7 @@ "issues": "https://github.com/Brain-WP/BrainMonkey/issues", "source": "https://github.com/Brain-WP/BrainMonkey" }, - "time": "2021-11-11T15:53:55+00:00" + "time": "2024-08-29T20:15:04+00:00" }, { "name": "composer/package-versions-deprecated", @@ -836,16 +883,16 @@ }, { "name": "composer/pcre", - "version": "3.3.1", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4" + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/63aaeac21d7e775ff9bc9d45021e1745c97521c4", - "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", "shasum": "" }, "require": { @@ -855,19 +902,19 @@ "phpstan/phpstan": "<1.11.10" }, "require-dev": { - "phpstan/phpstan": "^1.11.10", - "phpstan/phpstan-strict-rules": "^1.1", + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", "phpunit/phpunit": "^8 || ^9" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - }, "phpstan": { "includes": [ "extension.neon" ] + }, + "branch-alias": { + "dev-main": "3.x-dev" } }, "autoload": { @@ -895,7 +942,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.3.1" + "source": "https://github.com/composer/pcre/tree/3.3.2" }, "funding": [ { @@ -911,7 +958,7 @@ "type": "tidelift" } ], - "time": "2024-08-27T18:44:43+00:00" + "time": "2024-11-12T16:29:46+00:00" }, { "name": "composer/semver", @@ -1174,29 +1221,27 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -1204,7 +1249,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1215,9 +1260,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, - "time": "2024-01-30T19:34:25+00:00" + "time": "2024-12-07T21:18:45+00:00" }, { "name": "doctrine/instantiator", @@ -1527,10 +1572,10 @@ "extra": { "class": "Inpsyde\\AssetsCompiler\\Composer\\Plugin", "branch-alias": { - "dev-master": "2.x-dev", "dev-v1.x": "1.x-dev", "dev-v2.x": "2.x-dev", - "dev-v3.x": "3.x-dev" + "dev-v3.x": "3.x-dev", + "dev-master": "2.x-dev" } }, "autoload": { @@ -1761,16 +1806,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -1809,7 +1854,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -1817,7 +1862,7 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "netresearch/jsonmapper", @@ -2305,16 +2350,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.4.1", + "version": "5.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", "shasum": "" }, "require": { @@ -2323,17 +2368,17 @@ "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.2", "phpdocumentor/type-resolver": "^1.7", - "phpstan/phpdoc-parser": "^1.7", + "phpstan/phpdoc-parser": "^1.7|^2.0", "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.5", + "mockery/mockery": "~1.3.5 || ~1.6.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.8", "phpstan/phpstan-mockery": "^1.1", "phpstan/phpstan-webmozart-assert": "^1.2", "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^5.13" + "psalm/phar": "^5.26" }, "type": "library", "extra": { @@ -2363,29 +2408,29 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1" }, - "time": "2024-05-21T05:55:05+00:00" + "time": "2024-12-07T09:39:29+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.8.2", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "153ae662783729388a584b4361f2545e4d841e3c" + "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", - "reference": "153ae662783729388a584b4361f2545e4d841e3c", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/679e3ce485b99e84c775d28e2e96fade9a7fb50a", + "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a", "shasum": "" }, "require": { "doctrine/deprecations": "^1.0", "php": "^7.3 || ^8.0", "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.13" + "phpstan/phpdoc-parser": "^1.18|^2.0" }, "require-dev": { "ext-tokenizer": "*", @@ -2421,36 +2466,36 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.10.0" }, - "time": "2024-02-23T11:10:43+00:00" + "time": "2024-11-09T15:12:26+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "1.33.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/c00d78fb6b29658347f9d37ebe104bffadf36299", + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^5.3.0", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", "symfony/process": "^5.2" }, "type": "library", @@ -2468,9 +2513,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.0" }, - "time": "2024-10-13T11:25:22+00:00" + "time": "2024-10-13T11:29:49+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2771,16 +2816,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.40", + "version": "8.5.41", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "48ed828b72c35b38cdddcd9059339734cb06b3a7" + "reference": "d843cb5bcf0bf9ae3484016444fe0c5b6ec7e4fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/48ed828b72c35b38cdddcd9059339734cb06b3a7", - "reference": "48ed828b72c35b38cdddcd9059339734cb06b3a7", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d843cb5bcf0bf9ae3484016444fe0c5b6ec7e4fa", + "reference": "d843cb5bcf0bf9ae3484016444fe0c5b6ec7e4fa", "shasum": "" }, "require": { @@ -2791,7 +2836,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.0", + "myclabs/deep-copy": "^1.12.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.2", @@ -2849,7 +2894,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.40" + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.41" }, "funding": [ { @@ -2865,7 +2910,7 @@ "type": "tidelift" } ], - "time": "2024-09-19T10:47:04+00:00" + "time": "2024-12-05T13:44:26+00:00" }, { "name": "ptrofimov/xpmock", @@ -3634,16 +3679,16 @@ }, { "name": "sirbrillig/phpcs-variable-analysis", - "version": "v2.11.19", + "version": "v2.11.22", "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1" + "reference": "ffb6f16c6033ec61ed84446b479a31d6529f0eb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", - "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/ffb6f16c6033ec61ed84446b479a31d6529f0eb7", + "reference": "ffb6f16c6033ec61ed84446b479a31d6529f0eb7", "shasum": "" }, "require": { @@ -3654,9 +3699,8 @@ "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", "phpcsstandards/phpcsdevcs": "^1.1", "phpstan/phpstan": "^1.7", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0", - "sirbrillig/phpcs-import-detection": "^1.1", - "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta" + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0 || ^10.5.32 || ^11.3.3", + "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0" }, "type": "phpcodesniffer-standard", "autoload": { @@ -3688,7 +3732,7 @@ "source": "https://github.com/sirbrillig/phpcs-variable-analysis", "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2024-06-26T20:08:34+00:00" + "time": "2025-01-06T17:54:24+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -3762,16 +3806,16 @@ }, { "name": "symfony/console", - "version": "v5.4.44", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "5b5a0aa66e3296e303e22490f90f521551835a83" + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5b5a0aa66e3296e303e22490f90f521551835a83", - "reference": "5b5a0aa66e3296e303e22490f90f521551835a83", + "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", "shasum": "" }, "require": { @@ -3841,7 +3885,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.44" + "source": "https://github.com/symfony/console/tree/v5.4.47" }, "funding": [ { @@ -3857,20 +3901,20 @@ "type": "tidelift" } ], - "time": "2024-09-20T07:56:40+00:00" + "time": "2024-11-06T11:30:55+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d" + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918", + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918", "shasum": "" }, "require": { @@ -3878,12 +3922,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -3908,7 +3952,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4" }, "funding": [ { @@ -3924,7 +3968,7 @@ "type": "tidelift" } ], - "time": "2023-01-24T14:02:46+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3952,8 +3996,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4028,8 +4072,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4106,8 +4150,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4190,8 +4234,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4264,8 +4308,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4340,8 +4384,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4402,16 +4446,16 @@ }, { "name": "symfony/service-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3" + "reference": "f37b419f7aea2e9abf10abd261832cace12e3300" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a2329596ddc8fd568900e3fc76cba42489ecc7f3", - "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f37b419f7aea2e9abf10abd261832cace12e3300", + "reference": "f37b419f7aea2e9abf10abd261832cace12e3300", "shasum": "" }, "require": { @@ -4427,12 +4471,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -4465,7 +4509,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.4" }, "funding": [ { @@ -4481,20 +4525,20 @@ "type": "tidelift" } ], - "time": "2023-04-21T15:04:16+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/string", - "version": "v5.4.44", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "832caa16b6d9aac6bf11747315225f5aba384c24" + "reference": "136ca7d72f72b599f2631aca474a4f8e26719799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/832caa16b6d9aac6bf11747315225f5aba384c24", - "reference": "832caa16b6d9aac6bf11747315225f5aba384c24", + "url": "https://api.github.com/repos/symfony/string/zipball/136ca7d72f72b599f2631aca474a4f8e26719799", + "reference": "136ca7d72f72b599f2631aca474a4f8e26719799", "shasum": "" }, "require": { @@ -4551,7 +4595,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.44" + "source": "https://github.com/symfony/string/tree/v5.4.47" }, "funding": [ { @@ -4567,7 +4611,7 @@ "type": "tidelift" } ], - "time": "2024-09-20T07:56:40+00:00" + "time": "2024-11-10T20:33:58+00:00" }, { "name": "theseer/tokenizer", @@ -4691,10 +4735,10 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev", - "dev-3.x": "3.x-dev", + "dev-1.x": "1.x-dev", "dev-2.x": "2.x-dev", - "dev-1.x": "1.x-dev" + "dev-3.x": "3.x-dev", + "dev-master": "4.x-dev" } }, "autoload": { @@ -4901,6 +4945,6 @@ "ext-intl": "*", "ext-json": "*" }, - "platform-dev": [], + "platform-dev": {}, "plugin-api-version": "2.6.0" } diff --git a/inc/modules.php b/inc/modules.php new file mode 100644 index 000000000..0924257c0 --- /dev/null +++ b/inc/modules.php @@ -0,0 +1,41 @@ + + */ + static function (): iterable { + return [ + new ActivationModule(), + new NoticeModule(), + new SharedModule(), + new PaymentGatewayModule(), + new SDKModule(), + new SettingsModule(), + new LogModule('mollie-payments-for-woocommerce-'), + new AssetsModule(), + new GatewayModule(), + new VoucherModule(), + new PaymentModule(), + new SubscriptionModule(), + new MerchantCaptureModule(), + new UninstallModule(), + ]; + }; diff --git a/inc/settings/mollie_applepay_settings.php b/inc/settings/mollie_applepay_settings.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/inc/utils.php b/inc/utils.php index 2acee663a..b5a544b3e 100644 --- a/inc/utils.php +++ b/inc/utils.php @@ -165,7 +165,10 @@ function mollieWooCommerceIsVoucherEnabled() */ function mollieWooCommerceIsMollieGateway($gateway) { - if (strpos($gateway, 'mollie_wc_gateway_') !== false) { + if ( + (is_string($gateway) && strpos($gateway, 'mollie_wc_gateway_') !== false) + || (is_object($gateway) && strpos($gateway->id, 'mollie_wc_gateway_') !== false) + ) { return true; } return false; diff --git a/lib/payment-gateway/.distignore b/lib/payment-gateway/.distignore new file mode 100644 index 000000000..185a70f64 --- /dev/null +++ b/lib/payment-gateway/.distignore @@ -0,0 +1,8 @@ +.distignore +.ddev +.git* +tests/ +vendor/**/test* +*.lock +package-lock.json +*.xml.* diff --git a/lib/payment-gateway/CHANGELOG.md b/lib/payment-gateway/CHANGELOG.md new file mode 100644 index 000000000..f32ab37a9 --- /dev/null +++ b/lib/payment-gateway/CHANGELOG.md @@ -0,0 +1,97 @@ +# [1.6.0](https://github.com/inpsyde/payment-gateway/compare/1.5.2...1.6.0) (2024-11-19) + + +### Features + +* Filterable checkout components ([#34](https://github.com/inpsyde/payment-gateway/issues/34)) ([76f8c16](https://github.com/inpsyde/payment-gateway/commit/76f8c1626f3360b9763c6210393a6f7a40a0ccd7)), closes [#35](https://github.com/inpsyde/payment-gateway/issues/35) + +## [1.5.2](https://github.com/inpsyde/payment-gateway/compare/1.5.1...1.5.2) (2024-11-13) + + +### Bug Fixes + +* allow node 22 ([1a28fdd](https://github.com/inpsyde/payment-gateway/commit/1a28fdd38be46459d1c63cd99192d9f2bc22e25d)) +* allow node 22 ([93a85e6](https://github.com/inpsyde/payment-gateway/commit/93a85e69eb329620dc636180298253ac18742a66)) + +## [1.5.1](https://github.com/inpsyde/payment-gateway/compare/1.5.0...1.5.1) (2024-09-23) + + +### Bug Fixes + +* Fix PaymentGatewayBlocks::$gateway type. ([#31](https://github.com/inpsyde/payment-gateway/issues/31)) ([58cd64c](https://github.com/inpsyde/payment-gateway/commit/58cd64cb64bc11fcd1a89d9aa0690d90738162a4)) + +# [1.5.0](https://github.com/inpsyde/payment-gateway/compare/1.4.1...1.5.0) (2024-09-20) + + +### Bug Fixes + +* code style, remove PaymentGatewayBlocks::$name type ([32ed490](https://github.com/inpsyde/payment-gateway/commit/32ed490e73414383c6f6eb34529a483468afb56c)) + + +### Features + +* Allow to interrupt refund with a message ([e5c6e10](https://github.com/inpsyde/payment-gateway/commit/e5c6e10d06b228483b8725cfbd41686fb0c5b776)) + +## [1.4.1](https://github.com/inpsyde/payment-gateway/compare/1.4.0...1.4.1) (2024-09-18) + + +### Bug Fixes + +* use variable in process_refund() ([afabd5c](https://github.com/inpsyde/payment-gateway/commit/afabd5cc6e08a830238af5067500df3fb462644f)) + +# [1.4.0](https://github.com/inpsyde/payment-gateway/compare/1.3.2...1.4.0) (2024-09-13) + + +### Features + +* [PROD-169] Implement l10n for errors & order notes ([#26](https://github.com/inpsyde/payment-gateway/issues/26)) ([7806c79](https://github.com/inpsyde/payment-gateway/commit/7806c798bc1a6e450f91d703fc94f7c07e8aea96)), closes [#1](https://github.com/inpsyde/payment-gateway/issues/1) [#2](https://github.com/inpsyde/payment-gateway/issues/2) + +## [1.3.2](https://github.com/inpsyde/payment-gateway/compare/1.3.1...1.3.2) (2024-07-12) + + +### Bug Fixes + +* Keep frontend source and composer.json in releases ([ee1f8a3](https://github.com/inpsyde/payment-gateway/commit/ee1f8a3642d9240927b8df39b70e8022b000ad4f)) + +## [1.3.1](https://github.com/inpsyde/payment-gateway/compare/1.3.0...1.3.1) (2024-07-01) + + +### Bug Fixes + +* Do not use PHP_INT_MIN for hooks ([8e5e15d](https://github.com/inpsyde/payment-gateway/commit/8e5e15d4f09364333b5937a2d09b44210fe0c2f4)) +* Move comment outside of expression ([c80b6cd](https://github.com/inpsyde/payment-gateway/commit/c80b6cde33661b53fe0ac73824f5eaae3fda9db7)) + +# [1.3.0](https://github.com/inpsyde/payment-gateway/compare/1.2.0...1.3.0) (2024-06-05) + + +### Features + +* Add locators for method title & description ([#24](https://github.com/inpsyde/payment-gateway/issues/24)) ([27a73a9](https://github.com/inpsyde/payment-gateway/commit/27a73a90965af918da92185526315a97ab8b8c48)) + +# [1.2.0](https://github.com/inpsyde/payment-gateway/compare/1.1.1...1.2.0) (2024-06-05) + + +### Features + +* Check required services during init ([79ae2b9](https://github.com/inpsyde/payment-gateway/commit/79ae2b9bb178376419c91b418bdfa2b593b99346)), closes [#15](https://github.com/inpsyde/payment-gateway/issues/15) + +## [1.1.1](https://github.com/inpsyde/payment-gateway/compare/1.1.0...1.1.1) (2024-06-04) + + +### Bug Fixes + +* don't register gateway for blocks if disabled ([e577b52](https://github.com/inpsyde/payment-gateway/commit/e577b522ef0452104a2e54c499f39e9953876a38)) + +# [1.1.0](https://github.com/inpsyde/payment-gateway/compare/1.0.1...1.1.0) (2024-06-04) + + +### Features + +* Add a new service to allow skipping blocks registration ([#21](https://github.com/inpsyde/payment-gateway/issues/21)) ([e1978d1](https://github.com/inpsyde/payment-gateway/commit/e1978d19654a2c685265a9d32fa12ff49c7b6249)) + +# 1.0.0 (2024-05-21) + + +### Bug Fixes + +* specify playwright dependency ([1060e5c](https://github.com/inpsyde/payment-gateway/commit/1060e5cafece37c465e6e78077d2c7378f723b46)) diff --git a/lib/payment-gateway/composer.json b/lib/payment-gateway/composer.json new file mode 100644 index 000000000..b13040dd9 --- /dev/null +++ b/lib/payment-gateway/composer.json @@ -0,0 +1,112 @@ +{ + "name": "inpsyde/payment-gateway", + "type": "inpsyde-module", + "description": "", + "license": "GPL-2.0", + "authors": [ + { + "name": "Inpsyde GmbH", + "homepage": "https://inpsyde.com/", + "email": "hello@inpsyde.com", + "role": "Company" + } + ], + "repositories": [ + { + "type": "composer", + "url": "https://repo.packagist.com/inpsyde/" + } + ], + "require": { + "php": "^7.4 | ^8.0", + "inpsyde/modularity": "^1.5" + }, + "require-dev": { + "brain/monkey": "^2.0", + "brainmaestro/composer-git-hooks": "^2.8", + "inpsyde/composer-assets-compiler": "^2.5", + "inpsyde/ddev-tools": "dev-main", + "inpsyde/php-coding-standards": "^2.0", + "inpsyde/wp-translation-downloader": "^2.4", + "mockery/mockery": "^1.3", + "phpunit/phpunit": "^8.0 | ^9.0", + "php-stubs/wordpress-stubs": "^5.0@stable", + "php-stubs/woocommerce-stubs": "^5.0@stable", + "vimeo/psalm": "^4.3" + }, + "autoload": { + "psr-4": { + "Inpsyde\\PaymentGateway\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Inpsyde\\PaymentGateway\\Test\\": "tests/PHPUnit/Helper" + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "scripts": { + "phpcs": "@php ./vendor/bin/phpcs -n -s --parallel=24", + "phpcs:phpcbf": "@php ./vendor/bin/phpcbf --parallel=24;exit 0", + "phpcs:interactive": "@php ./vendor/bin/phpcs -a", + "phpcs:dev": [ + "@cs:phpcbf", + "@cs:interactive" + ], + "phpunit": "vendor/bin/phpunit", + "test": [ + "@phpunit" + ], + "cghooks": "vendor/bin/cghooks", + "post-install-cmd": [ + "@cghooks add --ignore-lock" + ], + "post-update-cmd": [ + "@cghooks update" + ] + }, + "config": { + "sort-packages": true, + "optimize-autoloader": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true, + "inpsyde/composer-assets-compiler": true, + "composer/installers": true, + "inpsyde/wp-translation-downloader": true + } + }, + "extra": { + "hooks": { + "pre-commit": [ + "vendor/bin/phpcbf -q --parallel=24; exit 0" + ] + }, + "wp-translation-downloader": { + "auto-run": false, + "languageRootDir": "./", + "languages": [ + "de_DE", + "en_US" + ], + "api": { + "names": { + "inpsyde/*": "https://translate.inpsyde.com/products/api/translations/%projectName%" + } + }, + "directories": { + "names": { + "inpsyde/*": "languages/" + } + } + }, + "composer-asset-compiler": { + "auto-run": false, + "dependencies": "install", + "script": "build", + "default-env": { + "WEBPACK_ENV": "production" + } + } + } +} diff --git a/lib/payment-gateway/index.php b/lib/payment-gateway/index.php new file mode 100644 index 000000000..4d2383de6 --- /dev/null +++ b/lib/payment-gateway/index.php @@ -0,0 +1,31 @@ + 'GET', + 'callback' => function () { + return ['hello' => __('world', 'ddev-wordpress-plugin-example')]; + }, + 'permission_callback' => '__return_true', + ]); +}); + + diff --git a/lib/payment-gateway/languages/ddev-wordpress-plugin-example.pot b/lib/payment-gateway/languages/ddev-wordpress-plugin-example.pot new file mode 100644 index 000000000..2ac5537ac --- /dev/null +++ b/lib/payment-gateway/languages/ddev-wordpress-plugin-example.pot @@ -0,0 +1,36 @@ +# Copyright (C) 2023 Inpsyde +# This file is distributed under the GPL-2.0. +msgid "" +msgstr "" +"Project-Id-Version: ddev-wordpress-plugin-example {VERSION}\n" +"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ddev-wordpress-plugin-example\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" +"POT-Creation-Date: 2023-02-01T14:03:42+00:00\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"X-Generator: WP-CLI 2.7.1\n" +"X-Domain: ddev-wordpress-plugin-example\n" + +#. Plugin Name of the plugin +msgid "ddev-wordpress-plugin-example" +msgstr "" + +#. Plugin URI of the plugin +#. Author URI of the plugin +msgid "https://inpsyde.com" +msgstr "" + +#. Description of the plugin +msgid "{DESCRIPTION}" +msgstr "" + +#. Author of the plugin +msgid "Inpsyde" +msgstr "" + +#: ddev-wordpress-plugin-example.php:25 +msgid "world" +msgstr "" diff --git a/lib/payment-gateway/package.json b/lib/payment-gateway/package.json new file mode 100644 index 000000000..ba7a33030 --- /dev/null +++ b/lib/payment-gateway/package.json @@ -0,0 +1,34 @@ +{ + "name": "@inpsyde/generic-payment-gateway", + "version": "0.1.0", + "engines": { + "node": "^16 || ^18 || ^20 || ^22" + }, + "devDependencies": { + "@semantic-release/changelog": "^6.0.3", + "@semantic-release/commit-analyzer": "^12.0.0", + "@semantic-release/exec": "^6.0.3", + "@semantic-release/git": "^10.0.1", + "@semantic-release/github": "^10.0.3", + "@semantic-release/npm": "^12.0.0", + "@semantic-release/release-notes-generator": "^13.0.0", + "@woocommerce/dependency-extraction-webpack-plugin": "3.0.0", + "@woocommerce/settings": "^1.0.0", + "@wordpress/hooks": "^4.11.0", + "@wordpress/html-entities": "^3.39.0", + "@wordpress/i18n": "^4.39.0", + "@wordpress/scripts": "^26.10.0", + "semantic-release": "^23.0.8", + "ts-loader": "^9.0.0", + "typescript": "^5.1.6" + }, + "scripts": { + "build": "wp-scripts build", + "build:dev": "wp-scripts build --mode development", + "dev": "wp-scripts build --mode development --watch", + "start": "wp-scripts start", + "lint:md": "wp-scripts lint-md-docs docs/**/*.md", + "lint:js": "wp-scripts lint-js resources/js/**/*", + "lint:style": "wp-scripts lint-style resources/scss/**/*.scss" + } +} diff --git a/lib/payment-gateway/psalm.xml.dist b/lib/payment-gateway/psalm.xml.dist new file mode 100644 index 000000000..8cf3d7066 --- /dev/null +++ b/lib/payment-gateway/psalm.xml.dist @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/payment-gateway/release.config.js b/lib/payment-gateway/release.config.js new file mode 100644 index 000000000..0ca2a55e9 --- /dev/null +++ b/lib/payment-gateway/release.config.js @@ -0,0 +1,15 @@ +module.exports = { + "branches": ["main"], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + "@semantic-release/github", + ["@semantic-release/git", { + "assets": ["CHANGELOG.md"], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + }] + ], + "preset": "angular", + "tagFormat": "${version}" +} \ No newline at end of file diff --git a/lib/payment-gateway/resources/js/backend.js b/lib/payment-gateway/resources/js/backend.js new file mode 100644 index 000000000..f5f3a3c64 --- /dev/null +++ b/lib/payment-gateway/resources/js/backend.js @@ -0,0 +1 @@ +alert('hi!'); diff --git a/lib/payment-gateway/resources/js/blocks/index.js b/lib/payment-gateway/resources/js/blocks/index.js new file mode 100644 index 000000000..17c66c7ed --- /dev/null +++ b/lib/payment-gateway/resources/js/blocks/index.js @@ -0,0 +1,67 @@ +import {__} from '@wordpress/i18n'; +import {registerPaymentMethod} from '@woocommerce/blocks-registry'; +import {decodeEntities} from '@wordpress/html-entities'; +import {getSetting} from '@woocommerce/settings'; +import {defaultHooks} from '@wordpress/hooks'; + + +inpsydeGateways.forEach((name) => { + const settings = getSetting(`${name}_data`, {}); + const hookName = `${name}_checkout_fields`; + const defaultLabel = __( + 'Syde Payment Gateway', + 'syde-payment-gateway' + ); + + const label = decodeEntities(settings.title) || defaultLabel; + + const Content = () => { + const components = defaultHooks.applyFilters(hookName, []) + console.log(hookName) + + /** + * If no external plugins/slot-fills are configured, + * we default to displaying the method description + */ + if (!Array.isArray(components) || !components.length) { + const DefaultPlugin = () => decodeEntities(settings.description || ''); + return + } + + return ( + <>{components.map((Component) => )} + ); + }; + /** + * Label component + * + * @param {*} props Props from payment API. + */ + const Label = (props) => { + const {PaymentMethodLabel} = props.components; + return ; + }; + + /** + * Payment method config object. + */ + const PaymentMethod = { + name: name, + label: