diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 089100cec..20ddc0bed 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -13,19 +13,20 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP 7.4 + - name: Setup PHP 8.1 uses: shivammathur/setup-php@v2 with: - php-version: "7.4" + php-version: "8.1" + tools: composer:v2 - name: Cache vendor folder - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: vendor key: php-${{ hashFiles('composer.lock') }} - name: Cache composer folder - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.composer/cache key: php-composer-cache @@ -36,18 +37,18 @@ jobs: run: php vendor/bin/header-stamp --license=vendor/prestashop/header-stamp/assets/afl.txt --exclude=.github,vendor,tests --dry-run php-linter: - name: PHP Syntax check 7.2|7.3|7.4 + name: PHP Syntax check 8.1|8.2|8.3 runs-on: ubuntu-latest if: contains(github.event.pull_request.labels.*.name, 'ready to review') steps: - name: Checkout uses: actions/checkout@v2.0.0 - - name: PHP syntax checker 7.2 - uses: prestashop/github-action-php-lint/7.2@master - - name: PHP syntax checker 7.3 - uses: prestashop/github-action-php-lint/7.3@master - - name: PHP syntax checker 7.4 - uses: prestashop/github-action-php-lint/7.4@master + - name: PHP syntax checker 8.1 + uses: prestashop/github-action-php-lint/8.1@master + - name: PHP syntax checker 8.2 + uses: prestashop/github-action-php-lint/8.2@master + - name: PHP syntax checker 8.3 + uses: prestashop/github-action-php-lint/8.3@master php-cs-fixer: name: PHP-CS-Fixer @@ -56,28 +57,49 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2.0.0 + + - name: Setup PHP 8.1 + uses: shivammathur/setup-php@v2 + with: + php-version: "8.1" + tools: composer:v2 + + - name: Cache composer folder + uses: actions/cache@v4 + with: + path: ~/.composer/cache + key: php-composer-cache + + - run: composer install + - name: Run PHP-CS-Fixer - uses: prestashopcorp/github-action-php-cs-fixer@master + run: php vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no phpstan: name: PHPStan runs-on: ubuntu-latest strategy: matrix: - presta-versions: ["8.0.0", "latest"] + presta-versions: [ "9.0.x-apache" ] if: contains(github.event.pull_request.labels.*.name, 'ready to review') steps: - name: Checkout uses: actions/checkout@v2.0.0 + - name: Setup PHP 8.1 + uses: shivammathur/setup-php@v2 + with: + php-version: "8.1" + tools: composer:v2 + - name: Cache vendor folder - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: vendor key: php-${{ hashFiles('composer.lock') }} - name: Cache composer folder - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.composer/cache key: php-composer-cache @@ -87,9 +109,15 @@ jobs: - name: Pull PrestaShop files (Tag ${{ matrix.presta-versions }}) run: docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:${{ matrix.presta-versions }} - - name: Run PHPStan - run: docker run --rm --volumes-from temp-ps -v $PWD:/web/module -e _PS_ROOT_DIR_=/var/www/html --workdir=/web/module phpstan/phpstan:0.12 analyse --configuration=/web/module/tests/phpstan/phpstan-PS-8.neon --error-format github + - name: Wait for PrestaShop to be ready + run: | + while ! docker exec temp-ps curl -sSf http://localhost > /dev/null; do + echo "Waiting for PrestaShop to be ready..." + sleep 10 + done + - name: Run PHPStan + run: docker run --rm --volumes-from temp-ps -v $PWD:/var/www/html/modules/ps_checkout -e _PS_ROOT_DIR_=/var/www/html/ --workdir=/var/www/html/modules/ps_checkout ghcr.io/phpstan/phpstan:latest-php8.1 analyse --configuration=/var/www/html/modules/ps_checkout/tests/phpstan/phpstan.neon --error-format=github phpunit: name: PHPUnit runs-on: ubuntu-latest @@ -98,19 +126,19 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Setup PHP 7.4 + - name: Setup PHP 8.1 uses: shivammathur/setup-php@v2 with: - php-version: "7.4" + php-version: "8.1" - name: Cache vendor folder - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: vendor key: php-${{ hashFiles('composer.lock') }} - name: Cache composer folder - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.composer/cache key: php-composer-cache diff --git a/.gitignore b/.gitignore index def949050..9d1f0b443 100755 --- a/.gitignore +++ b/.gitignore @@ -284,4 +284,7 @@ $RECYCLE.BIN/ # End of https://www.gitignore.io/api/vim,vuejs,emacs,linux,macos,windows,phpstorm,composer,sublimetext,visualstudiocode # CS Fixer -.php_cs.cache +.php-cs-fixer.cache + +# PHPUnit +./tests/Unit/.phpunit.result.cache diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 000000000..4a55268b9 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,11 @@ +setUsingCache(true)->getFinder(); +$finder->in(__DIR__)->exclude('vendor'); + +return $config; diff --git a/.php_cs.dist b/.php_cs.dist deleted file mode 100644 index 9830d6d3d..000000000 --- a/.php_cs.dist +++ /dev/null @@ -1,11 +0,0 @@ -setUsingCache(true) - ->getFinder() - ->in(__DIR__) - ->exclude('vendor'); - -return $config; diff --git a/composer.json b/composer.json index 30fbebeb1..fb8f80049 100755 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "config": { "platform": { - "php": "7.2.34" + "php": "8.1" }, "sort-packages": true, "preferred-install": "dist", @@ -20,25 +20,30 @@ "prepend-autoloader": false }, "require": { - "php": ">=7.2", + "php": ">=8.1", "giggsey/libphonenumber-for-php": "^8.12", "gmponos/guzzle_logger": "^2.2", "guzzlehttp/guzzle": "^7.4", "prestashop/decimal": "^1.3", "prestashop/module-lib-guzzle-adapter": "^1.0", "prestashop/module-lib-mbo-installer": "^2.0", - "prestashop/module-lib-service-container": "^1.0", + "prestashop/module-lib-service-container": "^2.0", "prestashop/prestashop-accounts-installer": "^1.0", "ramsey/uuid": "^3.8", - "segmentio/analytics-php": "^1.5", "sentry/sentry": "^1.0", + "symfony/stopwatch": "^6.4", "webmozart/assert": "^1.0" }, "require-dev": { - "phpunit/phpunit": "~5.7", - "prestashop/php-dev-tools": "~3.0", + "friendsofphp/php-cs-fixer": "^3.68", "monolog/monolog": "^1.27.1", - "prestashop/autoindex": "^1.0" + "nikic/php-parser": "^4.19.1", + "phpstan/phpstan": "^2.1", + "phpunit/php-code-coverage": "^9.2.31", + "phpunit/phpunit": "~9.6.7", + "prestashop/autoindex": "^2.1", + "prestashop/header-stamp": "^2.3", + "prestashop/php-dev-tools": "~5.0" }, "autoload": { "psr-4": { @@ -63,13 +68,20 @@ "@php ./vendor/bin/header-stamp --license=vendor/prestashop/header-stamp/assets/afl.txt --exclude=.github,vendor,tests" ], "php-cs-fixer:check": [ - "@php ./vendor/bin/php-cs-fixer fix --dry-run --diff" + "@php ./vendor/bin/php-cs-fixer fix --dry-run --diff" ], "php-cs-fixer:fix": [ - "@php ./vendor/bin/php-cs-fixer fix" + "@php ./vendor/bin/php-cs-fixer fix" ], "auto-index": [ - "@php ./vendor/bin/autoindex --exclude=vendor,tests" + "@php ./vendor/bin/autoindex --exclude=vendor,tests" + ], + "phpstan": [ + "@putenv _PS_ROOT_DIR_=../../.", + "@php phpstan analyse -c tests/phpstan/phpstan.neon" + ], + "phpunit": [ + "@php phpunit tests -c tests/Unit/phpunit.xml" ] }, "author": "PrestaShop" diff --git a/composer.lock b/composer.lock index de9931dc0..7c7fe3ffc 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": "38c3ff6e8b0ad69217d568aacbee4d1e", + "content-hash": "c47becf1776d9d5e6e292f6c98613ead", "packages": [ { "name": "clue/stream-filter", @@ -74,31 +74,36 @@ }, { "name": "giggsey/libphonenumber-for-php", - "version": "8.13.31", + "version": "8.13.53", "source": { "type": "git", "url": "https://github.com/giggsey/libphonenumber-for-php.git", - "reference": "a4934bddda4672d12f21728e08bd575913bdc310" + "reference": "b3362a3c04f87b02c6e712774d20f9e577c3918c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/a4934bddda4672d12f21728e08bd575913bdc310", - "reference": "a4934bddda4672d12f21728e08bd575913bdc310", + "url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/b3362a3c04f87b02c6e712774d20f9e577c3918c", + "reference": "b3362a3c04f87b02c6e712774d20f9e577c3918c", "shasum": "" }, "require": { - "giggsey/locale": "^1.7|^2.0", - "php": ">=5.3.2", + "giggsey/locale": "^2.0", + "php": "^7.4|^8.0", "symfony/polyfill-mbstring": "^1.17" }, + "replace": { + "giggsey/libphonenumber-for-php-lite": "self.version" + }, "require-dev": { - "pear/pear-core-minimal": "^1.9", + "friendsofphp/php-cs-fixer": "^3.64", + "pear/pear-core-minimal": "^1.10", "pear/pear_exception": "^1.0", - "pear/versioncontrol_git": "^0.5", - "phing/phing": "^2.7", - "php-coveralls/php-coveralls": "^1.0|^2.0", - "symfony/console": "^2.8|^3.0|^v4.4|^v5.2", - "symfony/phpunit-bridge": "^4.2 || ^5" + "pear/versioncontrol_git": "^0.7", + "phing/phing": "^3.0", + "php-coveralls/php-coveralls": "^2.0", + "phpunit/phpunit": "^9.6", + "symfony/console": "^v5.2", + "symfony/var-exporter": "^5.2" }, "type": "library", "extra": { @@ -142,27 +147,28 @@ "issues": "https://github.com/giggsey/libphonenumber-for-php/issues", "source": "https://github.com/giggsey/libphonenumber-for-php" }, - "time": "2024-02-26T08:31:45+00:00" + "time": "2025-01-15T17:09:39+00:00" }, { "name": "giggsey/locale", - "version": "2.5", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/giggsey/Locale.git", - "reference": "e6d4540109a01dd2bc7334cdc842d6a6a67cf239" + "reference": "a5c65ea3c2630f27ccb78977990eefbee6dd8f97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/giggsey/Locale/zipball/e6d4540109a01dd2bc7334cdc842d6a6a67cf239", - "reference": "e6d4540109a01dd2bc7334cdc842d6a6a67cf239", + "url": "https://api.github.com/repos/giggsey/Locale/zipball/a5c65ea3c2630f27ccb78977990eefbee6dd8f97", + "reference": "a5c65ea3c2630f27ccb78977990eefbee6dd8f97", "shasum": "" }, "require": { - "php": ">=7.2" + "php": "^7.4|^8.0" }, "require-dev": { "ext-json": "*", + "friendsofphp/php-cs-fixer": "^3.64", "pear/pear-core-minimal": "^1.9", "pear/pear_exception": "^1.0", "pear/versioncontrol_git": "^0.5", @@ -172,7 +178,8 @@ "symfony/console": "^5.0|^6.0", "symfony/filesystem": "^5.0|^6.0", "symfony/finder": "^5.0|^6.0", - "symfony/process": "^5.0|^6.0" + "symfony/process": "^5.0|^6.0", + "symfony/var-exporter": "^5.2|^6.0" }, "type": "library", "autoload": { @@ -194,9 +201,9 @@ "description": "Locale functions required by libphonenumber-for-php", "support": { "issues": "https://github.com/giggsey/Locale/issues", - "source": "https://github.com/giggsey/Locale/tree/2.5" + "source": "https://github.com/giggsey/Locale/tree/2.7.0" }, - "time": "2023-11-01T17:19:48+00:00" + "time": "2024-11-04T11:18:07+00:00" }, { "name": "gmponos/guzzle_logger", @@ -272,22 +279,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.8.1", + "version": "7.9.2", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" + "reference": "d281ed313b989f213357e3be1a179f02196ac99b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", + "reference": "d281ed313b989f213357e3be1a179f02196ac99b", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0.1", - "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -298,9 +305,9 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "guzzle/client-integration-tests": "3.0.2", "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -378,7 +385,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.8.1" + "source": "https://github.com/guzzle/guzzle/tree/7.9.2" }, "funding": [ { @@ -394,20 +401,20 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:35:24+00:00" + "time": "2024-07-24T11:22:20+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.2", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", + "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", "shasum": "" }, "require": { @@ -415,7 +422,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "type": "library", "extra": { @@ -461,7 +468,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.2" + "source": "https://github.com/guzzle/promises/tree/2.0.4" }, "funding": [ { @@ -477,20 +484,20 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:19:20+00:00" + "time": "2024-10-17T10:06:22+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.6.2", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", "shasum": "" }, "require": { @@ -505,8 +512,8 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -577,7 +584,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.6.2" + "source": "https://github.com/guzzle/psr7/tree/2.7.0" }, "funding": [ { @@ -593,7 +600,7 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:05:35+00:00" + "time": "2024-07-18T11:15:46+00:00" }, { "name": "paragonie/random_compat", @@ -647,16 +654,16 @@ }, { "name": "php-http/httplug", - "version": "2.4.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/php-http/httplug.git", - "reference": "625ad742c360c8ac580fcc647a1541d29e257f67" + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/625ad742c360c8ac580fcc647a1541d29e257f67", - "reference": "625ad742c360c8ac580fcc647a1541d29e257f67", + "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4", + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4", "shasum": "" }, "require": { @@ -698,22 +705,22 @@ ], "support": { "issues": "https://github.com/php-http/httplug/issues", - "source": "https://github.com/php-http/httplug/tree/2.4.0" + "source": "https://github.com/php-http/httplug/tree/2.4.1" }, - "time": "2023-04-14T15:10:03+00:00" + "time": "2024-09-23T11:39:58+00:00" }, { "name": "php-http/message", - "version": "1.16.0", + "version": "1.16.2", "source": { "type": "git", "url": "https://github.com/php-http/message.git", - "reference": "47a14338bf4ebd67d317bf1144253d7db4ab55fd" + "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/47a14338bf4ebd67d317bf1144253d7db4ab55fd", - "reference": "47a14338bf4ebd67d317bf1144253d7db4ab55fd", + "url": "https://api.github.com/repos/php-http/message/zipball/06dd5e8562f84e641bf929bfe699ee0f5ce8080a", + "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a", "shasum": "" }, "require": { @@ -767,22 +774,22 @@ ], "support": { "issues": "https://github.com/php-http/message/issues", - "source": "https://github.com/php-http/message/tree/1.16.0" + "source": "https://github.com/php-http/message/tree/1.16.2" }, - "time": "2023-05-17T06:43:38+00:00" + "time": "2024-10-02T11:34:13+00:00" }, { "name": "php-http/promise", - "version": "1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/php-http/promise.git", - "reference": "2916a606d3b390f4e9e8e2b8dd68581508be0f07" + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/2916a606d3b390f4e9e8e2b8dd68581508be0f07", - "reference": "2916a606d3b390f4e9e8e2b8dd68581508be0f07", + "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83", + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83", "shasum": "" }, "require": { @@ -819,9 +826,9 @@ ], "support": { "issues": "https://github.com/php-http/promise/issues", - "source": "https://github.com/php-http/promise/tree/1.3.0" + "source": "https://github.com/php-http/promise/tree/1.3.1" }, - "time": "2024-01-04T18:49:48+00:00" + "time": "2024-03-15T13:55:21+00:00" }, { "name": "prestashop/decimal", @@ -1032,29 +1039,31 @@ }, { "name": "prestashop/module-lib-service-container", - "version": "1.4.0", + "version": "v2.0", "source": { "type": "git", "url": "https://github.com/PrestaShopCorp/module-lib-service-container.git", - "reference": "96f4f551b96cffb1f78462cd4722f0d2b057abda" + "reference": "5525b56513d9ddad6e4232dfd93a24e028efdca7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShopCorp/module-lib-service-container/zipball/96f4f551b96cffb1f78462cd4722f0d2b057abda", - "reference": "96f4f551b96cffb1f78462cd4722f0d2b057abda", + "url": "https://api.github.com/repos/PrestaShopCorp/module-lib-service-container/zipball/5525b56513d9ddad6e4232dfd93a24e028efdca7", + "reference": "5525b56513d9ddad6e4232dfd93a24e028efdca7", "shasum": "" }, "require": { "php": ">=5.6.0", - "prestashop/module-lib-cache-directory-provider": "^1.0", - "symfony/config": "^3.4", - "symfony/dependency-injection": "^3.4", - "symfony/expression-language": "^3.4", - "symfony/yaml": "^3.4" + "prestashop/module-lib-cache-directory-provider": "^1.0" }, "require-dev": { "phpunit/phpunit": "~5.7" }, + "suggest": { + "symfony/config": "Needed when the running PrestaShop does not already run with Symfony", + "symfony/dependency-injection": "Needed when the running PrestaShop does not already run with Symfony", + "symfony/expression-language": "Needed when the running PrestaShop does not already run with Symfony", + "symfony/yaml": "Needed when the running PrestaShop does not already run with Symfony" + }, "type": "library", "autoload": { "psr-4": { @@ -1080,9 +1089,9 @@ ], "support": { "issues": "https://github.com/PrestaShopCorp/module-lib-service-container/issues", - "source": "https://github.com/PrestaShopCorp/module-lib-service-container/tree/1.4.0" + "source": "https://github.com/PrestaShopCorp/module-lib-service-container/tree/v2.0" }, - "time": "2021-06-01T15:21:20+00:00" + "time": "2022-06-20T08:30:47+00:00" }, { "name": "prestashop/prestashop-accounts-installer", @@ -1125,72 +1134,28 @@ "time": "2023-05-04T07:24:48+00:00" }, { - "name": "psr/cache", - "version": "1.0.1", + "name": "psr/container", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "dev-master": "2.0.x-dev" } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/master" - }, - "time": "2016-08-06T20:24:11+00:00" - }, - { - "name": "psr/container", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" }, - "type": "library", "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -1217,9 +1182,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-03-05T17:36:06+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { "name": "psr/http-client", @@ -1275,20 +1240,20 @@ }, { "name": "psr/http-factory", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", + "php": ">=7.1", "psr/http-message": "^1.0 || ^2.0" }, "type": "library", @@ -1312,7 +1277,7 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -1324,9 +1289,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2023-04-10T20:10:41+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", @@ -1575,91 +1540,33 @@ ], "time": "2022-12-19T21:55:10+00:00" }, - { - "name": "segmentio/analytics-php", - "version": "1.8.0", - "source": { - "type": "git", - "url": "https://github.com/segmentio/analytics-php.git", - "reference": "7e25b2f6094632bbfb79e33ca024d533899a2ffe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/segmentio/analytics-php/zipball/7e25b2f6094632bbfb79e33ca024d533899a2ffe", - "reference": "7e25b2f6094632bbfb79e33ca024d533899a2ffe", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "overtrue/phplint": "^1.1", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "^3.3" - }, - "bin": [ - "bin/analytics" - ], - "type": "library", - "autoload": { - "files": [ - "lib/Segment.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Segment.io ", - "homepage": "https://segment.com/" - } - ], - "description": "Segment Analytics PHP Library", - "homepage": "https://segment.com/libraries/php", - "keywords": [ - "analytics", - "analytics.js", - "segment", - "segmentio" - ], - "support": { - "issues": "https://github.com/segmentio/analytics-php/issues", - "source": "https://github.com/segmentio/analytics-php/tree/1.8.0" - }, - "time": "2021-05-31T22:44:22+00:00" - }, { "name": "sentry/sentry", - "version": "1.11.0", + "version": "1.6.2", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "159eeaa02bb2ef8a8ec669f3c88e4bff7e6a7ffe" + "reference": "5bee26136ab3fc166334cd972892bf71bd361558" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/159eeaa02bb2ef8a8ec669f3c88e4bff7e6a7ffe", - "reference": "159eeaa02bb2ef8a8ec669f3c88e4bff7e6a7ffe", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/5bee26136ab3fc166334cd972892bf71bd361558", + "reference": "5bee26136ab3fc166334cd972892bf71bd361558", "shasum": "" }, "require": { "ext-curl": "*", - "php": "^5.3|^7.0" + "php": ">=5.2.4" }, "conflict": { "raven/raven": "*" }, "require-dev": { "friendsofphp/php-cs-fixer": "^1.8.0", - "monolog/monolog": "^1.0", - "phpunit/phpunit": "^4.8.35 || ^5.7" + "monolog/monolog": "*", + "phpunit/phpunit": "^4.8 || ^5.0" }, "suggest": { - "ext-hash": "*", - "ext-json": "*", - "ext-mbstring": "*", "monolog/monolog": "Automatically capture Monolog events as breadcrumbs" }, "bin": [ @@ -1668,7 +1575,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -1694,64 +1601,40 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/1.11.0" + "source": "https://github.com/getsentry/sentry-php/tree/releases/1.6.x" }, - "time": "2020-02-12T18:38:11+00:00" + "time": "2017-02-03T07:32:53+00:00" }, { - "name": "symfony/cache", - "version": "v4.4.48", + "name": "symfony/deprecation-contracts", + "version": "v3.5.1", "source": { "type": "git", - "url": "https://github.com/symfony/cache.git", - "reference": "3b98ed664887ad197b8ede3da2432787212eb915" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/3b98ed664887ad197b8ede3da2432787212eb915", - "reference": "3b98ed664887ad197b8ede3da2432787212eb915", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { - "php": ">=7.1.3", - "psr/cache": "^1.0|^2.0", - "psr/log": "^1|^2|^3", - "symfony/cache-contracts": "^1.1.7|^2", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.2|^5.0" - }, - "conflict": { - "doctrine/dbal": "<2.7", - "symfony/dependency-injection": "<3.4", - "symfony/http-kernel": "<4.4|>=5.0", - "symfony/var-dumper": "<4.4" - }, - "provide": { - "psr/cache-implementation": "1.0|2.0", - "psr/simple-cache-implementation": "1.0|2.0", - "symfony/cache-implementation": "1.0|2.0" - }, - "require-dev": { - "cache/integration-tests": "dev-master", - "doctrine/cache": "^1.6|^2.0", - "doctrine/dbal": "^2.7|^3.0", - "predis/predis": "^1.1", - "psr/simple-cache": "^1.0|^2.0", - "symfony/config": "^4.2|^5.0", - "symfony/dependency-injection": "^3.4|^4.1|^5.0", - "symfony/filesystem": "^4.4|^5.0", - "symfony/http-kernel": "^4.4", - "symfony/var-dumper": "^4.4|^5.0" + "php": ">=8.1" }, "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Cache\\": "" + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" }, - "exclude-from-classmap": [ - "/Tests/" + "branch-alias": { + "dev-main": "3.5-dev" + } + }, + "autoload": { + "files": [ + "function.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1768,14 +1651,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Provides extended PSR-6, PSR-16 (and tags) implementations", + "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", - "keywords": [ - "caching", - "psr6" - ], "support": { - "source": "https://github.com/symfony/cache/tree/v4.4.48" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -1791,42 +1670,44 @@ "type": "tidelift" } ], - "time": "2022-10-17T20:21:54+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { - "name": "symfony/cache-contracts", - "version": "v2.5.2", + "name": "symfony/polyfill-ctype", + "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/cache-contracts.git", - "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", - "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/cache": "^1.0|^2.0|^3.0" + "php": ">=7.2" + }, + "provide": { + "ext-ctype": "*" }, "suggest": { - "symfony/cache-implementation": "" + "ext-ctype": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Contracts\\Cache\\": "" + "Symfony\\Polyfill\\Ctype\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1835,26 +1716,24 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Generic abstractions related to caching", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" + "compatibility", + "ctype", + "polyfill", + "portable" ], "support": { - "source": "https://github.com/symfony/cache-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" }, "funding": [ { @@ -1870,48 +1749,45 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/config", - "version": "v3.4.47", + "name": "symfony/polyfill-mbstring", + "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "bc6b3fd3930d4b53a60b42fe2ed6fc466b75f03f" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/bc6b3fd3930d4b53a60b42fe2ed6fc466b75f03f", - "reference": "bc6b3fd3930d4b53a60b42fe2ed6fc466b75f03f", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0|~4.0", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/dependency-injection": "<3.3", - "symfony/finder": "<3.3" + "php": ">=7.2" }, - "require-dev": { - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/event-dispatcher": "~3.3|~4.0", - "symfony/finder": "~3.3|~4.0", - "symfony/yaml": "~3.0|~4.0" + "provide": { + "ext-mbstring": "*" }, "suggest": { - "symfony/yaml": "To use the yaml reference dumper" + "ext-mbstring": "For best performance" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1919,18 +1795,25 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Config Component", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], "support": { - "source": "https://github.com/symfony/config/tree/v3.4.47" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -1946,54 +1829,46 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/dependency-injection", - "version": "v3.4.47", + "name": "symfony/service-contracts", + "version": "v3.5.1", "source": { "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "51d2a2708c6ceadad84393f8581df1dcf9e5e84b" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/51d2a2708c6ceadad84393f8581df1dcf9e5e84b", - "reference": "51d2a2708c6ceadad84393f8581df1dcf9e5e84b", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "psr/container": "^1.0" + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { - "symfony/config": "<3.3.7", - "symfony/finder": "<3.3", - "symfony/proxy-manager-bridge": "<3.4", - "symfony/yaml": "<3.4" - }, - "provide": { - "psr/container-implementation": "1.0" - }, - "require-dev": { - "symfony/config": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/yaml": "~3.4|~4.0" - }, - "suggest": { - "symfony/config": "", - "symfony/expression-language": "For using expressions in service container configuration", - "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" + "ext-psr": "<1.1|>=2" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" + } + }, "autoload": { "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" + "Symfony\\Contracts\\Service\\": "" }, "exclude-from-classmap": [ - "/Tests/" + "/Test/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2002,18 +1877,26 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony DependencyInjection Component", + "description": "Generic abstractions related to writing services", "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v3.4.47" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -2029,38 +1912,33 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { - "name": "symfony/deprecation-contracts", - "version": "v2.5.2", + "name": "symfony/stopwatch", + "version": "v6.4.13", "source": { "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + "url": "https://github.com/symfony/stopwatch.git", + "reference": "2cae0a6f8d04937d02f6d19806251e2104d54f92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/2cae0a6f8d04937d02f6d19806251e2104d54f92", + "reference": "2cae0a6f8d04937d02f6d19806251e2104d54f92", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1", + "symfony/service-contracts": "^2.5|^3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, "autoload": { - "files": [ - "function.php" + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2069,18 +1947,18 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "A generic function and convention to trigger deprecation notices", + "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/stopwatch/tree/v6.4.13" }, "funding": [ { @@ -2096,35 +1974,43 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { - "name": "symfony/expression-language", - "version": "v3.4.47", + "name": "webmozart/assert", + "version": "1.11.0", "source": { "type": "git", - "url": "https://github.com/symfony/expression-language.git", - "reference": "de38e66398fca1fcb9c48e80279910e6889cb28f" + "url": "https://github.com/webmozarts/assert.git", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/expression-language/zipball/de38e66398fca1fcb9c48e80279910e6889cb28f", - "reference": "de38e66398fca1fcb9c48e80279910e6889cb28f", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/cache": "~3.1|~4.0", - "symfony/polyfill-php70": "~1.6" + "ext-ctype": "*", + "php": "^7.2 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, "autoload": { "psr-4": { - "Symfony\\Component\\ExpressionLanguage\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Webmozart\\Assert\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2132,62 +2018,51 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "Symfony ExpressionLanguage Component", - "homepage": "https://symfony.com", + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], "support": { - "source": "https://github.com/symfony/expression-language/tree/v3.4.47" + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T10:57:07+00:00" - }, + "time": "2022-06-03T18:03:27+00:00" + } + ], + "packages-dev": [ { - "name": "symfony/filesystem", - "version": "v4.4.42", + "name": "clue/ndjson-react", + "version": "v1.3.0", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "815412ee8971209bd4c1eecd5f4f481eacd44bf5" + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/815412ee8971209bd4c1eecd5f4f481eacd44bf5", - "reference": "815412ee8971209bd4c1eecd5f4f481eacd44bf5", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", "shasum": "" }, "require": { - "php": ">=7.1.3", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-php80": "^1.16" + "php": ">=5.3", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Clue\\React\\NDJson\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2195,71 +2070,75 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Christian Lück", + "email": "christian@clue.engineering" } ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", + "keywords": [ + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" + ], "support": { - "source": "https://github.com/symfony/filesystem/tree/v4.4.42" + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" }, "funding": [ { - "url": "https://symfony.com/sponsor", + "url": "https://clue.engineering/support", "type": "custom" }, { - "url": "https://github.com/fabpot", + "url": "https://github.com/clue", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2022-05-20T08:49:14+00:00" + "time": "2022-12-23T10:58:28+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.29.0", + "name": "composer/pcre", + "version": "3.3.2", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + "url": "https://github.com/composer/pcre.git", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", "shasum": "" }, "require": { - "php": ">=7.1" + "php": "^7.4 || ^8.0" }, - "provide": { - "ext-ctype": "*" + "conflict": { + "phpstan/phpstan": "<1.11.10" }, - "suggest": { - "ext-ctype": "For best performance" + "require-dev": { + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" }, "type": "library", "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-main": "3.x-dev" } }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" + "Composer\\Pcre\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2268,77 +2147,68 @@ ], "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" + "PCRE", + "preg", + "regex", + "regular expression" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.3.2" }, "funding": [ { - "url": "https://symfony.com/sponsor", + "url": "https://packagist.com", "type": "custom" }, { - "url": "https://github.com/fabpot", + "url": "https://github.com/composer", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "url": "https://tidelift.com/funding/github/packagist/composer/composer", "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-11-12T16:29:46+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", + "name": "composer/semver", + "version": "3.4.3", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "url": "https://github.com/composer/semver.git", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" + "php": "^5.3.2 || ^7.0 || ^8.0" }, - "suggest": { - "ext-mbstring": "For best performance" + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "branch-alias": { + "dev-main": "3.x-dev" } }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Composer\\Semver\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2347,67 +2217,77 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" } ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", + "description": "Semver library that offers utilities, version constraint parsing and validation.", "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" + "semantic", + "semver", + "validation", + "versioning" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { - "url": "https://symfony.com/sponsor", + "url": "https://packagist.com", "type": "custom" }, { - "url": "https://github.com/fabpot", + "url": "https://github.com/composer", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "url": "https://tidelift.com/funding/github/packagist/composer/composer", "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { - "name": "symfony/polyfill-php70", - "version": "v1.20.0", + "name": "composer/xdebug-handler", + "version": "3.0.5", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644" + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { - "php": ">=7.1" + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" }, - "type": "metapackage", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2416,75 +2296,68 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" } ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", + "description": "Restarts a process without Xdebug.", "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" + "Xdebug", + "performance" ], "support": { - "source": "https://github.com/symfony/polyfill-php70/tree/v1.20.0" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" }, "funding": [ { - "url": "https://symfony.com/sponsor", + "url": "https://packagist.com", "type": "custom" }, { - "url": "https://github.com/fabpot", + "url": "https://github.com/composer", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "url": "https://tidelift.com/funding/github/packagist/composer/composer", "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2024-05-06T16:37:16+00:00" }, { - "name": "symfony/polyfill-php73", - "version": "v1.29.0", + "name": "doctrine/instantiator", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", "shasum": "" }, "require": { - "php": ">=7.1" + "php": "^8.1" }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } + "require-dev": { + "doctrine/coding-standard": "^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, + "type": "library", "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "classmap": [ - "Resources/stubs" - ] + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2492,75 +2365,62 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" } ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" + "constructor", + "instantiate" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0" + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" }, "funding": [ { - "url": "https://symfony.com/sponsor", + "url": "https://www.doctrine-project.org/sponsorship.html", "type": "custom" }, { - "url": "https://github.com/fabpot", - "type": "github" + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2022-12-30T00:23:10+00:00" }, { - "name": "symfony/polyfill-php80", - "version": "v1.29.0", + "name": "evenement/evenement", + "version": "v3.0.2", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.0" }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } + "require-dev": { + "phpunit/phpunit": "^9 || ^6" }, + "type": "library", "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] + "Evenement\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2568,83 +2428,53 @@ ], "authors": [ { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" } ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", + "description": "Événement is a very simple event dispatching library for PHP", "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" + "event-dispatcher", + "event-emitter" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2023-08-08T05:53:35+00:00" }, { - "name": "symfony/service-contracts", - "version": "v2.5.2", + "name": "fidry/cpu-core-counter", + "version": "1.2.0", "source": { "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "8520451a140d3f46ac33042715115e290cf5785f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" - }, - "conflict": { - "ext-psr": "<1.1|>=2" + "php": "^7.2 || ^8.0" }, - "suggest": { - "symfony/service-implementation": "" + "require-dev": { + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, "autoload": { "psr-4": { - "Symfony\\Contracts\\Service\\": "" + "Fidry\\CpuCoreCounter\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2653,71 +2483,95 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" } ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", + "description": "Tiny utility to get the number of CPU cores.", "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" + "CPU", + "core" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/theofidry", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2022-05-30T19:17:29+00:00" + "time": "2024-08-06T10:04:20+00:00" }, { - "name": "symfony/var-exporter", - "version": "v5.4.35", + "name": "friendsofphp/php-cs-fixer", + "version": "v3.68.3", "source": { "type": "git", - "url": "https://github.com/symfony/var-exporter.git", - "reference": "abb0a151b62d6b07e816487e20040464af96cae7" + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "85fd31cced824749a732e697acdd1a3d657312f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/abb0a151b62d6b07e816487e20040464af96cae7", - "reference": "abb0a151b62d6b07e816487e20040464af96cae7", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/85fd31cced824749a732e697acdd1a3d657312f0", + "reference": "85fd31cced824749a732e697acdd1a3d657312f0", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "clue/ndjson-react": "^1.0", + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.2", + "php": "^7.4 || ^8.0", + "react/child-process": "^0.6.5", + "react/event-loop": "^1.0", + "react/promise": "^2.0 || ^3.0", + "react/socket": "^1.0", + "react/stream": "^1.0", + "sebastian/diff": "^4.0 || ^5.1 || ^6.0", + "symfony/console": "^5.4 || ^6.4 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", + "symfony/finder": "^5.4 || ^6.4 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", + "symfony/polyfill-mbstring": "^1.31", + "symfony/polyfill-php80": "^1.31", + "symfony/polyfill-php81": "^1.31", + "symfony/process": "^5.4 || ^6.4 || ^7.2", + "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" }, "require-dev": { - "symfony/var-dumper": "^4.4.9|^5.0.9|^6.0" + "facile-it/paraunit": "^1.3.1 || ^2.4", + "infection/infection": "^0.29.8", + "justinrainbow/json-schema": "^5.3 || ^6.0", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.12", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", + "phpunit/phpunit": "^9.6.22 || ^10.5.40 || ^11.5.2", + "symfony/var-dumper": "^5.4.48 || ^6.4.15 || ^7.2.0", + "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.2.0" }, - "type": "library", + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", "autoload": { "psr-4": { - "Symfony\\Component\\VarExporter\\": "" + "PhpCsFixer\\": "src/" }, "exclude-from-classmap": [ - "/Tests/" + "src/Fixer/Internal/*" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2726,78 +2580,84 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" } ], - "description": "Allows exporting any serializable PHP data structure to plain PHP code", - "homepage": "https://symfony.com", + "description": "A tool to automatically fix PHP code style", "keywords": [ - "clone", - "construct", - "export", - "hydrate", - "instantiate", - "serialize" + "Static code analysis", + "fixer", + "standards", + "static analysis" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v5.4.35" + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.68.3" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/keradus", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2025-01-27T16:37:32+00:00" }, { - "name": "symfony/yaml", - "version": "v3.4.47", + "name": "monolog/monolog", + "version": "1.27.1", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "88289caa3c166321883f67fe5130188ebbb47094" + "url": "https://github.com/Seldaek/monolog.git", + "reference": "904713c5929655dc9b97288b69cfeedad610c9a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/88289caa3c166321883f67fe5130188ebbb47094", - "reference": "88289caa3c166321883f67fe5130188ebbb47094", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/904713c5929655dc9b97288b69cfeedad610c9a1", + "reference": "904713c5929655dc9b97288b69cfeedad610c9a1", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" + "php": ">=5.3.0", + "psr/log": "~1.0" }, - "conflict": { - "symfony/console": "<3.4" + "provide": { + "psr/log-implementation": "1.0.0" }, "require-dev": { - "symfony/console": "~3.4|~4.0" + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpstan/phpstan": "^0.12.59", + "phpunit/phpunit": "~4.5", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "^5.3|^6.0" }, "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Monolog\\": "src/Monolog" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2805,975 +2665,1128 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], "support": { - "source": "https://github.com/symfony/yaml/tree/v3.4.47" + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/1.27.1" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/Seldaek", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2022-06-09T08:53:42+00:00" }, { - "name": "webmozart/assert", - "version": "1.11.0", + "name": "myclabs/deep-copy", + "version": "1.12.1", "source": { "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" + "php": "^7.1 || ^8.0" }, "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { - "phpunit/phpunit": "^8.5.13" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], "psr-4": { - "Webmozart\\Assert\\": "src/" + "DeepCopy\\": "src/DeepCopy/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", + "description": "Create deep copies (clones) of your objects", "keywords": [ - "assert", - "check", - "validate" + "clone", + "copy", + "duplicate", + "object", + "object graph" ], "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, - "time": "2022-06-03T18:03:27+00:00" - } - ], - "packages-dev": [ + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2024-11-08T17:47:46+00:00" + }, { - "name": "composer/pcre", - "version": "1.0.1", + "name": "nikic/php-parser", + "version": "v4.19.4", "source": { "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" + "ext-tokenizer": "*", + "php": ">=7.1" }, "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5" + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, + "bin": [ + "bin/php-parse" + ], "type": "library", "extra": { "branch-alias": { - "dev-main": "1.x-dev" + "dev-master": "4.9-dev" } }, "autoload": { "psr-4": { - "Composer\\Pcre\\": "src" + "PhpParser\\": "lib/PhpParser" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "name": "Nikita Popov" } ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "description": "A PHP parser written in PHP", "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" + "parser", + "php" ], "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/1.0.1" + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-01-21T20:24:37+00:00" + "time": "2024-09-29T15:01:53+00:00" }, { - "name": "composer/semver", - "version": "3.4.0", + "name": "phar-io/manifest", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" }, { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" }, { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, "funding": [ { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", + "url": "https://github.com/theseer", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2023-08-31T09:50:34+00:00" + "time": "2024-03-03T12:33:53+00:00" }, { - "name": "composer/xdebug-handler", - "version": "2.0.5", + "name": "phar-io/version", + "version": "3.2.1", "source": { "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a" + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/9e36aeed4616366d2b690bdce11f71e9178c579a", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { - "composer/pcre": "^1", - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" }, { - "url": "https://github.com/composer", - "type": "github" + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" }, { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "time": "2022-02-24T20:20:32+00:00" + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" }, { - "name": "doctrine/annotations", - "version": "1.14.3", + "name": "phpstan/phpstan", + "version": "2.1.2", "source": { "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af" + "url": "https://github.com/phpstan/phpstan.git", + "reference": "7d08f569e582ade182a375c366cbd896eccadd3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/7d08f569e582ade182a375c366cbd896eccadd3a", + "reference": "7d08f569e582ade182a375c366cbd896eccadd3a", "shasum": "" }, "require": { - "doctrine/lexer": "^1 || ^2", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^9 || ^10", - "phpstan/phpstan": "~1.4.10 || ^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^4.4 || ^5.4 || ^6", - "vimeo/psalm": "^4.10" + "php": "^7.4|^8.0" }, - "suggest": { - "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" + "conflict": { + "phpstan/phpstan-shim": "*" }, + "bin": [ + "phpstan", + "phpstan.phar" + ], "type": "library", "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" + "url": "https://github.com/ondrejmirtes", + "type": "github" }, { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "url": "https://github.com/phpstan", + "type": "github" } ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.14.3" - }, - "time": "2023-02-01T09:20:38+00:00" + "time": "2025-01-21T14:54:06+00:00" }, { - "name": "doctrine/deprecations", - "version": "1.1.3", + "name": "phpunit/php-code-coverage", + "version": "9.2.32", "source": { "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.19.1 || ^5.1.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", - "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" + "phpunit/phpunit": "^9.6" }, "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "extra": { + "branch-alias": { + "dev-main": "9.2.x-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, - "time": "2024-01-30T19:34:25+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-08-22T04:23:01+00:00" }, { - "name": "doctrine/instantiator", - "version": "1.5.0", + "name": "phpunit/php-file-iterator", + "version": "3.0.6", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^5.4" + "phpunit/phpunit": "^9.3" }, "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", "keywords": [ - "constructor", - "instantiate" + "filesystem", + "iterator" ], "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" }, "funding": [ { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "time": "2022-12-30T00:15:36+00:00" + "time": "2021-12-02T12:48:52+00:00" }, { - "name": "doctrine/lexer", - "version": "2.1.1", + "name": "phpunit/php-invoker", + "version": "3.1.1", "source": { "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6" + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6", - "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "shasum": "" }, "require": { - "doctrine/deprecations": "^1.0", - "php": "^7.1 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^12", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", - "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^4.11 || ^5.21" + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" }, "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "src" + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" } }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" + "template" ], "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/2.1.1" + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" }, "funding": [ { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "time": "2024-02-05T11:35:39+00:00" + "time": "2020-10-26T13:16:10+00:00" }, { - "name": "friendsofphp/php-cs-fixer", - "version": "v2.19.3", + "name": "phpunit/phpunit", + "version": "9.6.22", "source": { "type": "git", - "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8" + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/75ac86f33fab4714ea5a39a396784d83ae3b5ed8", - "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.2 || ^2.0", - "doctrine/annotations": "^1.2", + "doctrine/instantiator": "^1.5.0 || ^2", + "ext-dom": "*", "ext-json": "*", - "ext-tokenizer": "*", - "php": "^5.6 || ^7.0 || ^8.0", - "php-cs-fixer/diff": "^1.3", - "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", - "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^3.0 || ^4.0 || ^5.0", - "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", - "symfony/polyfill-php70": "^1.0", - "symfony/polyfill-php72": "^1.4", - "symfony/process": "^3.0 || ^4.0 || ^5.0", - "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" - }, - "require-dev": { - "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.4", - "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.4.2", - "php-cs-fixer/accessible-object": "^1.0", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy-phpunit": "^1.1 || ^2.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", - "phpunitgoodpractices/polyfill": "^1.5", - "phpunitgoodpractices/traits": "^1.9.1", - "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", - "symfony/phpunit-bridge": "^5.2.1", - "symfony/yaml": "^3.0 || ^4.0 || ^5.0" + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.12.1", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", + "sebastian/comparator": "^4.0.8", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", + "sebastian/version": "^3.0.2" }, "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters.", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", - "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "bin": [ - "php-cs-fixer" + "phpunit" ], - "type": "application", + "type": "library", "extra": { "branch-alias": { - "dev-master": "2.19-dev" + "dev-master": "9.6-dev" } }, "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - }, + "files": [ + "src/Framework/Assert/Functions.php" + ], "classmap": [ - "tests/Test/AbstractFixerTestCase.php", - "tests/Test/AbstractIntegrationCaseFactory.php", - "tests/Test/AbstractIntegrationTestCase.php", - "tests/Test/Assert/AssertTokensTrait.php", - "tests/Test/IntegrationCase.php", - "tests/Test/IntegrationCaseFactory.php", - "tests/Test/IntegrationCaseFactoryInterface.php", - "tests/Test/InternalIntegrationCaseFactory.php", - "tests/Test/IsIdenticalConstraint.php", - "tests/Test/TokensWithObservedTransformers.php", - "tests/TestCase.php" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "A tool to automatically fix PHP code style", + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], "support": { - "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.3" + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ { - "url": "https://github.com/keradus", + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2021-11-15T17:17:55+00:00" + "time": "2024-12-05T13:48:26+00:00" }, { - "name": "monolog/monolog", - "version": "1.27.1", + "name": "prestashop/autoindex", + "version": "v2.1.0", "source": { "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "904713c5929655dc9b97288b69cfeedad610c9a1" + "url": "https://github.com/PrestaShopCorp/autoindex.git", + "reference": "235f3ec115432ffc32d582198ea498467b3946d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/904713c5929655dc9b97288b69cfeedad610c9a1", - "reference": "904713c5929655dc9b97288b69cfeedad610c9a1", + "url": "https://api.github.com/repos/PrestaShopCorp/autoindex/zipball/235f3ec115432ffc32d582198ea498467b3946d0", + "reference": "235f3ec115432ffc32d582198ea498467b3946d0", "shasum": "" }, "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "provide": { - "psr/log-implementation": "1.0.0" + "nikic/php-parser": "^4.10", + "php": "^8.0 || ^7.2", + "symfony/console": "^3.4 || ~4.0 || ~5.0 || ~6.0", + "symfony/finder": "^3.4 || ~4.0 || ~5.0 || ~6.0" }, "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "doctrine/couchdb": "~1.0@dev", - "graylog2/gelf-php": "~1.0", - "php-amqplib/php-amqplib": "~2.4", - "php-console/php-console": "^3.1.3", - "phpstan/phpstan": "^0.12.59", - "phpunit/phpunit": "~4.5", - "ruflin/elastica": ">=0.90 <3.0", - "sentry/sentry": "^0.13", - "swiftmailer/swiftmailer": "^5.3|^6.0" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", - "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "php-console/php-console": "Allow sending log messages to Google Chrome", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "sentry/sentry": "Allow sending log messages to a Sentry server" + "phpstan/phpstan": "^0.12.83", + "prestashop/php-dev-tools": "1.*" }, + "bin": [ + "bin/autoindex" + ], "type": "library", "autoload": { "psr-4": { - "Monolog\\": "src/Monolog" + "PrestaShop\\AutoIndex\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "AFL-3.0" ], "authors": [ { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "name": "PrestaShop SA", + "email": "contact@prestashop.com" } ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ], + "description": "Automatically add an 'index.php' in all the current or specified directories and all sub-directories.", + "homepage": "https://github.com/PrestaShopCorp/autoindex", "support": { - "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/1.27.1" + "source": "https://github.com/PrestaShopCorp/autoindex/tree/v2.1.0" }, - "funding": [ + "time": "2022-10-10T08:35:00+00:00" + }, + { + "name": "prestashop/header-stamp", + "version": "v2.3", + "source": { + "type": "git", + "url": "https://github.com/PrestaShopCorp/header-stamp.git", + "reference": "3104b69ad73b6039c7082dbba4af9dbeb0b936b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PrestaShopCorp/header-stamp/zipball/3104b69ad73b6039c7082dbba4af9dbeb0b936b3", + "reference": "3104b69ad73b6039c7082dbba4af9dbeb0b936b3", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.10", + "php": "^8.0 || ^7.2", + "symfony/console": "^3.4 || ~4.0 || ~5.0 || ~6.0", + "symfony/finder": "^3.4 || ~4.0 || ~5.0 || ~6.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.83", + "prestashop/php-dev-tools": "1.*" + }, + "bin": [ + "bin/header-stamp" + ], + "type": "library", + "autoload": { + "psr-4": { + "PrestaShop\\HeaderStamp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "AFL-3.0" + ], + "authors": [ { - "url": "https://github.com/Seldaek", - "type": "github" - }, + "name": "PrestaShop SA", + "email": "contact@prestashop.com" + } + ], + "description": "Rewrite your file headers to add the license or to make them up-to-date", + "homepage": "https://github.com/PrestaShopCorp/header-stamp", + "support": { + "issues": "https://github.com/PrestaShopCorp/header-stamp/issues", + "source": "https://github.com/PrestaShopCorp/header-stamp/tree/v2.3" + }, + "time": "2023-03-23T14:44:10+00:00" + }, + { + "name": "prestashop/php-dev-tools", + "version": "v5", + "source": { + "type": "git", + "url": "https://github.com/PrestaShop/php-dev-tools.git", + "reference": "4b284d9b07a274505c81144536924eb4014e6fbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/4b284d9b07a274505c81144536924eb4014e6fbf", + "reference": "4b284d9b07a274505c81144536924eb4014e6fbf", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/console": "~3.2 || ~4.0 || ~5.0 || ~6.0 || ~7.0", + "symfony/filesystem": "~3.2 || ~4.0 || ~5.0 || ~6.0 || ~7.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.2" + }, + "suggest": { + "phpstan/phpstan": "^0.12", + "prestashop/autoindex": "^2.0", + "prestashop/header-stamp": "^2.0", + "squizlabs/php_codesniffer": "^3.4" + }, + "bin": [ + "bin/prestashop-coding-standards" + ], + "type": "library", + "autoload": { + "psr-4": { + "PrestaShop\\CodingStandards\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", - "type": "tidelift" + "name": "PrestaShop" } ], - "time": "2022-06-09T08:53:42+00:00" + "description": "PrestaShop coding standards", + "support": { + "issues": "https://github.com/PrestaShop/php-dev-tools/issues", + "source": "https://github.com/PrestaShop/php-dev-tools/tree/v5" + }, + "time": "2024-05-23T12:27:45+00:00" }, { - "name": "myclabs/deep-copy", - "version": "1.11.1", + "name": "psr/event-dispatcher", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + "php": ">=7.2.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], "psr-4": { - "DeepCopy\\": "src/DeepCopy/" + "Psr\\EventDispatcher\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Create deep copies (clones) of your objects", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" + "events", + "psr", + "psr-14" ], "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2019-01-08T18:20:26+00:00" }, { - "name": "nikic/php-parser", - "version": "v3.1.5", + "name": "react/cache", + "version": "v1.2.0", "source": { "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.5" + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" }, "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" }, - "bin": [ - "bin/php-parse" - ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, "autoload": { "psr-4": { - "PhpParser\\": "lib/PhpParser" + "React\\Cache\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Nikita Popov" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "A PHP parser written in PHP", + "description": "Async, Promise-based cache interface for ReactPHP", "keywords": [ - "parser", - "php" + "cache", + "caching", + "promise", + "reactphp" ], "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v3.1.5" + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" }, - "time": "2018-02-28T20:30:58+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" }, { - "name": "php-cs-fixer/diff", - "version": "v1.3.1", + "name": "react/child-process", + "version": "v0.6.6", "source": { "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" + "url": "https://github.com/reactphp/child-process.git", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/1721e2b93d89b745664353b9cfc8f155ba8a6159", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0 || ^8.0" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.4" }, "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", - "symfony/process": "^3.3" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" }, "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "React\\ChildProcess\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" }, { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" }, { - "name": "SpacePossum" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "sebastian/diff v2 backport support for PHP5.6", - "homepage": "https://github.com/PHP-CS-Fixer", + "description": "Event-driven library for executing child processes with ReactPHP.", "keywords": [ - "diff" + "event-driven", + "process", + "reactphp" ], "support": { - "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1" + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.6" }, - "abandoned": true, - "time": "2020-10-14T08:39:05+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-01-01T16:37:48+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", + "name": "react/dns", + "version": "v1.13.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + "url": "https://github.com/reactphp/dns.git", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" }, + "type": "library", "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src/" + "React\\Dns\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3782,59 +3795,72 @@ ], "authors": [ { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "description": "Async DNS resolver for ReactPHP", "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" + "async", + "dns", + "dns-resolver", + "reactphp" ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.13.0" }, - "time": "2020-06-27T09:03:43+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-13T14:18:03+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", + "name": "react/event-loop", + "version": "v1.5.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + "url": "https://github.com/reactphp/event-loop.git", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", "shasum": "" }, "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" + "php": ">=5.3.0" }, "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" }, + "type": "library", "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "React\\EventLoop\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3843,52 +3869,71 @@ ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" }, { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" }, - "time": "2021-10-19T17:43:47+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-11-13T13:48:05+00:00" }, { - "name": "phpdocumentor/type-resolver", - "version": "1.6.1", + "name": "react/promise", + "version": "v3.2.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" + "url": "https://github.com/reactphp/promise.git", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" + "php": ">=7.1.0" }, "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "React\\Promise\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3897,51 +3942,75 @@ ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.2.0" }, - "time": "2022-03-15T21:29:03+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-05-24T10:39:05+00:00" }, { - "name": "phpspec/prophecy", - "version": "v1.10.3", + "name": "react/socket", + "version": "v1.16.0", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "451c3cd1418cf640de218914901e51b064abb093" + "url": "https://github.com/reactphp/socket.git", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", - "reference": "451c3cd1418cf640de218914901e51b064abb093", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10.x-dev" - } - }, "autoload": { "psr-4": { - "Prophecy\\": "src/Prophecy" + "React\\Socket\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3950,120 +4019,148 @@ ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" }, { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" + "Connection", + "Socket", + "async", + "reactphp", + "stream" ], "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.16.0" }, - "time": "2020-03-05T15:02:03+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-07-26T10:38:09+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "4.0.8", + "name": "react/stream", + "version": "v1.4.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" }, "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" - }, - "suggest": { - "ext-xdebug": "^2.5.1" + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0.x-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "React\\Stream\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", "keywords": [ - "coverage", - "testing", - "xunit" + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" ], "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/4.0" + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" }, - "time": "2017-04-02T07:44:40+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-11T12:45:25+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "name": "sebastian/cli-parser", + "version": "1.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -4078,41 +4175,50 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5" + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" }, - "time": "2017-11-27T13:52:08+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:27:43+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "sebastian/code-unit", + "version": "1.0.8", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -4129,41 +4235,44 @@ "role": "lead" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" }, - "time": "2015-06-21T13:50:34+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" }, { - "name": "phpunit/php-timer", - "version": "1.0.9", + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -4178,46 +4287,49 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" }, - "time": "2017-02-26T11:10:40+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "2.0.2", + "name": "sebastian/comparator", + "version": "4.0.8", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": "^7.0" + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -4233,75 +4345,64 @@ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ - "tokenizer" + "comparator", + "compare", + "equality" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, - "abandoned": true, - "time": "2017-11-27T05:48:46+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:41:17+00:00" }, { - "name": "phpunit/phpunit", - "version": "5.7.27", + "name": "sebastian/complexity", + "version": "2.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "^1.0.6|^2.0.1", - "symfony/yaml": "~2.1|~3.0|~4.0" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" }, "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" + "phpunit/phpunit": "^9.3" }, - "bin": [ - "phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "5.7.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -4320,52 +4421,45 @@ "role": "lead" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/5.7.27" + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" }, - "time": "2018-02-01T05:50:59+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:19:30+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", + "name": "sebastian/diff", + "version": "4.0.6", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^5.4" - }, - "suggest": { - "ext-soap": "*" + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -4380,190 +4474,203 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "mock", - "xunit" + "diff", + "udiff", + "unidiff", + "unified diff" ], "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", - "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/3.4" + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, - "abandoned": true, - "time": "2017-06-30T09:13:00+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:30:58+00:00" }, { - "name": "prestashop/autoindex", - "version": "v1.0.0", + "name": "sebastian/environment", + "version": "5.1.5", "source": { "type": "git", - "url": "https://github.com/PrestaShopCorp/autoindex.git", - "reference": "92e10242f94a99163dece280f6bd7b7c2b79c158" + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShopCorp/autoindex/zipball/92e10242f94a99163dece280f6bd7b7c2b79c158", - "reference": "92e10242f94a99163dece280f6bd7b7c2b79c158", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { - "nikic/php-parser": "^3.1", - "php": ">=5.6", - "symfony/console": "^3.4", - "symfony/finder": "^3.4" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" }, - "bin": [ - "bin/autoindex" - ], "type": "library", - "autoload": { - "psr-4": { - "PrestaShop\\AutoIndex\\": "src/" + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "AFL-3.0" + "BSD-3-Clause" ], "authors": [ { - "name": "PrestaShop SA", - "email": "contact@prestashop.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Automatically add an 'index.php' in all the current or specified directories and all sub-directories.", - "homepage": "https://github.com/PrestaShopCorp/autoindex", + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], "support": { - "source": "https://github.com/PrestaShopCorp/autoindex/tree/v1.0.0" + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, - "time": "2020-03-11T13:37:03+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" }, { - "name": "prestashop/header-stamp", - "version": "v1.7", + "name": "sebastian/exporter", + "version": "4.0.6", "source": { "type": "git", - "url": "https://github.com/PrestaShopCorp/header-stamp.git", - "reference": "d77ce6d0a7f066670a4774be88f05e5f07b4b6fc" + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShopCorp/header-stamp/zipball/d77ce6d0a7f066670a4774be88f05e5f07b4b6fc", - "reference": "d77ce6d0a7f066670a4774be88f05e5f07b4b6fc", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", "shasum": "" }, "require": { - "nikic/php-parser": "^3.1", - "php": ">=5.6", - "symfony/console": "^3.4 || ~4.0 || ~5.0", - "symfony/finder": "^3.4 || ~4.0 || ~5.0" + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "prestashop/php-dev-tools": "1.*" + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" }, - "bin": [ - "bin/header-stamp" - ], "type": "library", - "autoload": { - "psr-4": { - "PrestaShop\\HeaderStamp\\": "src/" + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "AFL-3.0" + "BSD-3-Clause" ], "authors": [ { - "name": "PrestaShop SA", - "email": "contact@prestashop.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "Rewrite your file headers to add the license or to make them up-to-date", - "homepage": "https://github.com/PrestaShopCorp/header-stamp", + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], "support": { - "issues": "https://github.com/PrestaShopCorp/header-stamp/issues", - "source": "https://github.com/PrestaShopCorp/header-stamp/tree/v1.7" - }, - "time": "2020-12-09T16:40:38+00:00" - }, - { - "name": "prestashop/php-dev-tools", - "version": "v3.16.1", - "source": { - "type": "git", - "url": "https://github.com/PrestaShop/php-dev-tools.git", - "reference": "785108c29ef6f580930372d88b8f551740fdee98" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/785108c29ef6f580930372d88b8f551740fdee98", - "reference": "785108c29ef6f580930372d88b8f551740fdee98", - "shasum": "" - }, - "require": { - "friendsofphp/php-cs-fixer": "^2.14", - "php": ">=5.6.0", - "prestashop/autoindex": "^1.0", - "prestashop/header-stamp": "^1.0", - "squizlabs/php_codesniffer": "^3.4", - "symfony/console": "~3.2 || ~4.0 || ~5.0", - "symfony/filesystem": "~3.2 || ~4.0 || ~5.0" - }, - "conflict": { - "friendsofphp/php-cs-fixer": "2.18.3" + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" }, - "bin": [ - "bin/prestashop-coding-standards" - ], - "type": "library", - "autoload": { - "psr-4": { - "PrestaShop\\CodingStandards\\": "src/" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" ], - "description": "PrestaShop coding standards", - "support": { - "issues": "https://github.com/PrestaShop/php-dev-tools/issues", - "source": "https://github.com/PrestaShop/php-dev-tools/tree/v3.16.1" - }, - "time": "2021-10-18T07:48:21+00:00" + "time": "2024-03-02T06:33:00+00:00" }, { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.3", + "name": "sebastian/global-state", + "version": "5.0.7", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54" + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54", - "reference": "92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -4581,11 +4688,14 @@ "email": "sebastian@phpunit.de" } ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.3" + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" }, "funding": [ { @@ -4593,34 +4703,33 @@ "type": "github" } ], - "time": "2024-03-01T13:45:45+00:00" + "time": "2024-03-02T06:35:11+00:00" }, { - "name": "sebastian/comparator", - "version": "1.2.4", + "name": "sebastian/lines-of-code", + "version": "1.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -4633,60 +4742,52 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/1.2" + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" }, - "time": "2017-01-29T09:50:25+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:20:34+00:00" }, { - "name": "sebastian/diff", - "version": "1.4.3", + "name": "sebastian/object-enumerator", + "version": "4.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -4699,50 +4800,49 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/1.4" + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" }, - "time": "2017-05-22T07:24:03+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" }, { - "name": "sebastian/environment", - "version": "2.0.0", + "name": "sebastian/object-reflector", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -4760,45 +4860,44 @@ "email": "sebastian@phpunit.de" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/master" + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" }, - "time": "2016-11-26T07:53:53+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" }, { - "name": "sebastian/exporter", - "version": "2.0.0", + "name": "sebastian/recursion-context", + "version": "4.0.5", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" + "php": ">=7.3" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -4811,66 +4910,57 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, { "name": "Adam Harvey", "email": "aharvey@php.net" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/master" + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, - "time": "2016-11-19T08:54:04+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" }, { - "name": "sebastian/global-state", - "version": "1.1.1", + "name": "sebastian/resource-operations", + "version": "3.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -4888,42 +4978,43 @@ "email": "sebastian@phpunit.de" } ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/1.1.1" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, - "time": "2015-10-12T03:26:01+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-14T16:00:52+00:00" }, { - "name": "sebastian/object-enumerator", - "version": "2.0.1", + "name": "sebastian/type", + "version": "3.2.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^9.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -4938,41 +5029,45 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/master" + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, - "time": "2017-02-18T15:18:39+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13:03+00:00" }, { - "name": "sebastian/recursion-context", - "version": "2.0.0", + "name": "sebastian/version", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" + "php": ">=7.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -4985,244 +5080,302 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" }, - "time": "2016-11-19T07:33:16+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" }, { - "name": "sebastian/resource-operations", - "version": "1.0.0", + "name": "symfony/console", + "version": "v6.4.17", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "url": "https://github.com/symfony/console.git", + "reference": "799445db3f15768ecc382ac5699e6da0520a0a04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/symfony/console/zipball/799445db3f15768ecc382ac5699e6da0520a0a04", + "reference": "799445db3f15768ecc382ac5699e6da0520a0a04", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^5.4|^6.0|^7.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } + "conflict": { + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" + }, + "type": "library", "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/master" + "source": "https://github.com/symfony/console/tree/v6.4.17" }, - "time": "2015-07-28T20:34:47+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-07T12:07:30+00:00" }, { - "name": "sebastian/version", - "version": "2.0.1", + "name": "symfony/event-dispatcher", + "version": "v6.4.13", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e", + "reference": "0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=8.1", + "symfony/event-dispatcher-contracts": "^2.5|^3" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } + "conflict": { + "symfony/dependency-injection": "<5.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^5.4|^6.0|^7.0" }, + "type": "library", "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.4.13" }, - "time": "2016-10-03T07:35:21+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:18:03+00:00" }, { - "name": "squizlabs/php_codesniffer", - "version": "3.9.0", + "name": "symfony/event-dispatcher-contracts", + "version": "v3.5.1", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", - "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", "shasum": "" }, "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + "php": ">=8.1", + "psr/event-dispatcher": "^1" }, - "bin": [ - "bin/phpcbf", - "bin/phpcs" - ], "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { - "dev-master": "3.x-dev" + "dev-main": "3.5-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Greg Sherwood", - "role": "Former lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "Current lead" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", "keywords": [ - "phpcs", - "standards", - "static analysis" + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" ], "support": { - "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", - "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", - "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", - "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" }, "funding": [ { - "url": "https://github.com/PHPCSStandards", - "type": "github" + "url": "https://symfony.com/sponsor", + "type": "custom" }, { - "url": "https://github.com/jrfnl", + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2024-02-16T15:06:51+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { - "name": "symfony/console", - "version": "v3.4.47", + "name": "symfony/filesystem", + "version": "v6.4.13", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81" + "url": "https://github.com/symfony/filesystem.git", + "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a10b1da6fc93080c180bba7219b5ff5b7518fe81", - "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/4856c9cf585d5a0313d8d35afd681a526f038dd3", + "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/process": "<3.3" - }, - "provide": { - "psr/log-implementation": "1.0" + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "symfony/process": "^5.4|^6.4|^7.0" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Console\\": "" + "Symfony\\Component\\Filesystem\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -5242,10 +5395,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Console Component", + "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v3.4.47" + "source": "https://github.com/symfony/filesystem/tree/v6.4.13" }, "funding": [ { @@ -5261,36 +5414,32 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2024-10-25T15:07:50+00:00" }, { - "name": "symfony/debug", - "version": "v4.4.44", + "name": "symfony/finder", + "version": "v6.4.17", "source": { "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "1a692492190773c5310bc7877cb590c04c2f05be" + "url": "https://github.com/symfony/finder.git", + "reference": "1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be", - "reference": "1a692492190773c5310bc7877cb590c04c2f05be", + "url": "https://api.github.com/repos/symfony/finder/zipball/1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7", + "reference": "1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7", "shasum": "" }, "require": { - "php": ">=7.1.3", - "psr/log": "^1|^2|^3" - }, - "conflict": { - "symfony/http-kernel": "<3.4" + "php": ">=8.1" }, "require-dev": { - "symfony/http-kernel": "^3.4|^4.0|^5.0" + "symfony/filesystem": "^6.0|^7.0" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Debug\\": "" + "Symfony\\Component\\Finder\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -5310,10 +5459,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Provides tools to ease debugging PHP code", + "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug/tree/v4.4.44" + "source": "https://github.com/symfony/finder/tree/v6.4.17" }, "funding": [ { @@ -5329,53 +5478,30 @@ "type": "tidelift" } ], - "abandoned": "symfony/error-handler", - "time": "2022-07-28T16:29:46+00:00" + "time": "2024-12-29T13:51:37+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v4.4.44", + "name": "symfony/options-resolver", + "version": "v6.4.16", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "1e866e9e5c1b22168e0ce5f0b467f19bba61266a" + "url": "https://github.com/symfony/options-resolver.git", + "reference": "368128ad168f20e22c32159b9f761e456cec0c78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1e866e9e5c1b22168e0ce5f0b467f19bba61266a", - "reference": "1e866e9e5c1b22168e0ce5f0b467f19bba61266a", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/368128ad168f20e22c32159b9f761e456cec0c78", + "reference": "368128ad168f20e22c32159b9f761e456cec0c78", "shasum": "" }, "require": { - "php": ">=7.1.3", - "symfony/event-dispatcher-contracts": "^1.1", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "symfony/dependency-injection": "<3.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "1.1" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/error-handler": "~3.4|~4.4", - "symfony/expression-language": "^3.4|^4.0|^5.0", - "symfony/http-foundation": "^3.4|^4.0|^5.0", - "symfony/service-contracts": "^1.1|^2", - "symfony/stopwatch": "^3.4|^4.0|^5.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" + "Symfony\\Component\\OptionsResolver\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -5395,10 +5521,15 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "description": "Provides an improved replacement for the array_replace PHP function", "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.44" + "source": "https://github.com/symfony/options-resolver/tree/v6.4.16" }, "funding": [ { @@ -5414,42 +5545,41 @@ "type": "tidelift" } ], - "time": "2022-07-20T09:59:04+00:00" + "time": "2024-11-20T10:57:02+00:00" }, { - "name": "symfony/event-dispatcher-contracts", - "version": "v1.10.0", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "761c8b8387cfe5f8026594a75fdf0a4e83ba6974" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/761c8b8387cfe5f8026594a75fdf0a4e83ba6974", - "reference": "761c8b8387cfe5f8026594a75fdf0a4e83ba6974", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { - "php": ">=7.1.3" + "php": ">=7.2" }, "suggest": { - "psr/event-dispatcher": "", - "symfony/event-dispatcher-implementation": "" + "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.1-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -5466,18 +5596,18 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Generic abstractions related to dispatching event", + "description": "Symfony polyfill for intl's grapheme_* functions", "homepage": "https://symfony.com", "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v1.10.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" }, "funding": [ { @@ -5493,32 +5623,44 @@ "type": "tidelift" } ], - "time": "2022-07-20T09:59:04+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/finder", - "version": "v3.4.47", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "b6b6ad3db3edb1b4b1c1896b1975fb684994de6e" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/b6b6ad3db3edb1b4b1c1896b1975fb684994de6e", - "reference": "b6b6ad3db3edb1b4b1c1896b1975fb684994de6e", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\Finder\\": "" + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -5527,18 +5669,26 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "Symfony polyfill for intl's Normalizer class and related functions", "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], "support": { - "source": "https://github.com/symfony/finder/tree/v3.4.47" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" }, "funding": [ { @@ -5554,35 +5704,41 @@ "type": "tidelift" } ], - "time": "2020-11-16T17:02:08+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/options-resolver", - "version": "v5.4.21", + "name": "symfony/polyfill-php80", + "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", - "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16" + "php": ">=7.2" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" + "Symfony\\Polyfill\\Php80\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -5591,23 +5747,28 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Provides an improved replacement for the array_replace PHP function", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ - "config", - "configuration", - "options" + "compatibility", + "polyfill", + "portable", + "shim" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.21" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -5623,30 +5784,30 @@ "type": "tidelift" } ], - "time": "2023-02-14T08:03:56+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/polyfill-php72", - "version": "v1.29.0", + "name": "symfony/polyfill-php81", + "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/861391a8da9a04cbad2d232ddd9e4893220d6e25", - "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -5654,8 +5815,11 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - } + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5671,7 +5835,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -5680,7 +5844,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" }, "funding": [ { @@ -5696,25 +5860,24 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process", - "version": "v5.4.36", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "4fdf34004f149cc20b2f51d7d119aa500caad975" + "reference": "3cb242f059c14ae08591c5c4087d1fe443564392" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4fdf34004f149cc20b2f51d7d119aa500caad975", - "reference": "4fdf34004f149cc20b2f51d7d119aa500caad975", + "url": "https://api.github.com/repos/symfony/process/zipball/3cb242f059c14ae08591c5c4087d1fe443564392", + "reference": "3cb242f059c14ae08591c5c4087d1fe443564392", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1" }, "type": "library", "autoload": { @@ -5742,7 +5905,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.36" + "source": "https://github.com/symfony/process/tree/v6.4.15" }, "funding": [ { @@ -5758,30 +5921,46 @@ "type": "tidelift" } ], - "time": "2024-02-12T15:49:53+00:00" + "time": "2024-11-06T14:19:14+00:00" }, { - "name": "symfony/stopwatch", - "version": "v5.4.35", + "name": "symfony/string", + "version": "v6.4.15", "source": { "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "887762aa99ff16f65dc8b48aafead415f942d407" + "url": "https://github.com/symfony/string.git", + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/887762aa99ff16f65dc8b48aafead415f942d407", - "reference": "887762aa99ff16f65dc8b48aafead415f942d407", + "url": "https://api.github.com/repos/symfony/string/zipball/73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/service-contracts": "^1|^2|^3" + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/intl": "^6.2|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { + "files": [ + "Resources/functions.php" + ], "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" + "Symfony\\Component\\String\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -5793,18 +5972,26 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Provides a way to profile code", + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.35" + "source": "https://github.com/symfony/string/tree/v6.4.15" }, "funding": [ { @@ -5820,20 +6007,70 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-11-13T13:31:12+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:36:25+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.2" + "php": ">=8.1" }, - "platform-dev": [], + "platform-dev": {}, "platform-overrides": { - "php": "7.2.34" + "php": "8.1" }, "plugin-api-version": "2.6.0" } diff --git a/config.xml b/config.xml index 9b996e38d..f0a3b4cb4 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ ps_checkout - + diff --git a/config/accounts.yml b/config/accounts.yml index dc3837922..6876068da 100644 --- a/config/accounts.yml +++ b/config/accounts.yml @@ -1,12 +1,12 @@ services: + _defaults: + public: true ps_accounts.installer: class: 'PrestaShop\PsAccountsInstaller\Installer\Installer' - public: true arguments: - "4.0.0" ps_accounts.facade: class: 'PrestaShop\PsAccountsInstaller\Installer\Facade\PsAccounts' - public: true arguments: - "@ps_accounts.installer" diff --git a/config/admin/services.yml b/config/admin/services.yml index 5e9cf5345..58b64a380 100644 --- a/config/admin/services.yml +++ b/config/admin/services.yml @@ -2,13 +2,13 @@ imports: - { resource: ../common.yml } services: - PrestaShop\Module\PrestashopCheckout\Logger\LoggerFileFinder: - class: 'PrestaShop\Module\PrestashopCheckout\Logger\LoggerFileFinder' + _defaults: + autowire: true + autoconfigure: true public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Logger\LoggerDirectory' - - '@PrestaShop\Module\PrestashopCheckout\Logger\LoggerFilename' + + PrestaShop\Module\PrestashopCheckout\Logger\LoggerFileFinder: + class: PrestaShop\Module\PrestashopCheckout\Logger\LoggerFileFinder PrestaShop\Module\PrestashopCheckout\Logger\LoggerFileReader: - class: 'PrestaShop\Module\PrestashopCheckout\Logger\LoggerFileReader' - public: true + class: PrestaShop\Module\PrestashopCheckout\Logger\LoggerFileReader diff --git a/config/cache.yml b/config/cache.yml index 397b22943..9f9e72ac6 100644 --- a/config/cache.yml +++ b/config/cache.yml @@ -1,25 +1,25 @@ services: + _defaults: + public: true PrestaShop\ModuleLibCacheDirectoryProvider\Cache\CacheDirectoryProvider: class: 'PrestaShop\ModuleLibCacheDirectoryProvider\Cache\CacheDirectoryProvider' - public: true arguments: - !php/const _PS_VERSION_ - !php/const _PS_ROOT_DIR_ - !php/const _PS_MODE_DEV_ ps_checkout.cache.array.paypal.order: - class: 'Symfony\Component\Cache\Simple\ArrayCache' + class: Symfony\Component\Cache\Adapter\ArrayAdapter ps_checkout.cache.filesystem.paypal.order: - class: 'Symfony\Component\Cache\Simple\FilesystemCache' + class: Symfony\Component\Cache\Adapter\FilesystemAdapter arguments: - "paypal-orders" - 3600 - '@=service("PrestaShop\\ModuleLibCacheDirectoryProvider\\Cache\\CacheDirectoryProvider").getPath()' ps_checkout.cache.paypal.order: - class: 'Symfony\Component\Cache\Simple\ChainCache' - public: true + class: PrestaShop\Module\PrestashopCheckout\PayPal\Order\Cache\PayPalOrderCache arguments: - [ "@ps_checkout.cache.array.paypal.order", @@ -27,18 +27,17 @@ services: ] ps_checkout.cache.array.paypal.capture: - class: 'Symfony\Component\Cache\Simple\ArrayCache' + class: Symfony\Component\Cache\Adapter\ArrayAdapter ps_checkout.cache.filesystem.paypal.capture: - class: 'Symfony\Component\Cache\Simple\FilesystemCache' + class: Symfony\Component\Cache\Adapter\FilesystemAdapter arguments: - "paypal-capture" - 3600 - '@=service("PrestaShop\\ModuleLibCacheDirectoryProvider\\Cache\\CacheDirectoryProvider").getPath()' ps_checkout.cache.paypal.capture: - class: 'Symfony\Component\Cache\Simple\ChainCache' - public: true + class: Symfony\Component\Cache\Adapter\ChainAdapter arguments: - [ "@ps_checkout.cache.array.paypal.capture", @@ -46,9 +45,19 @@ services: ] ps_checkout.cache.pscheckoutcart: - class: 'Symfony\Component\Cache\Simple\ArrayCache' - public: true + class: Symfony\Component\Cache\Adapter\ArrayAdapter ps_checkout.cache.order: - class: 'Symfony\Component\Cache\Simple\ArrayCache' - public: true + class: Symfony\Component\Cache\Adapter\ArrayAdapter + + Symfony\Component\Cache\Adapter\ChainAdapter $orderPayPalCache: + alias: 'ps_checkout.cache.paypal.order' + + Symfony\Component\Cache\Adapter\ArrayAdapter $orderCache: + alias: 'ps_checkout.cache.order' + + Symfony\Component\Cache\Adapter\ArrayAdapter $cartPrestaShopCache: + alias: 'ps_checkout.cache.pscheckoutcart' + + Symfony\Component\Cache\Adapter\ChainAdapter $capturePayPalCache: + alias: 'ps_checkout.cache.paypal.capture' diff --git a/config/command-handlers.yml b/config/command-handlers.yml index e1c3d4c8c..acffaed29 100644 --- a/config/command-handlers.yml +++ b/config/command-handlers.yml @@ -1,123 +1,70 @@ services: - PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\AddOrderPaymentCommandHandler: - class: 'PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\AddOrderPaymentCommandHandler' + _defaults: + autowire: true + autoconfigure: true public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' - - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceTranslationProvider' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' + + PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\AddOrderPaymentCommandHandler: + class: PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\AddOrderPaymentCommandHandler PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\CreateOrderCommandHandler: class: 'PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\CreateOrderCommandHandler' public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Context\ContextStateManager' - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' - '@PrestaShop\Module\PrestashopCheckout\Order\State\Service\OrderStateMapper' - "@ps_checkout.module" - '@PrestaShop\Module\PrestashopCheckout\Order\Service\CheckOrderAmount' - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceTranslationProvider' + - '@PrestaShop\Module\PrestashopCheckout\Order\EventSubscriber\OrderEventSubscriber' PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler: - class: 'PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' + class: PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler PrestaShop\Module\PrestashopCheckout\Order\Matrice\CommandHandler\UpdateOrderMatriceCommandHandler: - class: 'PrestaShop\Module\PrestashopCheckout\Order\Matrice\CommandHandler\UpdateOrderMatriceCommandHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' + class: PrestaShop\Module\PrestashopCheckout\Order\Matrice\CommandHandler\UpdateOrderMatriceCommandHandler PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CreatePayPalOrderCommandHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CreatePayPalOrderCommandHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient' - - '@PrestaShop\Module\PrestashopCheckout\ShopContext' - - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalCustomerRepository' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository' + class: PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CreatePayPalOrderCommandHandler PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\UpdatePayPalOrderCommandHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\UpdatePayPalOrderCommandHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient' - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' - - '@PrestaShop\Module\PrestashopCheckout\ShopContext' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalOrderProvider' + class: PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\UpdatePayPalOrderCommandHandler PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CapturePayPalOrderCommandHandler: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CapturePayPalOrderCommandHandler' - public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient' - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' + - '@ps_checkout.event.dispatcher.adapter2' - "@ps_checkout.cache.paypal.order" - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalCustomerRepository' - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository' + - '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventProcessor\PayPalOrderEventProcessor' PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SaveCheckoutCommandHandler: - class: 'PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SaveCheckoutCommandHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' + class: PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SaveCheckoutCommandHandler PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\CancelCheckoutCommandHandler: - class: 'PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\CancelCheckoutCommandHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' + class: PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\CancelCheckoutCommandHandler PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SavePayPalOrderStatusCommandHandler: - class: 'PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SavePayPalOrderStatusCommandHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository' + class: PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SavePayPalOrderStatusCommandHandler PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\UpdatePaymentMethodSelectedCommandHandler: - class: 'PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\UpdatePaymentMethodSelectedCommandHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' + class: PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\UpdatePaymentMethodSelectedCommandHandler PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\CommandHandler\RefundPayPalCaptureCommandHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\CommandHandler\RefundPayPalCaptureCommandHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' - - '@PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration' - - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' + class: PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\CommandHandler\RefundPayPalCaptureCommandHandler PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\DeletePaymentTokenCommandHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\DeletePaymentTokenCommandHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\PaymentMethodTokenService' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository' + class: PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\DeletePaymentTokenCommandHandler PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\SavePaymentTokenCommandHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\SavePaymentTokenCommandHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository' + class: PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\SavePaymentTokenCommandHandler PrestaShop\Module\PrestashopCheckout\PayPal\Customer\CommandHandler\SavePayPalCustomerCommandHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Customer\CommandHandler\SavePayPalCustomerCommandHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalCustomerRepository' + class: PrestaShop\Module\PrestashopCheckout\PayPal\Customer\CommandHandler\SavePayPalCustomerCommandHandler PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\SavePayPalOrderCommandHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\SavePayPalOrderCommandHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository' + class: PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\SavePayPalOrderCommandHandler diff --git a/config/common.yml b/config/common.yml index 013d923e1..659899ba4 100644 --- a/config/common.yml +++ b/config/common.yml @@ -7,151 +7,117 @@ imports: - { resource: ./query-handlers.yml } - { resource: ./repository.yml } services: - # From PS 1.7.0 to PS 1.7.3, the bundled version of Symfony is 2.x on which the _defaults - # key is invalid. To prevent error on these versions, each service has to be specifically - # declared as public. - # _defaults: - # public: true + _defaults: + public: true + autowire: true + autoconfigure: true + + PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface: '@ps_checkout.bus.query' + PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface: '@ps_checkout.bus.command' ps_checkout.module: - class: "Ps_checkout" + class: Ps_checkout factory: ["Module", "getInstanceByName"] - public: true arguments: - "ps_checkout" ps_checkout.db: class: Db factory: [ 'Db', 'getInstance' ] - public: true + + Db $db: + alias: 'ps_checkout.db' + + Ps_checkout $psCheckout: + alias: 'ps_checkout.module' ps_checkout.module.version: - class: 'PrestaShop\Module\PrestashopCheckout\Version\Version' + class: PrestaShop\Module\PrestashopCheckout\Version\Version factory: ["PrestaShop\\Module\\PrestashopCheckout\\Version\\Version", "buildFromString"] - public: true arguments: - '@=service("ps_checkout.module").version' PrestaShop\Module\PrestashopCheckout\Environment\EnvLoader: - class: 'PrestaShop\Module\PrestashopCheckout\Environment\EnvLoader' - public: true + class: PrestaShop\Module\PrestashopCheckout\Environment\EnvLoader PrestaShop\Module\PrestashopCheckout\Environment\Env: - class: 'PrestaShop\Module\PrestashopCheckout\Environment\Env' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' - - ps_checkout.tactician.bus: - class: 'League\Tactician\CommandBus' - factory: [ '@PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusFactory', "create" ] + class: PrestaShop\Module\PrestashopCheckout\Environment\Env ps_checkout.bus.command: - class: 'PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusAdapter' - public: true - arguments: - - "@ps_checkout.tactician.bus" + class: PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusAdapter + factory: [ '@PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusFactory', "create" ] - PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusFactory: - class: 'PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusFactory' - public: true + ps_checkout.bus.query: + class: PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusAdapter + factory: [ '@PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusFactory', "create" ] + + PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusFactory: + class: PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusFactory arguments: - - "@ps_checkout.module" - "@ps_checkout.logger" - - PrestaShop\Module\PrestashopCheckout\Order\Command\AddOrderPaymentCommand: 'PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\AddOrderPaymentCommandHandler' - PrestaShop\Module\PrestashopCheckout\Order\Command\CreateOrderCommand: 'PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\CreateOrderCommandHandler' - PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand: 'PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler' - PrestaShop\Module\PrestashopCheckout\Order\Matrice\Command\UpdateOrderMatriceCommand: 'PrestaShop\Module\PrestashopCheckout\Order\Matrice\CommandHandler\UpdateOrderMatriceCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CreatePayPalOrderCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CreatePayPalOrderCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\UpdatePayPalOrderCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\UpdatePayPalOrderCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CapturePayPalOrderCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CapturePayPalOrderCommandHandler' - PrestaShop\Module\PrestashopCheckout\Checkout\Command\CancelCheckoutCommand: 'PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\CancelCheckoutCommandHandler' - PrestaShop\Module\PrestashopCheckout\Checkout\Command\SaveCheckoutCommand: 'PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SaveCheckoutCommandHandler' - PrestaShop\Module\PrestashopCheckout\Checkout\Command\SavePayPalOrderStatusCommand: 'PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SavePayPalOrderStatusCommandHandler' - PrestaShop\Module\PrestashopCheckout\Checkout\Command\UpdatePaymentMethodSelectedCommand: 'PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\UpdatePaymentMethodSelectedCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Command\RefundPayPalCaptureCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\CommandHandler\RefundPayPalCaptureCommandHandler' - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentCompletedQuery: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentCompletedQueryHandler' - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentDeniedQuery: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentDeniedQueryHandler' - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentPendingQuery: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentPendingQueryHandler' - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentRefundedQuery: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentRefundedQueryHandler' - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentReversedQuery: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentReversedQueryHandler' - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForApprovalReversedQuery: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForApprovalReversedQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCartIdQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCartIdQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetCurrentPayPalOrderStatusQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetCurrentPayPalOrderStatusQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCheckoutCompletedQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForOrderConfirmationQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForOrderConfirmationQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Command\SavePaymentTokenCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\SavePaymentTokenCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Command\DeletePaymentTokenCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\DeletePaymentTokenCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Customer\Command\SavePayPalCustomerCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\Customer\CommandHandler\SavePayPalCustomerCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\SavePayPalOrderCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\SavePayPalOrderCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQueryHandler' - - PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherFactory: - class: 'PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherFactory' - public: true + - PrestaShop\Module\PrestashopCheckout\Order\Command\AddOrderPaymentCommand: ['@PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\AddOrderPaymentCommandHandler'] + PrestaShop\Module\PrestashopCheckout\Order\Command\CreateOrderCommand: ['@PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\CreateOrderCommandHandler'] + PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand: ['@PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler'] + PrestaShop\Module\PrestashopCheckout\Order\Matrice\Command\UpdateOrderMatriceCommand: ['@PrestaShop\Module\PrestashopCheckout\Order\Matrice\CommandHandler\UpdateOrderMatriceCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CreatePayPalOrderCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CreatePayPalOrderCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\UpdatePayPalOrderCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\UpdatePayPalOrderCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CapturePayPalOrderCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CapturePayPalOrderCommandHandler'] + PrestaShop\Module\PrestashopCheckout\Checkout\Command\CancelCheckoutCommand: ['@PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\CancelCheckoutCommandHandler'] + PrestaShop\Module\PrestashopCheckout\Checkout\Command\SaveCheckoutCommand: ['@PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SaveCheckoutCommandHandler'] + PrestaShop\Module\PrestashopCheckout\Checkout\Command\SavePayPalOrderStatusCommand: ['@PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SavePayPalOrderStatusCommandHandler'] + PrestaShop\Module\PrestashopCheckout\Checkout\Command\UpdatePaymentMethodSelectedCommand: ['@PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\UpdatePaymentMethodSelectedCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Command\RefundPayPalCaptureCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\CommandHandler\RefundPayPalCaptureCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Command\SavePaymentTokenCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\SavePaymentTokenCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Command\DeletePaymentTokenCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\DeletePaymentTokenCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Customer\Command\SavePayPalCustomerCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Customer\CommandHandler\SavePayPalCustomerCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\SavePayPalOrderCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\SavePayPalOrderCommandHandler'] + + PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusFactory: + class: PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusFactory arguments: - "@ps_checkout.logger" - - '@PrestaShop\Module\PrestashopCheckout\Logger\LoggerConfiguration' + - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentCompletedQuery: [ '@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentCompletedQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentDeniedQuery: [ '@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentDeniedQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentPendingQuery: [ '@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentPendingQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentRefundedQuery: [ '@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentRefundedQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentReversedQuery: [ '@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentReversedQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForApprovalReversedQuery: [ '@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForApprovalReversedQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCartIdQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCartIdQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetCurrentPayPalOrderStatusQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetCurrentPayPalOrderStatusQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCheckoutCompletedQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForOrderConfirmationQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForOrderConfirmationQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQueryHandler' ] + + PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherFactory: + class: PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherFactory PrestaShop\Module\PrestashopCheckout\Checkout\EventSubscriber\CheckoutEventSubscriber: - class: 'PrestaShop\Module\PrestashopCheckout\Checkout\EventSubscriber\CheckoutEventSubscriber' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Checkout\CheckoutChecker' - - '@ps_checkout.bus.command' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' + class: PrestaShop\Module\PrestashopCheckout\Checkout\EventSubscriber\CheckoutEventSubscriber PrestaShop\Module\PrestashopCheckout\Order\EventSubscriber\OrderEventSubscriber: - class: 'PrestaShop\Module\PrestashopCheckout\Order\EventSubscriber\OrderEventSubscriber' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' - - '@ps_checkout.module' + class: PrestaShop\Module\PrestashopCheckout\Order\EventSubscriber\OrderEventSubscriber PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventSubscriber\PayPalOrderEventSubscriber: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventSubscriber\PayPalOrderEventSubscriber' - public: true - arguments: - - "@ps_checkout.module" - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' - - "@ps_checkout.cache.paypal.order" - - '@PrestaShop\Module\PrestashopCheckout\Checkout\CheckoutChecker' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\CheckTransitionPayPalOrderStatusService' - - '@PrestaShop\Module\PrestashopCheckout\Order\State\Service\OrderStateMapper' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository' + class: PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventSubscriber\PayPalOrderEventSubscriber + + PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventProcessor\PayPalOrderEventProcessor: + class: PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventProcessor\PayPalOrderEventProcessor PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\EventSubscriber\PayPalCaptureEventSubscriber: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\EventSubscriber\PayPalCaptureEventSubscriber' - public: true - arguments: - - '@ps_checkout.module' - - '@PrestaShop\Module\PrestashopCheckout\Order\Service\CheckOrderAmount' - - "@ps_checkout.cache.paypal.capture" - - "@ps_checkout.cache.paypal.order" - - '@PrestaShop\Module\PrestashopCheckout\Order\State\Service\OrderStateMapper' + class: PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\EventSubscriber\PayPalCaptureEventSubscriber PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\EventSubscriber\PayPalRefundEventSubscriber: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\EventSubscriber\PayPalRefundEventSubscriber' - arguments: - - '@ps_checkout.module' - - '@ps_checkout.cache.paypal.order' - - '@PrestaShop\Module\PrestashopCheckout\Order\State\Service\OrderStateMapper' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalOrderProvider' + class: PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\EventSubscriber\PayPalRefundEventSubscriber PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\EventSubscriber\PaymentMethodTokenEventSubscriber: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\EventSubscriber\PaymentMethodTokenEventSubscriber' - arguments: - - '@ps_checkout.module' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository' + class: PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\EventSubscriber\PaymentMethodTokenEventSubscriber ps_checkout.event.dispatcher.symfony: - class: 'Symfony\Component\EventDispatcher\EventDispatcherInterface' + class: Symfony\Component\EventDispatcher\EventDispatcherInterface factory: [ '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherFactory', "create" ] arguments: - [ @@ -163,145 +129,91 @@ services: '@PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\EventSubscriber\PaymentMethodTokenEventSubscriber' ] + ps_checkout.event.dispatcher.symfony2: + class: Symfony\Component\EventDispatcher\EventDispatcherInterface + factory: [ '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherFactory', "create" ] + arguments: + - [ + '@PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\EventSubscriber\PayPalCaptureEventSubscriber', + '@PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\EventSubscriber\PaymentMethodTokenEventSubscriber' + ] + PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter: - class: 'PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' - public: true + class: PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter arguments: - "@ps_checkout.event.dispatcher.symfony" + ps_checkout.event.dispatcher.adapter2: + class: PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter + arguments: + - "@ps_checkout.event.dispatcher.symfony2" + PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext: - class: 'PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' - public: true + class: PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext PrestaShop\Module\PrestashopCheckout\Context\ContextStateManager: - class: 'PrestaShop\Module\PrestashopCheckout\Context\ContextStateManager' - public: true + class: PrestaShop\Module\PrestashopCheckout\Context\ContextStateManager PrestaShop\Module\PrestashopCheckout\ShopContext: - class: 'PrestaShop\Module\PrestashopCheckout\ShopContext' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Environment\Env' + class: PrestaShop\Module\PrestashopCheckout\ShopContext PrestaShop\Module\PrestashopCheckout\Shop\ShopProvider: - class: 'PrestaShop\Module\PrestashopCheckout\Shop\ShopProvider' - public: true + class: PrestaShop\Module\PrestashopCheckout\Shop\ShopProvider PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfigurationOptionsResolver: - class: 'PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfigurationOptionsResolver' - public: true + class: PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfigurationOptionsResolver arguments: - '@=service("PrestaShop\\Module\\PrestashopCheckout\\Shop\\ShopProvider").getIdentifier()' PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration: - class: 'PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfigurationOptionsResolver' + class: PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalCodeRepository' + class: PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration PrestaShop\Module\PrestashopCheckout\ExpressCheckout\ExpressCheckoutConfiguration: - class: 'PrestaShop\Module\PrestashopCheckout\ExpressCheckout\ExpressCheckoutConfiguration' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration' + class: PrestaShop\Module\PrestashopCheckout\ExpressCheckout\ExpressCheckoutConfiguration PrestaShop\Module\PrestashopCheckout\PayPal\PayPalPayLaterConfiguration: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\PayPalPayLaterConfiguration' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration' + class: PrestaShop\Module\PrestashopCheckout\PayPal\PayPalPayLaterConfiguration PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceConfiguration: - class: 'PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceConfiguration' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceConfigurationRepository' + class: PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceConfiguration PrestaShop\Module\PrestashopCheckout\PayPal\Sdk\PayPalSdkConfigurationBuilder: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Sdk\PayPalSdkConfigurationBuilder' - public: true - arguments: - - '@ps_checkout.module' - - '@PrestaShop\Module\PrestashopCheckout\Environment\Env' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalPayLaterConfiguration' - - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceConfigurationRepository' - - '@PrestaShop\Module\PrestashopCheckout\ExpressCheckout\ExpressCheckoutConfiguration' - - '@PrestaShop\Module\PrestashopCheckout\ShopContext' - - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' - - '@ps_checkout.logger' - - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceEligibilityConstraint' + class: PrestaShop\Module\PrestashopCheckout\PayPal\Sdk\PayPalSdkConfigurationBuilder PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\PaypalModule: - class: 'PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\PaypalModule' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' + class: PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\PaypalModule PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\ConfigurationModule: - class: 'PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\ConfigurationModule' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalPayLaterConfiguration' - - '@PrestaShop\Module\PrestashopCheckout\ExpressCheckout\ExpressCheckoutConfiguration' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' - - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceProvider' - - "@ps_checkout.module" + class: PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\ConfigurationModule PrestaShop\Module\PrestashopCheckout\Builder\ModuleLink\ModuleLinkBuilder: - class: 'PrestaShop\Module\PrestashopCheckout\Builder\ModuleLink\ModuleLinkBuilder' - public: true + class: PrestaShop\Module\PrestashopCheckout\Builder\ModuleLink\ModuleLinkBuilder PrestaShop\Module\PrestashopCheckout\OnBoarding\Step\LiveStep: - class: 'PrestaShop\Module\PrestashopCheckout\OnBoarding\Step\LiveStep' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration' + class: PrestaShop\Module\PrestashopCheckout\OnBoarding\Step\LiveStep PrestaShop\Module\PrestashopCheckout\OnBoarding\Step\ValueBanner: class: 'PrestaShop\Module\PrestashopCheckout\OnBoarding\Step\ValueBanner' - public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration' PrestaShop\Module\PrestashopCheckout\Translations\Translations: - class: 'PrestaShop\Module\PrestashopCheckout\Translations\Translations' - public: true - arguments: - - "@ps_checkout.module" + class: PrestaShop\Module\PrestashopCheckout\Translations\Translations PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\ContextModule: - class: 'PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\ContextModule' - public: true + class: PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\ContextModule arguments: - '@=service("ps_checkout.module").name' - '@=service("ps_checkout.module").module_key' - - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' - - '@PrestaShop\Module\PrestashopCheckout\OnBoarding\Step\LiveStep' - - '@PrestaShop\Module\PrestashopCheckout\OnBoarding\Step\ValueBanner' - - '@PrestaShop\Module\PrestashopCheckout\Translations\Translations' - - '@PrestaShop\Module\PrestashopCheckout\ShopContext' - - '@PrestaShop\Module\PrestashopCheckout\Shop\ShopProvider' - - '@PrestaShop\Module\PrestashopCheckout\Builder\ModuleLink\ModuleLinkBuilder' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsAccountRepository' PrestaShop\Module\PrestashopCheckout\Adapter\LanguageAdapter: - class: 'PrestaShop\Module\PrestashopCheckout\Adapter\LanguageAdapter' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\ShopContext' + class: PrestaShop\Module\PrestashopCheckout\Adapter\LanguageAdapter PrestaShop\Module\PrestashopCheckout\Presenter\Store\StorePresenter: - class: 'PrestaShop\Module\PrestashopCheckout\Presenter\Store\StorePresenter' - public: true + class: PrestaShop\Module\PrestashopCheckout\Presenter\Store\StorePresenter arguments: - [ '@PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\ContextModule', @@ -310,154 +222,94 @@ services: ] PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceEligibilityConstraint: - class: 'PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceEligibilityConstraint' - public: true + class: PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceEligibilityConstraint PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceCollectionBuilder: - class: 'PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceCollectionBuilder' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceConfiguration' - - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceEligibilityConstraint' + class: PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceCollectionBuilder PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceTranslationProvider: - class: 'PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceTranslationProvider' - public: true - arguments: - - "@ps_checkout.module" + class: PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceTranslationProvider PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourcePresenter: - class: 'PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourcePresenter' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceTranslationProvider' - - '@PrestaShop\Module\PrestashopCheckout\Repository\CountryRepository' - - '@PrestaShop\Module\PrestashopCheckout\Provider\PaymentMethodLogoProvider' + class: PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourcePresenter PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceCollection: - class: 'PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceCollection' - public: true + class: PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceCollection arguments: - '@=service("PrestaShop\\Module\\PrestashopCheckout\\FundingSource\\FundingSourceCollectionBuilder").create()' PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceProvider: - class: 'PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceProvider' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceCollectionBuilder' - - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourcePresenter' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' - - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' + class: PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceProvider ps_checkout.repository.paypal.code: - class: 'PrestaShop\Module\PrestashopCheckout\Repository\PayPalCodeRepository' - public: true + class: PrestaShop\Module\PrestashopCheckout\Repository\PayPalCodeRepository PrestaShop\Module\PrestashopCheckout\Validator\MerchantValidator: - class: 'PrestaShop\Module\PrestashopCheckout\Validator\MerchantValidator' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsAccountRepository' - - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' + class: PrestaShop\Module\PrestashopCheckout\Validator\MerchantValidator PrestaShop\Module\PrestashopCheckout\Validator\FrontControllerValidator: - class: 'PrestaShop\Module\PrestashopCheckout\Validator\FrontControllerValidator' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Validator\MerchantValidator' - - '@PrestaShop\Module\PrestashopCheckout\ExpressCheckout\ExpressCheckoutConfiguration' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalPayLaterConfiguration' + class: PrestaShop\Module\PrestashopCheckout\Validator\FrontControllerValidator PrestaShop\Module\PrestashopCheckout\Validator\BatchConfigurationValidator: - class: 'PrestaShop\Module\PrestashopCheckout\Validator\BatchConfigurationValidator' - public: true + class: PrestaShop\Module\PrestashopCheckout\Validator\BatchConfigurationValidator PrestaShop\Module\PrestashopCheckout\PayPal\PayPalOrderProvider: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\PayPalOrderProvider' - public: true - arguments: - - "@ps_checkout.cache.paypal.order" + class: PrestaShop\Module\PrestashopCheckout\PayPal\PayPalOrderProvider PrestaShop\Module\PrestashopCheckout\Routing\Router: - class: 'PrestaShop\Module\PrestashopCheckout\Routing\Router' - public: true + class: PrestaShop\Module\PrestashopCheckout\Routing\Router PrestaShop\Module\PrestashopCheckout\PayPal\Order\PayPalOrderTranslationProvider: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\PayPalOrderTranslationProvider' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Translations\Translations' - - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceTranslationProvider' + class: PrestaShop\Module\PrestashopCheckout\PayPal\Order\PayPalOrderTranslationProvider PrestaShop\Module\PrestashopCheckout\PayPal\Order\PayPalOrderSummaryViewBuilder: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\PayPalOrderSummaryViewBuilder' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalOrderProvider' - - '@PrestaShop\Module\PrestashopCheckout\Routing\Router' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\PayPalOrderTranslationProvider' - - '@PrestaShop\Module\PrestashopCheckout\ShopContext' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository' + class: PrestaShop\Module\PrestashopCheckout\PayPal\Order\PayPalOrderSummaryViewBuilder PrestaShop\Module\PrestashopCheckout\Webhook\WebhookSecretTokenService: class: 'PrestaShop\Module\PrestashopCheckout\Webhook\WebhookSecretTokenService' - public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration' PrestaShop\Module\PrestashopCheckout\Webhook\WebhookEventConfigurationUpdatedHandler: class: 'PrestaShop\Module\PrestashopCheckout\Webhook\WebhookEventConfigurationUpdatedHandler' - public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration' PrestaShop\Module\PrestashopCheckout\Order\Service\CheckOrderAmount: class: 'PrestaShop\Module\PrestashopCheckout\Order\Service\CheckOrderAmount' - public: true PrestaShop\Module\PrestashopCheckout\Order\State\Service\OrderStateMapper: class: 'PrestaShop\Module\PrestashopCheckout\Order\State\Service\OrderStateMapper' - public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration' PrestaShop\Module\PrestashopCheckout\PayPal\Order\PayPalOrderStatus: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\PayPalOrderStatus' - public: true PrestaShop\Module\PrestashopCheckout\PayPal\Order\CheckTransitionPayPalOrderStatusService: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CheckTransitionPayPalOrderStatusService' - public: true PrestaShop\Module\PrestashopCheckout\Webhook\WebhookHandler: class: 'PrestaShop\Module\PrestashopCheckout\Webhook\WebhookHandler' - public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Webhook\WebhookSecretTokenService' - ['@PrestaShop\Module\PrestashopCheckout\Webhook\WebhookEventConfigurationUpdatedHandler'] PrestaShop\Module\PrestashopCheckout\Configuration\BatchConfigurationProcessor: class: 'PrestaShop\Module\PrestashopCheckout\Configuration\BatchConfigurationProcessor' - public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration' PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\CheckTransitionPayPalCaptureStatusService: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\CheckTransitionPayPalCaptureStatusService' - public: true PrestaShop\Module\PrestashopCheckout\Checkout\CheckoutChecker: class: 'PrestaShop\Module\PrestashopCheckout\Checkout\CheckoutChecker' - public: true arguments: - "@ps_checkout.logger" PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\PaymentMethodTokenService: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\PaymentMethodTokenService' - public: true arguments: - '@?' - '@PrestaShop\Module\PrestashopCheckout\Http\CheckoutHttpClient' @@ -465,24 +317,20 @@ services: PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\OAuthService: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\OAuthService' - public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Http\CheckoutHttpClient' PrestaShop\Module\PrestashopCheckout\Provider\PaymentMethodLogoProvider: class: 'PrestaShop\Module\PrestashopCheckout\Provider\PaymentMethodLogoProvider' - public: true arguments: - '@ps_checkout.module' PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Builder\GooglePayTransactionInfoBuilder: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Builder\GooglePayTransactionInfoBuilder' - public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Translations\Translations' PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Builder\ApplePayPaymentRequestBuilder: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Builder\ApplePayPaymentRequestBuilder' - public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Translations\Translations' diff --git a/config/http-clients.yml b/config/http-clients.yml index 2ff7954f2..5e3846245 100644 --- a/config/http-clients.yml +++ b/config/http-clients.yml @@ -1,47 +1,28 @@ services: - PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient: - class: 'PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient' + _defaults: public: true + autowire: true + autoconfigure: true + + PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient: + class: PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient arguments: - "@ps_checkout.http.client" PrestaShop\Module\PrestashopCheckout\Http\CheckoutHttpClient: - class: 'PrestaShop\Module\PrestashopCheckout\Http\CheckoutHttpClient' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Builder\Configuration\CheckoutClientConfigurationBuilder' + class: PrestaShop\Module\PrestashopCheckout\Http\CheckoutHttpClient PrestaShop\Module\PrestashopCheckout\Builder\Configuration\MaaslandHttpClientConfigurationBuilder: - class: 'PrestaShop\Module\PrestashopCheckout\Builder\Configuration\MaaslandHttpClientConfigurationBuilder' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Environment\Env' - - '@PrestaShop\Module\PrestashopCheckout\Routing\Router' - - '@PrestaShop\Module\PrestashopCheckout\ShopContext' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsAccountRepository' - - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' - - '@PrestaShop\Module\PrestashopCheckout\Logger\LoggerConfiguration' - - "@ps_checkout.logger" + class: PrestaShop\Module\PrestashopCheckout\Builder\Configuration\MaaslandHttpClientConfigurationBuilder PrestaShop\Module\PrestashopCheckout\Http\HttpClientFactory: - class: 'PrestaShop\Module\PrestashopCheckout\Http\HttpClientFactory' - public: true + class: PrestaShop\Module\PrestashopCheckout\Http\HttpClientFactory ps_checkout.http.client: - class: 'PrestaShop\Module\PrestashopCheckout\Http\HttpClientInterface' - public: true + class: PrestaShop\Module\PrestashopCheckout\Http\HttpClientInterface factory: ['@PrestaShop\Module\PrestashopCheckout\Http\HttpClientFactory', "create"] arguments: - '@PrestaShop\Module\PrestashopCheckout\Builder\Configuration\MaaslandHttpClientConfigurationBuilder' PrestaShop\Module\PrestashopCheckout\Builder\Configuration\CheckoutClientConfigurationBuilder: - class: 'PrestaShop\Module\PrestashopCheckout\Builder\Configuration\CheckoutClientConfigurationBuilder' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Environment\Env' - - '@PrestaShop\Module\PrestashopCheckout\Routing\Router' - - '@PrestaShop\Module\PrestashopCheckout\ShopContext' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsAccountRepository' - - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' - - '@PrestaShop\Module\PrestashopCheckout\Logger\LoggerConfiguration' - - "@ps_checkout.logger" + class: PrestaShop\Module\PrestashopCheckout\Builder\Configuration\CheckoutClientConfigurationBuilder diff --git a/config/logger.yml b/config/logger.yml index 839d5a3f8..29ec74e98 100644 --- a/config/logger.yml +++ b/config/logger.yml @@ -1,27 +1,26 @@ services: - PrestaShop\Module\PrestashopCheckout\Logger\LoggerDirectory: - class: 'PrestaShop\Module\PrestashopCheckout\Logger\LoggerDirectory' + _defaults: + autowire: true + autoconfigure: true public: true + + PrestaShop\Module\PrestashopCheckout\Logger\LoggerDirectory: + class: PrestaShop\Module\PrestashopCheckout\Logger\LoggerDirectory arguments: - !php/const _PS_VERSION_ - !php/const _PS_ROOT_DIR_ PrestaShop\Module\PrestashopCheckout\Logger\LoggerFilename: - class: 'PrestaShop\Module\PrestashopCheckout\Logger\LoggerFilename' - public: true + class: PrestaShop\Module\PrestashopCheckout\Logger\LoggerFilename arguments: - '@=service("ps_checkout.module").name' - '@=service("PrestaShop\\Module\\PrestashopCheckout\\Shop\\ShopProvider").getIdentifier()' PrestaShop\Module\PrestashopCheckout\Logger\LoggerConfiguration: - class: 'PrestaShop\Module\PrestashopCheckout\Logger\LoggerConfiguration' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration' + class: PrestaShop\Module\PrestashopCheckout\Logger\LoggerConfiguration PrestaShop\Module\PrestashopCheckout\Logger\LoggerHandlerFactory: - class: 'PrestaShop\Module\PrestashopCheckout\Logger\LoggerHandlerFactory' - public: true + class: PrestaShop\Module\PrestashopCheckout\Logger\LoggerHandlerFactory arguments: - '@=service("PrestaShop\\Module\\PrestashopCheckout\\Logger\\LoggerDirectory").getPath()' - '@=service("PrestaShop\\Module\\PrestashopCheckout\\Logger\\LoggerFilename").get()' @@ -29,20 +28,20 @@ services: - '@=service("PrestaShop\\Module\\PrestashopCheckout\\Logger\\LoggerConfiguration").getLevel()' ps_checkout.logger.handler: - class: 'Monolog\Handler\HandlerInterface' - public: true + class: Monolog\Handler\HandlerInterface factory: ['@PrestaShop\Module\PrestashopCheckout\Logger\LoggerHandlerFactory', "build"] PrestaShop\Module\PrestashopCheckout\Logger\LoggerFactory: - class: 'PrestaShop\Module\PrestashopCheckout\Logger\LoggerFactory' - public: true + class: PrestaShop\Module\PrestashopCheckout\Logger\LoggerFactory arguments: - '@=service("ps_checkout.module").name' - "@ps_checkout.logger.handler" ps_checkout.logger: - class: 'Psr\Log\LoggerInterface' - public: true + class: Psr\Log\LoggerInterface factory: ['@PrestaShop\Module\PrestashopCheckout\Logger\LoggerFactory', "build"] arguments: - '@PrestaShop\Module\PrestashopCheckout\Logger\LoggerDirectory' + + Psr\Log\LoggerInterface $psCheckoutLogger: + alias: 'ps_checkout.logger' diff --git a/config/query-handlers.yml b/config/query-handlers.yml index 4984dceaa..fd1b6a4cf 100644 --- a/config/query-handlers.yml +++ b/config/query-handlers.yml @@ -1,94 +1,50 @@ services: - PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderQueryHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderQueryHandler' + _defaults: + autowire: true + autoconfigure: true public: true - arguments: - - '@ps_checkout.cache.paypal.order' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' + + PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderQueryHandler: + class: PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderQueryHandler PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetCurrentPayPalOrderStatusQueryHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetCurrentPayPalOrderStatusQueryHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' + class: PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetCurrentPayPalOrderStatusQueryHandler PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentCompletedQueryHandler: - class: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentCompletedQueryHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' + class: PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentCompletedQueryHandler PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentDeniedQueryHandler: - class: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentDeniedQueryHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' + class: PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentDeniedQueryHandler PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentPendingQueryHandler: - class: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentPendingQueryHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' + class: PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentPendingQueryHandler PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentRefundedQueryHandler: - class: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentRefundedQueryHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' + class: PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentRefundedQueryHandler PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentReversedQueryHandler: - class: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentReversedQueryHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' + class: PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentReversedQueryHandler PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForApprovalReversedQueryHandler: - class: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForApprovalReversedQueryHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' + class: PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForApprovalReversedQueryHandler PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCartIdQueryHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCartIdQueryHandler' - public: true - arguments: - - '@ps_checkout.cache.paypal.order' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' + class: PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCartIdQueryHandler PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCheckoutCompletedQueryHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCheckoutCompletedQueryHandler' - public: true - arguments: - - "@ps_checkout.cache.paypal.order" + class: PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCheckoutCompletedQueryHandler PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForOrderConfirmationQueryHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForOrderConfirmationQueryHandler' - public: true - arguments: - - "@ps_checkout.cache.paypal.order" + class: PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForOrderConfirmationQueryHandler PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQueryHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQueryHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository' + class: PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQueryHandler PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQueryHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQueryHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\OAuthService' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalCustomerRepository' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' + class: PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQueryHandler PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQueryHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQueryHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Builder\GooglePayTransactionInfoBuilder' + class: PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQueryHandler PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQueryHandler: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQueryHandler' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Builder\ApplePayPaymentRequestBuilder' + class: PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQueryHandler diff --git a/config/repository.yml b/config/repository.yml index 771e5ac60..1477bddea 100644 --- a/config/repository.yml +++ b/config/repository.yml @@ -1,45 +1,31 @@ services: - PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository: - class: 'PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' + _defaults: + autowire: true + autoconfigure: true public: true - arguments: - - "@ps_checkout.cache.pscheckoutcart" + + PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository: + class: PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceConfigurationRepository: - class: 'PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceConfigurationRepository' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' + class: PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceConfigurationRepository PrestaShop\Module\PrestashopCheckout\Repository\CountryRepository: - class: 'PrestaShop\Module\PrestashopCheckout\Repository\CountryRepository' - public: true + class: PrestaShop\Module\PrestashopCheckout\Repository\CountryRepository PrestaShop\Module\PrestashopCheckout\Repository\PayPalCodeRepository: - class: 'PrestaShop\Module\PrestashopCheckout\Repository\PayPalCodeRepository' - public: true + class: PrestaShop\Module\PrestashopCheckout\Repository\PayPalCodeRepository PrestaShop\Module\PrestashopCheckout\Repository\PsAccountRepository: - class: 'PrestaShop\Module\PrestashopCheckout\Repository\PsAccountRepository' - public: true + class: PrestaShop\Module\PrestashopCheckout\Repository\PsAccountRepository arguments: - - '@PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration' - "@ps_accounts.facade" PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository: - class: 'PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository' - public: true - arguments: - - '@ps_checkout.db' + class: PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository: - class: 'PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository' - public: true - arguments: - - '@ps_checkout.db' + class: PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository PrestaShop\Module\PrestashopCheckout\Repository\PayPalCustomerRepository: - class: 'PrestaShop\Module\PrestashopCheckout\Repository\PayPalCustomerRepository' - public: true - arguments: - - '@ps_checkout.db' + class: PrestaShop\Module\PrestashopCheckout\Repository\PayPalCustomerRepository diff --git a/controllers/admin/AdminAjaxPrestashopCheckoutController.php b/controllers/admin/AdminAjaxPrestashopCheckoutController.php index b107e13aa..6be2eb94d 100755 --- a/controllers/admin/AdminAjaxPrestashopCheckoutController.php +++ b/controllers/admin/AdminAjaxPrestashopCheckoutController.php @@ -101,7 +101,7 @@ public function ajaxProcessUpdatePaymentMethodsOrder() $fundingSourceConfigurationRepository->save($paymentOption); } - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -113,7 +113,7 @@ public function ajaxProcessUpdatePaymentMode() $paypalConfiguration = $this->module->getService(PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration::class); $paypalConfiguration->setPaymentMode(Tools::getValue('paymentMode')); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -125,7 +125,7 @@ public function ajaxProcessLiveStepConfirmed() $stepLive = $this->module->getService(LiveStep::class); $stepLive->confirmed(true); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -137,7 +137,7 @@ public function ajaxProcessLiveStepViewed() $stepLive = $this->module->getService(LiveStep::class); $stepLive->viewed(true); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -149,7 +149,7 @@ public function ajaxProcessValueBannerClosed() $valueBanner = $this->module->getService(ValueBanner::class); $valueBanner->closed(true); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -165,7 +165,7 @@ public function ajaxProcessEditRoundingSettings() $paypalConfiguration->setRoundType(RoundingSettings::ROUND_ON_EACH_ITEM); $paypalConfiguration->setPriceRoundMode(RoundingSettings::ROUND_UP_AWAY_FROM_ZERO); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -193,7 +193,7 @@ public function ajaxProcessTogglePaymentOptionAvailability() $fundingSourceConfigurationRepository->save($paymentOption); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -206,7 +206,7 @@ public function ajaxProcessUpdateCreditCardFields() $paypalConfiguration->setCardPaymentEnabled((bool) Tools::getValue('hostedFieldsEnabled')); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -220,7 +220,7 @@ public function ajaxProcessToggleECOrderPage() $this->updateExpressCheckoutSettings(); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -234,7 +234,7 @@ public function ajaxProcessToggleECCheckoutPage() $this->updateExpressCheckoutSettings(); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -248,7 +248,7 @@ public function ajaxProcessToggleECProductPage() $this->updateExpressCheckoutSettings(); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -354,32 +354,31 @@ public function ajaxProcessFetchOrder() { $isLegacy = (bool) Tools::getValue('legacy'); $id_order = (int) Tools::getValue('id_order'); - if (empty($id_order)) { http_response_code(400); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ - $this->l('No PrestaShop Order identifier received'), + $this->module->l('No PrestaShop Order identifier received'), ], - ])); + ]); } $order = new Order($id_order); if ($order->module !== $this->module->name) { http_response_code(400); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ strtr( - $this->l('This PrestaShop Order [PRESTASHOP_ORDER_ID] is not paid with PrestaShop Checkout'), + $this->module->l('This PrestaShop Order [PRESTASHOP_ORDER_ID] is not paid with PrestaShop Checkout'), [ '[PRESTASHOP_ORDER_ID]' => $order->id, ] ), ], - ])); + ]); } $psCheckoutCartCollection = new PrestaShopCollection('PsCheckoutCart'); @@ -388,17 +387,17 @@ public function ajaxProcessFetchOrder() if (!$psCheckoutCartCollection->count()) { http_response_code(500); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ strtr( - $this->l('Unable to find PayPal Order associated to this PrestaShop Order [PRESTASHOP_ORDER_ID]'), + $this->module->l('Unable to find PayPal Order associated to this PrestaShop Order [PRESTASHOP_ORDER_ID]'), [ '[PRESTASHOP_ORDER_ID]' => $order->id, ] ), ], - ])); + ]); } $psCheckoutCart = null; @@ -415,17 +414,17 @@ public function ajaxProcessFetchOrder() if ($configurationPayPal->getPaymentMode() !== $psCheckoutCart->getEnvironment()) { http_response_code(422); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ strtr( - $this->l('PayPal Order [PAYPAL_ORDER_ID] is not in the same environment as PrestaShop Checkout'), + $this->module->l('PayPal Order [PAYPAL_ORDER_ID] is not in the same environment as PrestaShop Checkout'), [ '[PAYPAL_ORDER_ID]' => $psCheckoutCart->paypal_order, ] ), ], - ])); + ]); } /** @var PayPalOrderProvider $paypalOrderProvider */ @@ -457,12 +456,12 @@ public function ajaxProcessFetchOrder() 'isProductionEnv' => $psCheckoutCart->getEnvironment() === Mode::LIVE, ]); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => true, 'content' => $isLegacy ? $this->context->smarty->fetch($this->module->getLocalPath() . 'views/templates/admin/ajaxPayPalOrderLegacy.tpl') : $this->context->smarty->fetch($this->module->getLocalPath() . 'views/templates/admin/ajaxPayPalOrder.tpl'), - ])); + ]); } /** @@ -485,23 +484,23 @@ public function ajaxProcessRefundOrder() 'httpCode' => $exception->getCode(), 'status' => false, 'errors' => [ - $this->l('Refund cannot be processed by PayPal.', 'translations'), + $this->module->l('Refund cannot be processed by PayPal.'), ], ]); } catch (PayPalRefundException $invalidArgumentException) { $error = ''; switch ($invalidArgumentException->getCode()) { case PayPalRefundException::INVALID_ORDER_ID: - $error = $this->l('PayPal Order is invalid.', 'translations'); + $error = $this->module->l('PayPal Order is invalid.'); break; case PayPalRefundException::INVALID_TRANSACTION_ID: - $error = $this->l('PayPal Transaction is invalid.', 'translations'); + $error = $this->module->l('PayPal Transaction is invalid.'); break; case PayPalRefundException::INVALID_CURRENCY: - $error = $this->l('PayPal refund currency is invalid.', 'translations'); + $error = $this->module->l('PayPal refund currency is invalid.'); break; case PayPalRefundException::INVALID_AMOUNT: - $error = $this->l('PayPal refund amount is invalid.', 'translations'); + $error = $this->module->l('PayPal refund amount is invalid.'); break; default: break; @@ -516,7 +515,7 @@ public function ajaxProcessRefundOrder() $this->exitWithResponse([ 'httpCode' => 200, 'status' => true, - 'content' => $this->l('Refund has been processed by PayPal, but order status change or email sending failed.', 'translations'), + 'content' => $this->module->l('Refund has been processed by PayPal, but order status change or email sending failed.'), ]); } elseif ($exception->getCode() !== OrderException::ORDER_HAS_ALREADY_THIS_STATUS) { $this->exitWithResponse([ @@ -533,7 +532,7 @@ public function ajaxProcessRefundOrder() 'httpCode' => 500, 'status' => false, 'errors' => [ - $this->l('Refund cannot be processed by PayPal.', 'translations'), + $this->module->l('Refund cannot be processed by PayPal.'), ], 'error' => $exception->getMessage(), ]); @@ -542,7 +541,7 @@ public function ajaxProcessRefundOrder() $this->exitWithResponse([ 'httpCode' => 200, 'status' => true, - 'content' => $this->l('Refund has been processed by PayPal.', 'translations'), + 'content' => $this->module->l('Refund has been processed by PayPal.'), ]); } @@ -565,30 +564,30 @@ public function ajaxProcessUpdateLoggerLevel() if (false === in_array($level, $levels, true)) { http_response_code(400); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Logger level is invalid', ], - ])); + ]); } if (false === (bool) Configuration::updateGlobalValue(LoggerFactory::PS_CHECKOUT_LOGGER_LEVEL, $level)) { http_response_code(500); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Unable to save logger level in PrestaShop Configuration', ], - ])); + ]); } - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => true, 'content' => [ 'level' => $level, ], - ])); + ]); } /** @@ -604,29 +603,29 @@ public function ajaxProcessUpdateLoggerHttpFormat() $format = Tools::getValue('httpFormat'); if (false === in_array($format, $formats, true)) { - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Logger http format is invalid', ], - ])); + ]); } if (false === (bool) Configuration::updateGlobalValue(LoggerFactory::PS_CHECKOUT_LOGGER_HTTP_FORMAT, $format)) { - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Unable to save logger http format in PrestaShop Configuration', ], - ])); + ]); } - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => true, 'content' => [ 'httpFormat' => $format, ], - ])); + ]); } /** @@ -638,20 +637,20 @@ public function ajaxProcessUpdateLoggerHttp() if (false === (bool) Configuration::updateGlobalValue(LoggerFactory::PS_CHECKOUT_LOGGER_HTTP, (int) $isEnabled)) { http_response_code(500); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Unable to save logger http in PrestaShop Configuration', ], - ])); + ]); } - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => true, 'content' => [ 'isEnabled' => (int) $isEnabled, ], - ])); + ]); } /** @@ -663,30 +662,30 @@ public function ajaxProcessUpdateLoggerMaxFiles() if ($maxFiles < 0 || $maxFiles > 30) { http_response_code(400); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Logger max files is invalid', ], - ])); + ]); } if (false === (bool) Configuration::updateGlobalValue(LoggerFactory::PS_CHECKOUT_LOGGER_MAX_FILES, $maxFiles)) { http_response_code(500); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Unable to save logger max files in PrestaShop Configuration', ], - ])); + ]); } - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => true, 'content' => [ 'maxFiles' => $maxFiles, ], - ])); + ]); } /** @@ -697,8 +696,7 @@ public function ajaxProcessGetLogFiles() /** @var LoggerFileFinder $loggerFileFinder */ $loggerFileFinder = $this->module->getService(LoggerFileFinder::class); - header('Content-type: application/json'); - $this->ajaxDie(json_encode($loggerFileFinder->getLogFileNames())); + $this->exitWithResponse($loggerFileFinder->getLogFileNames()); } /** @@ -706,20 +704,18 @@ public function ajaxProcessGetLogFiles() */ public function ajaxProcessGetLogs() { - header('Content-type: application/json'); - $filename = Tools::getValue('file'); $offset = (int) Tools::getValue('offset'); $limit = (int) Tools::getValue('limit'); if (empty($filename) || false === Validate::isFileName($filename)) { http_response_code(400); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Filename is invalid.', ], - ])); + ]); } /** @var LoggerDirectory $loggerDirectory */ @@ -736,15 +732,15 @@ public function ajaxProcessGetLogs() ); } catch (Exception $exception) { http_response_code(500); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ $exception->getMessage(), ], - ])); + ]); } - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => true, 'file' => $fileData['filename'], 'offset' => $fileData['offset'], @@ -752,7 +748,7 @@ public function ajaxProcessGetLogs() 'currentOffset' => $fileData['currentOffset'], 'eof' => (int) $fileData['eof'], 'lines' => $fileData['lines'], - ])); + ]); } /** @@ -764,7 +760,7 @@ public function ajaxProcessSavePaypalButtonConfiguration() $paypalConfiguration = $this->module->getService(PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration::class); $paypalConfiguration->setButtonConfiguration(json_decode(Tools::getValue('configuration'))); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -822,7 +818,7 @@ public function init() /** * {@inheritdoc} */ - protected function isAnonymousAllowed() + public function isAnonymousAllowed() { return false; } @@ -834,10 +830,10 @@ public function display() { if ($this->errors) { http_response_code(400); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => $this->errors, - ])); + ]); } parent::display(); @@ -849,7 +845,7 @@ private function togglePayLaterConfiguration($method) $payLaterConfiguration = $this->module->getService(PayPalPayLaterConfiguration::class); $payLaterConfiguration->$method(Tools::getValue('status') ? true : false); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } public function ajaxProcessUpsertSecretToken() @@ -870,7 +866,7 @@ public function ajaxProcessUpsertSecretToken() http_response_code($status ? 204 : 500); $response['status'] = $status; - $this->ajaxDie(json_encode($response)); + $this->exitWithResponse($response); } public function ajaxProcessCheckConfiguration() @@ -1067,4 +1063,12 @@ public function ajaxProcessDownloadLogs() readfile($file->getRealPath()); exit; } + + public function ajaxDie($value = null, $controller = null, $method = null) + { + header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); + header('Content-type: application/json'); + echo json_encode($value); + exit; + } } diff --git a/controllers/admin/AdminPaypalOnboardingPrestashopCheckoutController.php b/controllers/admin/AdminPaypalOnboardingPrestashopCheckoutController.php index 464791fa4..f2166cd8e 100755 --- a/controllers/admin/AdminPaypalOnboardingPrestashopCheckoutController.php +++ b/controllers/admin/AdminPaypalOnboardingPrestashopCheckoutController.php @@ -76,7 +76,7 @@ public function initCursedPage() $this->addCSS(__PS_BASE_URI__ . $this->admin_webpath . '/themes/' . $this->bo_theme . '/public/theme.css', 'all', 0); } elseif (file_exists(_PS_ROOT_DIR_ . '/' . $this->admin_webpath . '/themes/new-theme/public/theme.css')) { $this->addCSS(__PS_BASE_URI__ . $this->admin_webpath . '/themes/new-theme/public/theme.css', 'all', 1); - } elseif (isset($this->bo_css) && file_exists(_PS_ROOT_DIR_ . '/' . $this->admin_webpath . '/themes/' . $this->bo_theme . '/css/' . $this->bo_css)) { + } elseif ($this->bo_css && file_exists(_PS_ROOT_DIR_ . '/' . $this->admin_webpath . '/themes/' . $this->bo_theme . '/css/' . $this->bo_css)) { $this->addCSS(__PS_BASE_URI__ . $this->admin_webpath . '/themes/' . $this->bo_theme . '/css/' . $this->bo_css, 'all', 0); } @@ -122,7 +122,7 @@ public function init() /** * {@inheritdoc} */ - protected function isAnonymousAllowed() + public function isAnonymousAllowed() { return false; } diff --git a/controllers/front/ExpressCheckout.php b/controllers/front/ExpressCheckout.php index ef42067a7..c58d441f7 100644 --- a/controllers/front/ExpressCheckout.php +++ b/controllers/front/ExpressCheckout.php @@ -173,11 +173,7 @@ private function createAndLoginCustomer( $customer = new Customer($idCustomerExists); } - if (method_exists($this->context, 'updateCustomer')) { - $this->context->updateCustomer($customer); - } else { - CustomerUpdater::updateContextCustomer($this->context, $customer); - } + $this->context->updateCustomer($customer); } /** @@ -313,11 +309,6 @@ private function createAddress( $this->context->cart->id_address_delivery = $address->id; $this->context->cart->id_address_invoice = $address->id; - $products = $this->context->cart->getProducts(); - foreach ($products as $product) { - $this->context->cart->setProductAddressDelivery($product['id_product'], $product['id_product_attribute'], $product['id_address_delivery'], $address->id); - } - return $this->context->cart->save(); } diff --git a/controllers/front/applepay.php b/controllers/front/applepay.php index f74fea18c..7132c08c0 100644 --- a/controllers/front/applepay.php +++ b/controllers/front/applepay.php @@ -20,7 +20,7 @@ use PrestaShop\Module\PrestashopCheckout\Cart\Exception\CartException; use PrestaShop\Module\PrestashopCheckout\Cart\ValueObject\CartId; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Controller\AbstractFrontController; use PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration; @@ -35,10 +35,7 @@ class Ps_CheckoutApplepayModuleFrontController extends AbstractFrontController */ public $module; - /** - * @var CommandBusInterface - */ - private $commandBus; + private QueryBusInterface $queryBus; /** * @see FrontController::postProcess() @@ -61,7 +58,7 @@ public function postProcess() } } - $this->commandBus = $this->module->getService('ps_checkout.bus.command'); + $this->queryBus = $this->module->getService('ps_checkout.bus.query'); switch ($action) { case 'getPaymentRequest': @@ -105,7 +102,7 @@ private function getPaymentRequest() { $cartId = new CartId($this->context->cart->id); $query = new GetApplePayPaymentRequestQuery($cartId); - $paymentRequest = $this->commandBus->handle($query); + $paymentRequest = $this->queryBus->handle($query); $this->exitWithResponse([ 'httpCode' => 200, diff --git a/controllers/front/create.php b/controllers/front/create.php index be79195fd..8af4bd233 100755 --- a/controllers/front/create.php +++ b/controllers/front/create.php @@ -21,6 +21,7 @@ use PrestaShop\Module\PrestashopCheckout\Cart\Exception\CartNotFoundException; use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Controller\AbstractFrontController; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CreatePayPalOrderCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCartIdQuery; @@ -128,10 +129,14 @@ public function postProcess() /** @var CommandBusInterface $commandBus */ $commandBus = $this->module->getService('ps_checkout.bus.command'); + + /** @var QueryBusInterface $queryBus */ + $queryBus = $this->module->getService('ps_checkout.bus.query'); + $commandBus->handle(new CreatePayPalOrderCommand($cartId, $fundingSource, $isCardFields, $isExpressCheckout, $vaultId, $favorite, $vault)); /** @var GetPayPalOrderForCartIdQueryResult $getPayPalOrderForCartIdQueryResult */ - $getPayPalOrderForCartIdQueryResult = $commandBus->handle(new GetPayPalOrderForCartIdQuery($cartId)); + $getPayPalOrderForCartIdQueryResult = $queryBus->handle(new GetPayPalOrderForCartIdQuery($cartId)); $order = $getPayPalOrderForCartIdQueryResult->getOrder(); $this->exitWithResponse([ diff --git a/controllers/front/googlepay.php b/controllers/front/googlepay.php index 7734798cc..3f2a74f6a 100644 --- a/controllers/front/googlepay.php +++ b/controllers/front/googlepay.php @@ -19,7 +19,7 @@ */ use PrestaShop\Module\PrestashopCheckout\Cart\ValueObject\CartId; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Controller\AbstractFrontController; use PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQuery; @@ -33,10 +33,7 @@ class Ps_CheckoutGooglepayModuleFrontController extends AbstractFrontController */ public $module; - /** - * @var CommandBusInterface - */ - private $commandBus; + private QueryBusInterface $queryBus; /** * @see FrontController::postProcess() @@ -53,7 +50,7 @@ public function postProcess() $action = $bodyValues['action']; - $this->commandBus = $this->module->getService('ps_checkout.bus.command'); + $this->queryBus = $this->module->getService('ps_checkout.bus.query'); if ($action === 'getTransactionInfo') { $this->getTransactionInfo($bodyValues); @@ -67,7 +64,7 @@ public function postProcess() private function getTransactionInfo(array $bodyValues) { - $transactionInfo = $this->commandBus->handle(new GetGooglePayTransactionInfoQuery(new CartId($this->context->cart->id))); + $transactionInfo = $this->queryBus->handle(new GetGooglePayTransactionInfoQuery(new CartId($this->context->cart->id))); $this->exitWithResponse([ 'httpCode' => 200, diff --git a/controllers/front/payment.php b/controllers/front/payment.php index 54e7e9402..c7908a2a2 100644 --- a/controllers/front/payment.php +++ b/controllers/front/payment.php @@ -19,6 +19,7 @@ */ use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Controller\AbstractFrontController; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; use PrestaShop\Module\PrestashopCheckout\Order\Command\CreateOrderCommand; @@ -26,10 +27,12 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CapturePayPalOrderCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Entity\PayPalOrder; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Exception\PayPalOrderException; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQuery; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQueryResult; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\ValueObject\PayPalOrderId; -use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalOrderProvider; use PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository; use PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository; +use Symfony\Component\Cache\Adapter\AdapterInterface; class Ps_CheckoutPaymentModuleFrontController extends AbstractFrontController { @@ -41,16 +44,14 @@ class Ps_CheckoutPaymentModuleFrontController extends AbstractFrontController public $display_header = true; - private $orderPageUrl; - - /** - * @var PayPalOrderId - */ - private $paypalOrderId; + private string $orderPageUrl; + private PayPalOrderId $paypalOrderId; + private CommandBusInterface $commandBus; + private QueryBusInterface $queryBus; public function checkAccess() { - return $this->context->customer && $this->context->customer->isLogged() && $this->context->cart; + return $this->context->customer && $this->context->cart; } public function initContent() @@ -65,7 +66,7 @@ public function initContent() public function setMedia() { $this->registerStylesheet('ps_checkout_payment', '/modules/ps_checkout/views/css/payment.css'); - parent::setMedia(); + return parent::setMedia(); } public function postProcess() @@ -79,33 +80,42 @@ public function postProcess() try { $this->paypalOrderId = new PayPalOrderId($orderId); + $this->commandBus = $this->module->getService('ps_checkout.bus.command'); + $this->queryBus = $this->module->getService('ps_checkout.bus.query'); + /** @var PayPalOrderRepository $payPalOrderRepository */ $payPalOrderRepository = $this->module->getService(PayPalOrderRepository::class); - /** @var PayPalOrderProvider $payPalOrderProvider */ - $payPalOrderProvider = $this->module->getService(PayPalOrderProvider::class); - /** @var CommandBusInterface $commandBus */ - $commandBus = $this->module->getService('ps_checkout.bus.command'); - /** @var Psr\SimpleCache\CacheInterface $payPalOrderCache */ + /** @var AdapterInterface $payPalOrderCache */ $payPalOrderCache = $this->module->getService('ps_checkout.cache.paypal.order'); $payPalOrder = $payPalOrderRepository->getPayPalOrderById($this->paypalOrderId); + $orders = new PrestaShopCollection(Order::class); + $orders->where('id_cart', '=', $payPalOrder->getIdCart()); + + if ($orders->count()) { + if ($this->context->customer->isLogged()) { + Tools::redirect('history'); + } else { + $payPalOrderQueryResult = $this->getPayPalOrder($orderId); + $payPalOrderFromCache = $payPalOrderQueryResult->getPayPalOrder(); + + $this->redirectToOrderConfirmationPage($payPalOrder->getIdCart(), $payPalOrderFromCache['purchase_units'][0]['payments']['captures'][0]['id'], $payPalOrderFromCache['status']); + } + } + if ($payPalOrder->getIdCart() !== $this->context->cart->id) { - throw new Exception('PayPal order does not belong to this customer'); + $this->redirectToOrderPage(); } - $payPalOrderFromCache = $payPalOrderProvider->getById($payPalOrder->getId()->getValue()); + $payPalOrderQueryResult = $this->getPayPalOrder($orderId); + $payPalOrderFromCache = $payPalOrderQueryResult->getPayPalOrder(); if ($payPalOrderFromCache['status'] === 'COMPLETED') { $this->createOrder($payPalOrderFromCache, $payPalOrder); } if ($payPalOrderFromCache['status'] === 'PAYER_ACTION_REQUIRED') { - // Delete from cache so when user is redirected from 3DS authentication page the order is fetched from PayPal - if ($payPalOrderCache->has($this->paypalOrderId->getValue())) { - $payPalOrderCache->delete($this->paypalOrderId->getValue()); - } - $this->redirectTo3DSVerification($payPalOrderFromCache); } @@ -117,8 +127,8 @@ public function postProcess() $this->redirectTo3DSVerification($payPalOrderFromCache); break; case Card3DSecure::PROCEED: - $commandBus->handle(new CapturePayPalOrderCommand($this->paypalOrderId->getValue(), array_keys($payPalOrderFromCache['payment_source'])[0])); - $payPalOrderFromCache = $payPalOrderCache->get($this->paypalOrderId->getValue()); + $this->commandBus->handle(new CapturePayPalOrderCommand($orderId, array_keys($payPalOrderFromCache['payment_source'])[0])); + $payPalOrderFromCache = $payPalOrderCache->getItem($orderId)->get(); $this->createOrder($payPalOrderFromCache, $payPalOrder); break; case Card3DSecure::NO_DECISION: @@ -126,6 +136,12 @@ public function postProcess() break; } } + + if ($payPalOrderFromCache['status'] === 'APPROVED') { + $this->commandBus->handle(new CapturePayPalOrderCommand($orderId, array_keys($payPalOrderFromCache['payment_source'])[0])); + $payPalOrderFromCache = $payPalOrderCache->getItem($orderId)->get(); + $this->createOrder($payPalOrderFromCache, $payPalOrder); + } } catch (Exception $exception) { $this->context->smarty->assign('error', $exception->getMessage()); } @@ -143,19 +159,18 @@ public function postProcess() */ private function createOrder($payPalOrderFromCache, $payPalOrder) { - /** @var CommandBusInterface $commandBus */ - $commandBus = $this->module->getService('ps_checkout.bus.command'); - - $capture = $payPalOrderFromCache['purchase_units'][0]['payments']['captures'][0]; - if ($capture['status'] === 'COMPLETED') { - $commandBus->handle(new CreateOrderCommand($payPalOrder->getId()->getValue(), $capture)); - if ($payPalOrder->getPaymentTokenId() && $payPalOrder->checkCustomerIntent(PayPalOrder::CUSTOMER_INTENT_FAVORITE)) { - /** @var PaymentTokenRepository $paymentTokenRepository */ - $paymentTokenRepository = $this->module->getService(PaymentTokenRepository::class); - $paymentTokenRepository->setTokenFavorite($payPalOrder->getPaymentTokenId()); - } - $this->redirectToOrderConfirmationPage($payPalOrder->getIdCart(), $capture['id'], $payPalOrderFromCache['status']); + $capture = $payPalOrderFromCache['purchase_units'][0]['payments']['captures'][0] ?? null; + $captureId = $capture['id'] ?? null; + + $this->commandBus->handle(new CreateOrderCommand($payPalOrder->getId()->getValue(), $capture)); + + if ($payPalOrder->getPaymentTokenId() && $payPalOrder->checkCustomerIntent(PayPalOrder::CUSTOMER_INTENT_FAVORITE)) { + /** @var PaymentTokenRepository $paymentTokenRepository */ + $paymentTokenRepository = $this->module->getService(PaymentTokenRepository::class); + $paymentTokenRepository->setTokenFavorite($payPalOrder->getPaymentTokenId()); } + + $this->redirectToOrderConfirmationPage($payPalOrder->getIdCart(), $captureId, $payPalOrderFromCache['status']); } /** @@ -218,4 +233,18 @@ private function redirectToOrderConfirmationPage($cartId, $captureId, $payPalOrd )); } } + + /** + * @param string $orderId + * + * @return GetPayPalOrderForCheckoutCompletedQueryResult + * + * @throws PayPalOrderException + */ + private function getPayPalOrder($orderId) + { + $payPalOrderQuery = new GetPayPalOrderForCheckoutCompletedQuery($orderId); + + return $this->queryBus->handle($payPalOrderQuery); + } } diff --git a/controllers/front/validate.php b/controllers/front/validate.php index f6cb2fa30..d96e90fd6 100644 --- a/controllers/front/validate.php +++ b/controllers/front/validate.php @@ -20,7 +20,7 @@ */ use PrestaShop\Module\PrestashopCheckout\Checkout\Event\CheckoutCompletedEvent; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Controller\AbstractFrontController; use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; use PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter; @@ -126,8 +126,8 @@ private function generateResponse() } try { - /** @var CommandBusInterface $commandBus */ - $commandBus = $this->module->getService('ps_checkout.bus.command'); + /** @var QueryBusInterface $queryBus */ + $queryBus = $this->module->getService('ps_checkout.bus.query'); /** @var PsCheckoutCartRepository $psCheckoutCartRepository */ $psCheckoutCartRepository = $this->module->getService(PsCheckoutCartRepository::class); @@ -141,7 +141,7 @@ private function generateResponse() try { /** @var GetPayPalOrderForOrderConfirmationQueryResult $paypalOrder */ - $paypalOrder = $commandBus->handle(new GetPayPalOrderForOrderConfirmationQuery( + $paypalOrder = $queryBus->handle(new GetPayPalOrderForOrderConfirmationQuery( $psCheckoutCart->paypal_order )); } catch (Exception $exception) { @@ -438,6 +438,9 @@ private function handleException(Exception $exception) 'body' => [ 'error' => [ 'message' => $exceptionMessageForCustomer, + 'code' => (int) $exception->getCode() < 400 && $exception->getPrevious() !== null + ? (int) $exception->getPrevious()->getCode() + : (int) $exception->getCode(), ], ], 'exceptionCode' => $exception->getCode(), @@ -469,7 +472,7 @@ private function notifyCustomerService(Exception $exception) // Cannot use id_cart because we create a new cart to preserve current cart from customer changes $token = Tools::substr( - Tools::encrypt(implode( + Tools::hash(implode( '|', [ (int) $cart->id_customer, diff --git a/controllers/front/vault.php b/controllers/front/vault.php index f45a24c67..dac2a4d44 100644 --- a/controllers/front/vault.php +++ b/controllers/front/vault.php @@ -19,6 +19,7 @@ */ use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Controller\AbstractFrontController; use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Command\DeletePaymentTokenCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQuery; @@ -40,6 +41,9 @@ public function postProcess() /** @var CommandBusInterface $commandBus */ $commandBus = $this->module->getService('ps_checkout.bus.command'); + /** @var QueryBusInterface $queryBus */ + $queryBus = $this->module->getService('ps_checkout.bus.query'); + $bodyValues = []; $bodyContent = file_get_contents('php://input'); @@ -70,7 +74,7 @@ public function postProcess() } /** @var GetCustomerPaymentTokensQueryResult $getCustomerPaymentMethodTokensQueryResult */ - $getCustomerPaymentMethodTokensQueryResult = $commandBus->handle(new GetCustomerPaymentTokensQuery( + $getCustomerPaymentMethodTokensQueryResult = $queryBus->handle(new GetCustomerPaymentTokensQuery( $customerId, $this->getPageSize(), $this->getPageNumber() diff --git a/ps_checkout.php b/ps_checkout.php index 9b274a7ce..3517cfeff 100755 --- a/ps_checkout.php +++ b/ps_checkout.php @@ -25,16 +25,9 @@ class Ps_checkout extends PaymentModule { - /** - * Default hook to install - * 1.6 and 1.7 - * - * @var array - */ const HOOK_LIST = [ 'displayAdminAfterHeader', 'displayOrderConfirmation', - 'displayAdminOrderLeft', 'displayAdminOrderMainBottom', 'actionObjectShopAddAfter', 'actionObjectShopDeleteAfter', @@ -47,14 +40,6 @@ class Ps_checkout extends PaymentModule 'displayPaymentReturn', 'displayOrderDetail', 'moduleRoutes', - ]; - - /** - * Hook to install for 1.7 - * - * @var array - */ - const HOOK_LIST_17 = [ 'paymentOptions', 'actionCartUpdateQuantityBefore', 'displayInvoiceLegalFreeText', @@ -69,18 +54,6 @@ class Ps_checkout extends PaymentModule 'AdminPaypalOnboardingPrestashopCheckout', ]; - /** - * Hook to install for 1.6 - * - * @var array - */ - const HOOK_LIST_16 = [ - 'actionBeforeCartUpdateQty', - 'actionAfterDeleteProductInCart', - 'displayPayment', - 'displayCartTotalPriceLabel', - ]; - public $configurationList = [ 'PS_CHECKOUT_INTENT' => 'CAPTURE', 'PS_CHECKOUT_MODE' => 'LIVE', @@ -116,7 +89,7 @@ class Ps_checkout extends PaymentModule // Needed in order to retrieve the module version easier (in api call headers) than instanciate // the module each time to get the version - const VERSION = '8.4.2.1'; + const VERSION = '9.4.2.1'; const INTEGRATION_DATE = '2024-04-01'; @@ -127,8 +100,8 @@ class Ps_checkout extends PaymentModule * @var \PrestaShop\ModuleLibServiceContainer\DependencyInjection\ServiceContainer */ private $serviceContainer; - private static $merchantIsValid; - private static $currencyIsAllowed; + private ?bool $merchantIsValid = null; + private array $currencyIsAllowed = []; public function __construct() { @@ -137,7 +110,7 @@ public function __construct() // We cannot use the const VERSION because the const is not computed by addons marketplace // when the zip is uploaded - $this->version = '8.4.2.1'; + $this->version = '9.4.2.1'; $this->author = 'PrestaShop'; $this->currencies = true; $this->currencies_mode = 'checkbox'; @@ -152,7 +125,7 @@ public function __construct() $this->description = $this->l('Provide the most commonly used payment methods to your customers in this all-in-one module, and manage all your sales in a centralized interface.'); $this->confirmUninstall = $this->l('Are you sure you want to uninstall this module?'); - $this->ps_versions_compliancy = ['min' => '8.0.0', 'max' => _PS_VERSION_]; + $this->ps_versions_compliancy = ['min' => '9.0.0', 'max' => _PS_VERSION_]; // $this->disableSegment = false; } @@ -170,7 +143,6 @@ public function install() $savedGroupShopId = Shop::getContextShopGroupID(); Shop::setContext(Shop::CONTEXT_ALL); - // Install for both 1.7 and 1.6 $result = parent::install() && $this->installConfiguration() && $this->installHooks() && @@ -196,23 +168,9 @@ public function install() public function installHooks() { - $result = (bool) $this->registerHook(self::HOOK_LIST); - /** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */ - $shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class); + $result = $this->registerHook(self::HOOK_LIST); - // Install specific to prestashop 1.6 - if (!$shopContext->isShop17()) { - $result = $result && $this->registerHook(self::HOOK_LIST_16); - $this->updatePosition(\Hook::getIdByName('payment'), false, 1); - - return $result; - } - - // Install specific to prestashop 1.7 - if ($shopContext->isShop17()) { - $result = $result && (bool) $this->registerHook(self::HOOK_LIST_17); - $this->updatePosition(\Hook::getIdByName('paymentOptions'), false, 1); - } + $this->updatePosition(Hook::getIdByName('paymentOptions'), false, 1); return $result; } @@ -226,10 +184,10 @@ public function installConfiguration() { $result = true; - foreach (\Shop::getShops(false, null, true) as $shopId) { + foreach (Shop::getShops(false, null, true) as $shopId) { foreach ($this->configurationList as $name => $value) { if (false === Configuration::hasKey($name, null, null, (int) $shopId)) { - $result = $result && (bool) Configuration::updateValue( + $result = $result && Configuration::updateValue( $name, $value, false, @@ -285,7 +243,7 @@ public function disableIncompatibleCountries() $result = true; foreach ($incompatibleCodes as $incompatibleCode) { - $db = \Db::getInstance(); + $db = Db::getInstance(); $result = $result && $db->execute(' DELETE FROM ' . _DB_PREFIX_ . 'module_country @@ -311,7 +269,7 @@ public function disableIncompatibleCurrencies() $result = true; foreach ($incompatibleCodes as $incompatibleCode) { - $db = \Db::getInstance(); + $db = Db::getInstance(); $result = $result && $db->execute(' DELETE FROM ' . _DB_PREFIX_ . 'module_currency @@ -367,7 +325,7 @@ public function uninstallTabs() $uninstallTabCompleted = true; foreach (static::MODULE_ADMIN_CONTROLLERS as $controllerName) { - $id_tab = (int) Tab::getIdFromClassName($controllerName); + $id_tab = Tab::getIdFromClassName($controllerName); $tab = new Tab($id_tab); if (Validate::isLoadedObject($tab)) { $uninstallTabCompleted = $uninstallTabCompleted && $tab->delete(); @@ -459,26 +417,6 @@ public function hookActionObjectProductInCartDeleteAfter() $this->hookActionCartUpdateQuantityBefore(); } - /** - * This hook is called only in PrestaShop 1.6.1 to 1.6.1.24 - * Deprecated since PrestaShop 1.7.0.0 - */ - public function hookActionAfterDeleteProductInCart() - { - if (!$this->merchantIsValid()) { - return; - } - - /** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */ - $shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class); - - if ($shopContext->isShop17()) { - return; - } - - $this->hookActionCartUpdateQuantityBefore(); - } - /** * This hook is called only since PrestaShop 1.7.0.0 */ @@ -507,84 +445,6 @@ public function hookActionCartUpdateQuantityBefore() } } - /** - * This hook is called only in PrestaShop 1.6.1 to 1.6.1.24 - * Deprecated since PrestaShop 1.7.0.0 - */ - public function hookActionBeforeCartUpdateQty() - { - if (!$this->merchantIsValid()) { - return; - } - - /** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */ - $shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class); - - if ($shopContext->isShop17()) { - return; - } - - $this->hookActionCartUpdateQuantityBefore(); - } - - /** - * Add payment option at the checkout in the front office (prestashop 1.6) - */ - public function hookDisplayPayment() - { - if (false === Validate::isLoadedObject($this->context->cart) - || false === $this->checkCurrency($this->context->cart) - || false === $this->merchantIsValid() - ) { - return ''; - } - - /** @var \PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceProvider $fundingSourceProvider */ - $fundingSourceProvider = $this->getService(\PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceProvider::class); - $paymentOptions = []; - - foreach ($fundingSourceProvider->getAll() as $fundingSource) { - $paymentOptions[$fundingSource->name] = $fundingSource->label; - } - - /** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */ - $shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class); - - /** @var \PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository $psCheckoutCartRepository */ - $psCheckoutCartRepository = $this->getService(\PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository::class); - - /** @var PsCheckoutCart|false $psCheckoutCart */ - $psCheckoutCart = $psCheckoutCartRepository->findOneByCartId((int) $this->context->cart->id); - - /** @var \PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration $configurationPayPal */ - $configurationPayPal = $this->getService(\PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration::class); - - $isExpressCheckout = false !== $psCheckoutCart && $psCheckoutCart->isExpressCheckout && $psCheckoutCart->isOrderAvailable(); - - $this->context->smarty->assign([ - 'cancelTranslatedText' => $this->l('Choose another payment method'), - 'is17' => $shopContext->isShop17(), - 'isExpressCheckout' => $isExpressCheckout, - 'modulePath' => $this->getPathUri(), - 'paymentOptions' => $paymentOptions, - 'isHostedFieldsAvailable' => $configurationPayPal->isHostedFieldsEnabled() && in_array($configurationPayPal->getCardHostedFieldsStatus(), ['SUBSCRIBED', 'LIMITED'], true), - 'isOnePageCheckout16' => !$shopContext->isShop17() && (bool) Configuration::get('PS_ORDER_PROCESS_TYPE'), - 'spinnerPath' => $this->getPathUri() . 'views/img/tail-spin.svg', - 'loaderTranslatedText' => $this->l('Please wait, loading additional payment methods.'), - 'paypalLogoPath' => $this->getPathUri() . 'views/img/paypal_express.png', - 'translatedText' => strtr( - $this->l('You have selected your [PAYPAL_ACCOUNT] PayPal account to proceed to the payment.'), - [ - '[PAYPAL_ACCOUNT]' => $this->context->cookie->__get('paypalEmail') ? $this->context->cookie->__get('paypalEmail') : '', - ] - ), - 'shoppingCartWarningPath' => $this->getPathUri() . 'views/img/shopping-cart-warning.svg', - 'warningTranslatedText' => $this->l('Warning'), - ]); - - return $this->display(__FILE__, 'views/templates/hook/displayPayment.tpl'); - } - /** * Add payment option at the checkout in the front office (prestashop 1.7) * @@ -677,7 +537,7 @@ public function hookPaymentOptions(array $params) /** * Hook executed at the order confirmation * - * @param array{cookie: Cookie, cart: Cart, altern: int, order: Order, objOrder: Order} $params + * @param array{cookie: Cookie, cart: Cart, altern: int, order: Order, objOrder?: Order} $params * * @return string */ @@ -718,8 +578,8 @@ public function hookDisplayOrderConfirmation(array $params) */ public function checkCurrency($cart) { - if (isset(static::$currencyIsAllowed[$cart->id_currency])) { - return static::$currencyIsAllowed[$cart->id_currency]; + if (isset($this->currencyIsAllowed[$cart->id_currency])) { + return $this->currencyIsAllowed[$cart->id_currency]; } /** @var \PrestaShop\Module\PrestashopCheckout\Repository\PayPalCodeRepository $codeRepository */ @@ -734,7 +594,7 @@ public function checkCurrency($cart) } if (!$isCurrencySupported) { - static::$currencyIsAllowed[$cart->id_currency] = false; + $this->currencyIsAllowed[$cart->id_currency] = false; return false; } @@ -743,20 +603,20 @@ public function checkCurrency($cart) $currencies_module = $this->getCurrency($cart->id_currency); if (empty($currencies_module)) { - static::$currencyIsAllowed[$cart->id_currency] = false; + $this->currencyIsAllowed[$cart->id_currency] = false; return false; } foreach ($currencies_module as $currency_module) { if ($currency_order->id == $currency_module['id_currency']) { - static::$currencyIsAllowed[$cart->id_currency] = true; + $this->currencyIsAllowed[$cart->id_currency] = true; return true; } } - static::$currencyIsAllowed[$cart->id_currency] = false; + $this->currencyIsAllowed[$cart->id_currency] = false; return false; } @@ -770,16 +630,14 @@ public function hookDisplayAdminAfterHeader() $paypalConfiguration = $this->getService(\PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration::class); /** @var \PrestaShop\Module\PrestashopCheckout\Repository\PsAccountRepository $psAccount */ $psAccount = $this->getService(\PrestaShop\Module\PrestashopCheckout\Repository\PsAccountRepository::class); - /** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */ - $shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class); /** @var \PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\ContextModule $moduleContext */ $moduleContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\ContextModule::class); - $isShop17 = $shopContext->isShop17(); $isFullyOnboarded = $psAccount->onBoardingIsCompleted() && $paypalConfiguration->getMerchantId(); - if ('AdminPayment' === Tools::getValue('controller') && $isShop17) { // Display on PrestaShop 1.7.x.x only + if ('AdminPayment' === Tools::getValue('controller')) { + $moduleManager = \PrestaShop\PrestaShop\Core\Addon\Module\ModuleManagerBuilder::getInstance()->build(); if (in_array($this->getShopDefaultCountryCode(), ['FR', 'IT']) - && Module::isEnabled('ps_checkout') + && $moduleManager->isEnabled('ps_checkout') && Configuration::get('PS_CHECKOUT_PAYPAL_ID_MERCHANT') ) { return false; @@ -799,20 +657,18 @@ public function hookDisplayAdminAfterHeader() $template = 'views/templates/hook/adminAfterHeader/promotionBlock.tpl'; } elseif ('AdminCountries' === Tools::getValue('controller') && $isFullyOnboarded) { $params = [ - 'isShop17' => $isShop17, 'codesType' => 'countries', 'incompatibleCodes' => $paypalConfiguration->getIncompatibleCountryCodes(), 'paypalLink' => 'https://developer.paypal.com/docs/api/reference/country-codes/#', - 'paymentPreferencesLink' => $moduleContext->getGeneratedLink($isShop17 ? 'AdminPaymentPreferences' : 'AdminPayment'), + 'paymentPreferencesLink' => $moduleContext->getGeneratedLink('AdminPayment'), ]; $template = 'views/templates/hook/adminAfterHeader/incompatibleCodes.tpl'; } elseif ('AdminCurrencies' === Tools::getValue('controller') && $isFullyOnboarded) { $params = [ - 'isShop17' => $isShop17, 'codesType' => 'currencies', 'incompatibleCodes' => $paypalConfiguration->getIncompatibleCurrencyCodes(), 'paypalLink' => 'https://developer.paypal.com/docs/api/reference/currency-codes/#', - 'paymentPreferencesLink' => $moduleContext->getGeneratedLink($isShop17 ? 'AdminPaymentPreferences' : 'AdminPayment'), + 'paymentPreferencesLink' => $moduleContext->getGeneratedLink('AdminPayment'), ]; $template = 'views/templates/hook/adminAfterHeader/incompatibleCodes.tpl'; } else { @@ -889,13 +745,13 @@ public function hookActionAdminControllerSetMedia() */ public function merchantIsValid() { - if (static::$merchantIsValid === null) { + if ($this->merchantIsValid === null) { /** @var \PrestaShop\Module\PrestashopCheckout\Validator\MerchantValidator $merchantValidator */ $merchantValidator = $this->getService(\PrestaShop\Module\PrestashopCheckout\Validator\MerchantValidator::class); - static::$merchantIsValid = $merchantValidator->merchantIsValid(); + $this->merchantIsValid = $merchantValidator->merchantIsValid(); } - return static::$merchantIsValid; + return $this->merchantIsValid; } /** @@ -1166,12 +1022,6 @@ public function hookActionFrontControllerSetMedia() */ public function addCheckboxCarrierRestrictionsForModule(array $shopsList = []) { - /** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */ - $shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class); - if (false === $shopContext->isShop17()) { - return true; - } - $shopsList = empty($shopsList) ? Shop::getShops(true, null, true) : $shopsList; $carriersList = Carrier::getCarriers((int) Context::getContext()->language->id, false, false, false, null, Carrier::ALL_CARRIERS); $allCarriers = array_column($carriersList, 'id_reference'); @@ -1201,19 +1051,18 @@ public function addCheckboxCarrierRestrictionsForModule(array $shopsList = []) * Add checkbox country restrictions for a new module. * Associate with all countries allowed in geolocation management * - * @see PaymentModuleCore - * - * @param array $shopsList List of Shop identifier + * @param array $shops List of Shop identifier * * @return bool + * @see PaymentModuleCore */ - public function addCheckboxCountryRestrictionsForModule(array $shopsList = []) + public function addCheckboxCountryRestrictionsForModule(array $shops = []) { - parent::addCheckboxCountryRestrictionsForModule($shopsList); + parent::addCheckboxCountryRestrictionsForModule($shops); // Then add all countries allowed in geolocation management $db = \Db::getInstance(); // Get active shop ids - $shopsList = empty($shopsList) ? Shop::getShops(true, null, true) : $shopsList; + $shops = empty($shops) ? Shop::getShops(true, null, true) : $shops; // Get countries /** @var array $countries */ $countries = $db->executeS('SELECT `id_country`, `iso_code` FROM `' . _DB_PREFIX_ . 'country`'); @@ -1223,7 +1072,7 @@ public function addCheckboxCountryRestrictionsForModule(array $shopsList = []) } $dataToInsert = []; - foreach ($shopsList as $idShop) { + foreach ($shops as $idShop) { // Get countries allowed in geolocation management for this shop $activeCountries = \Configuration::get( 'PS_ALLOWED_COUNTRIES', @@ -1402,31 +1251,6 @@ public function hookActionObjectShopAddAfter(array $params) } } - /** - * This hook called on BO Order view page before 1.7.7 - * - * @param array{cookie: Cookie, cart: Cart, altern: int, id_order: int} $params - * - * @return string - */ - public function hookDisplayAdminOrderLeft(array $params) - { - $order = new Order((int) $params['id_order']); - - if ($order->module !== $this->name) { - return ''; - } - - $this->context->smarty->assign([ - 'moduleLogoUri' => $this->getPathUri() . 'logo.png', - 'moduleName' => $this->displayName, - 'orderPrestaShopId' => $order->id, - 'orderPayPalBaseUrl' => $this->context->link->getAdminLink('AdminAjaxPrestashopCheckout'), - ]); - - return $this->display(__FILE__, 'views/templates/hook/displayAdminOrderLeft.tpl'); - } - /** * This hook called on BO Order view page after 1.7.7 * @@ -1466,9 +1290,6 @@ public function hookDisplayPaymentTop() return ''; } - /** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */ - $shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class); - /** @var \PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository $psCheckoutCartRepository */ $psCheckoutCartRepository = $this->getService(\PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository::class); @@ -1479,9 +1300,7 @@ public function hookDisplayPaymentTop() $this->context->smarty->assign([ 'cancelTranslatedText' => $this->l('Choose another payment method'), - 'is17' => $shopContext->isShop17(), 'isExpressCheckout' => $isExpressCheckout, - 'isOnePageCheckout16' => !$shopContext->isShop17() && (bool) Configuration::get('PS_ORDER_PROCESS_TYPE'), 'spinnerPath' => $this->getPathUri() . 'views/img/tail-spin.svg', 'loaderTranslatedText' => $this->l('Please wait, loading additional payment methods.'), 'paypalLogoPath' => $this->getPathUri() . 'views/img/paypal_express.png', @@ -1560,35 +1379,7 @@ public function hookDisplayPaymentByBinaries(array $params) */ private function getCheckoutPageUrl() { - /** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */ - $shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class); - - if ($shopContext->isShop17()) { - return $this->context->link->getPageLink( - 'order', - true, - (int) $this->context->language->id - ); - } - - // PrestaShop 1.6 legacy native one page checkout - if (1 === (int) Configuration::get('PS_ORDER_PROCESS_TYPE')) { - return $this->context->link->getPageLink( - 'order-opc', - true, - (int) $this->context->language->id - ); - } - - // PrestaShop 1.6 standard checkout - return $this->context->link->getPageLink( - 'order', - true, - (int) $this->context->language->id, - [ - 'step' => 1, - ] - ); + return $this->context->link->getPageLink('order'); } /** @@ -1614,7 +1405,7 @@ public function hookActionObjectOrderPaymentUpdateAfter(array $params) /** * When an OrderPayment is created or updated we should update fields payment_method and transaction_id * - * @param array{cookie: Cookie, cart: Cart, altern: int, object: OrderPayment} $params + * @param array{cookie: Cookie, cart: Cart, altern: int, object?: OrderPayment} $params * * @return void */ @@ -1702,7 +1493,7 @@ private function getShopDefaultCountryCode() { $defaultCountry = ''; - if (empty($defaultCountry) && Configuration::hasKey('PS_COUNTRY_DEFAULT')) { + if (Configuration::hasKey('PS_COUNTRY_DEFAULT')) { $defaultCountry = (new Country((int) Configuration::get('PS_COUNTRY_DEFAULT')))->iso_code; } @@ -1728,7 +1519,7 @@ public function hookActionObjectShopDeleteAfter(array $params) /** * Display payment status on order confirmation page * - * @param array{cookie: Cookie, cart: Cart, altern: int, order: Order, objOrder: Order} $params + * @param array{cookie: Cookie, cart: Cart, altern: int, order: Order, objOrder?: Order} $params * * @return string */ diff --git a/src/Adapter/LanguageAdapter.php b/src/Adapter/LanguageAdapter.php index 511295939..4d4501d02 100644 --- a/src/Adapter/LanguageAdapter.php +++ b/src/Adapter/LanguageAdapter.php @@ -20,6 +20,7 @@ namespace PrestaShop\Module\PrestashopCheckout\Adapter; +use Language; use PrestaShop\Module\PrestashopCheckout\ShopContext; /** @@ -27,19 +28,6 @@ */ class LanguageAdapter { - /** - * @var ShopContext - */ - private $shopContext; - - /** - * @param ShopContext $shopContext - */ - public function __construct(ShopContext $shopContext) - { - $this->shopContext = $shopContext; - } - /** * Adapter for getLanguage from prestashop language class * Add locale key to the returned array on 1.6 @@ -50,15 +38,9 @@ public function __construct(ShopContext $shopContext) */ public function getLanguage($idLang) { - $language = \Language::getLanguage($idLang); + $language = Language::getLanguage($idLang); - if (false === $this->shopContext->isShop17()) { - $locale = explode('-', $language['language_code']); - $locale[1] = strtoupper($locale[1]); - $language['locale'] = implode('_', $locale); - } else { - $language['locale'] = str_replace('-', '_', $language['locale']); - } + $language['locale'] = str_replace('-', '_', $language['locale']); return $language; } diff --git a/src/Adapter/LinkAdapter.php b/src/Adapter/LinkAdapter.php index f95b435d2..9bcefb5fc 100644 --- a/src/Adapter/LinkAdapter.php +++ b/src/Adapter/LinkAdapter.php @@ -58,34 +58,19 @@ public function __construct(\Link $link = null) public function getAdminLink($controller, $withToken = true, $sfRouteParams = [], $params = []) { $shop = \Context::getContext()->shop; - /** @var \Ps_checkout $module */ - $module = \Module::getInstanceByName('ps_checkout'); - /** @var ShopContext $shopContext */ - $shopContext = $module->getService(ShopContext::class); - if ($shopContext->isShop17()) { - $adminLink = $this->link->getAdminLink($controller, $withToken, $sfRouteParams, $params); + $adminLink = $this->link->getAdminLink($controller, $withToken, $sfRouteParams, $params); - if ($shop->virtual_uri !== '') { - $adminLink = str_replace($shop->physical_uri . $shop->virtual_uri, $shop->physical_uri, $adminLink); - } - - // We have problems with links in our zoid application, since some links generated don't have domain they redirect to CDN domain - // Routes that use new symfony router are returned without the domain - if (strpos($adminLink, 'http') !== 0) { - return \Tools::getShopDomainSsl(true) . $adminLink; - } - - return $adminLink; + if ($shop->virtual_uri !== '') { + $adminLink = str_replace($shop->physical_uri . $shop->virtual_uri, $shop->physical_uri, $adminLink); } - $paramsAsString = ''; - foreach ($params as $key => $value) { - $paramsAsString .= "&$key=$value"; + // We have problems with links in our zoid application, since some links generated don't have domain they redirect to CDN domain + // Routes that use new symfony router are returned without the domain + if (strpos($adminLink, 'http') !== 0) { + return \Tools::getShopDomainSsl(true) . $adminLink; } - $link = \Tools::getShopDomainSsl(true) . __PS_BASE_URI__ . basename(_PS_ADMIN_DIR_) . '/' . $this->link->getAdminLink($controller, $withToken) . $paramsAsString; - - return $shop->virtual_uri !== '' ? str_replace($shop->physical_uri . $shop->virtual_uri, $shop->physical_uri, $link) : $link; + return $adminLink; } } diff --git a/src/Builder/Configuration/CheckoutClientConfigurationBuilder.php b/src/Builder/Configuration/CheckoutClientConfigurationBuilder.php index 84bd3d29e..c79013860 100755 --- a/src/Builder/Configuration/CheckoutClientConfigurationBuilder.php +++ b/src/Builder/Configuration/CheckoutClientConfigurationBuilder.php @@ -38,48 +38,15 @@ class CheckoutClientConfigurationBuilder implements HttpClientConfigurationBuild { const TIMEOUT = 10; - /** @var Env */ - private $env; - - /** @var Router */ - private $router; - - /** @var ShopContext */ - private $shopContext; - - /** @var PsAccountRepository */ - private $psAccountRepository; - - /** - * @var PrestaShopContext - */ - private $prestaShopContext; - /** - * @var LoggerConfiguration - */ - private $loggerConfiguration; - /** - * @var LoggerInterface - */ - private $logger; - public function __construct( - Env $env, - Router $router, - ShopContext $shopContext, - PsAccountRepository $psAccountRepository, - PrestaShopContext $prestaShopContext, - LoggerConfiguration $loggerConfiguration, - LoggerInterface $logger - ) { - $this->env = $env; - $this->router = $router; - $this->shopContext = $shopContext; - $this->psAccountRepository = $psAccountRepository; - $this->prestaShopContext = $prestaShopContext; - $this->loggerConfiguration = $loggerConfiguration; - $this->logger = $logger; - } + private Env $env, + private Router $router, + private ShopContext $shopContext, + private PsAccountRepository $psAccountRepository, + private PrestaShopContext $prestaShopContext, + private LoggerConfiguration $loggerConfiguration, + private LoggerInterface $psCheckoutLogger + ) {} /** * @return array @@ -110,7 +77,8 @@ public function build() && class_exists(LogMiddleware::class) ) { $handlerStack = HandlerStack::create(); - $handlerStack->push(new LogMiddleware($this->logger)); + $logMiddleWare = new LogMiddleware($this->psCheckoutLogger); + $handlerStack->push($logMiddleWare); $configuration['handler'] = $handlerStack; } elseif ( defined('\GuzzleHttp\ClientInterface::VERSION') @@ -119,10 +87,8 @@ public function build() && class_exists(Formatter::class) ) { $emitter = new Emitter(); - $emitter->attach(new LogSubscriber( - $this->logger, - Formatter::DEBUG - )); + $logSubscriber = new LogSubscriber($this->psCheckoutLogger, Formatter::DEBUG); + $emitter->attach($logSubscriber); $configuration['emitter'] = $emitter; } diff --git a/src/Builder/Configuration/MaaslandHttpClientConfigurationBuilder.php b/src/Builder/Configuration/MaaslandHttpClientConfigurationBuilder.php index 2787768ba..2c7dbd4a6 100644 --- a/src/Builder/Configuration/MaaslandHttpClientConfigurationBuilder.php +++ b/src/Builder/Configuration/MaaslandHttpClientConfigurationBuilder.php @@ -38,58 +38,15 @@ class MaaslandHttpClientConfigurationBuilder implements HttpClientConfigurationB { const TIMEOUT = 10; - /** - * @var Env - */ - private $paymentEnv; - - /** - * @var Router - */ - private $router; - - /** - * @var ShopContext - */ - private $shopContext; - - /** - * @var PsAccountRepository - */ - private $psAccountRepository; - - /** - * @var PrestaShopContext - */ - private $prestaShopContext; - - /** - * @var LoggerConfiguration - */ - private $loggerConfiguration; - - /** - * @var LoggerInterface - */ - private $logger; - public function __construct( - Env $paymentEnv, - Router $router, - ShopContext $shopContext, - PsAccountRepository $psAccountRepository, - PrestaShopContext $prestaShopContext, - LoggerConfiguration $loggerConfiguration, - LoggerInterface $logger - ) { - $this->paymentEnv = $paymentEnv; - $this->router = $router; - $this->shopContext = $shopContext; - $this->psAccountRepository = $psAccountRepository; - $this->prestaShopContext = $prestaShopContext; - $this->loggerConfiguration = $loggerConfiguration; - $this->logger = $logger; - } + private Env $paymentEnv, + private Router $router, + private ShopContext $shopContext, + private PsAccountRepository $psAccountRepository, + private PrestaShopContext $prestaShopContext, + private LoggerConfiguration $loggerConfiguration, + private LoggerInterface $psCheckoutLogger + ) {} /** * @return array @@ -119,7 +76,8 @@ public function build() && class_exists(LogMiddleware::class) ) { $handlerStack = HandlerStack::create(); - $handlerStack->push(new LogMiddleware($this->logger)); + $logMiddleware = new LogMiddleware($this->psCheckoutLogger); + $handlerStack->push($logMiddleware); $configuration['handler'] = $handlerStack; } elseif ( $this->loggerConfiguration->isHttpEnabled() @@ -129,10 +87,11 @@ public function build() && class_exists(Formatter::class) ) { $emitter = new Emitter(); - $emitter->attach(new LogSubscriber( - $this->logger, + $logSubscriber = new LogSubscriber( + $this->psCheckoutLogger, Formatter::DEBUG - )); + ); + $emitter->attach($logSubscriber); $configuration['emitter'] = $emitter; } diff --git a/src/Builder/Payload/OrderPayloadBuilder.php b/src/Builder/Payload/OrderPayloadBuilder.php index 7dfb6f8b5..ed78a8ddd 100644 --- a/src/Builder/Payload/OrderPayloadBuilder.php +++ b/src/Builder/Payload/OrderPayloadBuilder.php @@ -60,11 +60,6 @@ class OrderPayloadBuilder extends Builder implements PayloadBuilderInterface */ private $paypalOrderId; - /** - * @var bool - */ - private $isPatch; - /** * @var bool */ @@ -137,12 +132,10 @@ public function setVault($vault) /** * @param array $cart - * @param bool $isPatch */ - public function __construct(array $cart, $isPatch = false) + public function __construct(array $cart) { $this->cart = $cart; - $this->isPatch = $isPatch; parent::__construct(); } diff --git a/src/Cart/ValueObject/CartId.php b/src/Cart/ValueObject/CartId.php index 4b49a7377..a7f9152f9 100644 --- a/src/Cart/ValueObject/CartId.php +++ b/src/Cart/ValueObject/CartId.php @@ -50,7 +50,7 @@ public function getValue() } /** - * @param int $cartId + * @param int|mixed $cartId * * @throws CartException */ diff --git a/src/Checkout/CheckoutChecker.php b/src/Checkout/CheckoutChecker.php index 60c292ce4..940c58dfa 100644 --- a/src/Checkout/CheckoutChecker.php +++ b/src/Checkout/CheckoutChecker.php @@ -30,22 +30,12 @@ class CheckoutChecker { - /** - * @var LoggerInterface - */ - private $logger; - - /** - * @param LoggerInterface $logger - */ - public function __construct(LoggerInterface $logger) - { - $this->logger = $logger; - } + public function __construct(private LoggerInterface $psCheckoutLogger) + {} /** * @param int $cartId - * @param array{id: string, status: string, intent: string, payment_source: array, purchase_units: array} $orderPayPal + * @param array{id: string, status: string, intent: string, payment_source?: array, purchase_units?: array} $orderPayPal * * @return void * @@ -54,7 +44,7 @@ public function __construct(LoggerInterface $logger) public function continueWithAuthorization($cartId, $orderPayPal) { if ($orderPayPal['status'] === 'COMPLETED') { - throw new PsCheckoutException(sprintf('PayPal Order %s is already captured', $orderPayPal['id'])); + throw new PsCheckoutException(sprintf('PayPal Order %s is already captured', $orderPayPal['id']), PsCheckoutException::PAYPAL_ORDER_ALREADY_CAPTURED); } $paymentSource = isset($orderPayPal['payment_source']) ? key($orderPayPal['payment_source']) : ''; @@ -62,7 +52,7 @@ public function continueWithAuthorization($cartId, $orderPayPal) if (in_array($paymentSource, ['google_pay', 'card'], true)) { $card3DSecure = (new Card3DSecure())->continueWithAuthorization($orderPayPal); - $this->logger->info( + $this->psCheckoutLogger->info( '3D Secure authentication result', [ 'authentication_result' => isset($orderPayPal['payment_source'][$paymentSource]['authentication_result']) ? $orderPayPal['payment_source'][$paymentSource]['authentication_result'] : null, @@ -110,8 +100,8 @@ public function continueWithAuthorization($cartId, $orderPayPal) } if ($cart->isAllProductsInStock() !== true || - (method_exists($cart, 'checkAllProductsAreStillAvailableInThisState') && $cart->checkAllProductsAreStillAvailableInThisState() !== true) || - (method_exists($cart, 'checkAllProductsHaveMinimalQuantities') && $cart->checkAllProductsHaveMinimalQuantities() !== true) + ($cart->checkAllProductsAreStillAvailableInThisState() !== true) || + ($cart->checkAllProductsHaveMinimalQuantities() !== true) ) { throw new PsCheckoutException(sprintf('Cart with id %s contains products unavailable. Cannot capture the order.', var_export($cart->id, true)), PsCheckoutException::CART_PRODUCT_UNAVAILABLE); } diff --git a/src/Checkout/CommandHandler/CancelCheckoutCommandHandler.php b/src/Checkout/CommandHandler/CancelCheckoutCommandHandler.php index 36610d03a..58f5abbf9 100644 --- a/src/Checkout/CommandHandler/CancelCheckoutCommandHandler.php +++ b/src/Checkout/CommandHandler/CancelCheckoutCommandHandler.php @@ -29,14 +29,11 @@ class CancelCheckoutCommandHandler { - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; + public function __construct(private PsCheckoutCartRepository $psCheckoutCartRepository) + {} - public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) - { - $this->psCheckoutCartRepository = $psCheckoutCartRepository; + public function __invoke(CancelCheckoutCommand $command) { + $this->handle($command); } /** diff --git a/src/Checkout/CommandHandler/SaveCheckoutCommandHandler.php b/src/Checkout/CommandHandler/SaveCheckoutCommandHandler.php index 3855f1bbb..5e572b1e4 100644 --- a/src/Checkout/CommandHandler/SaveCheckoutCommandHandler.php +++ b/src/Checkout/CommandHandler/SaveCheckoutCommandHandler.php @@ -28,15 +28,8 @@ class SaveCheckoutCommandHandler { - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; - - public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) - { - $this->psCheckoutCartRepository = $psCheckoutCartRepository; - } + public function __construct(private PsCheckoutCartRepository $psCheckoutCartRepository) + {} /** * @param SaveCheckoutCommand $command diff --git a/src/Checkout/CommandHandler/SavePayPalOrderStatusCommandHandler.php b/src/Checkout/CommandHandler/SavePayPalOrderStatusCommandHandler.php index fff4db8e4..329b0aa14 100644 --- a/src/Checkout/CommandHandler/SavePayPalOrderStatusCommandHandler.php +++ b/src/Checkout/CommandHandler/SavePayPalOrderStatusCommandHandler.php @@ -30,19 +30,14 @@ class SavePayPalOrderStatusCommandHandler { - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; - /** - * @var PayPalOrderRepository - */ - private $payPalOrderRepository; + public function __construct( + private PsCheckoutCartRepository $psCheckoutCartRepository, + private PayPalOrderRepository $payPalOrderRepository + ) {} - public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository, PayPalOrderRepository $payPalOrderRepository) + public function __invoke(SavePayPalOrderStatusCommand $command) { - $this->psCheckoutCartRepository = $psCheckoutCartRepository; - $this->payPalOrderRepository = $payPalOrderRepository; + $this->handle($command); } /** diff --git a/src/Checkout/CommandHandler/UpdatePaymentMethodSelectedCommandHandler.php b/src/Checkout/CommandHandler/UpdatePaymentMethodSelectedCommandHandler.php index 09eb8b08f..948be3285 100644 --- a/src/Checkout/CommandHandler/UpdatePaymentMethodSelectedCommandHandler.php +++ b/src/Checkout/CommandHandler/UpdatePaymentMethodSelectedCommandHandler.php @@ -29,14 +29,12 @@ class UpdatePaymentMethodSelectedCommandHandler { - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; + public function __construct(private PsCheckoutCartRepository $psCheckoutCartRepository) + {} - public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) + public function __invoke(UpdatePaymentMethodSelectedCommand $command) { - $this->psCheckoutCartRepository = $psCheckoutCartRepository; + $this->handle($command); } /** diff --git a/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php b/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php index b393f1907..610458b1d 100644 --- a/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php +++ b/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php @@ -23,51 +23,36 @@ use PrestaShop\Module\PrestashopCheckout\Cart\Exception\CartException; use PrestaShop\Module\PrestashopCheckout\Checkout\CheckoutChecker; use PrestaShop\Module\PrestashopCheckout\Checkout\Command\UpdatePaymentMethodSelectedCommand; +use PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\UpdatePaymentMethodSelectedCommandHandler; use PrestaShop\Module\PrestashopCheckout\Checkout\Event\CheckoutCompletedEvent; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Exception\HttpTimeoutException; use PrestaShop\Module\PrestashopCheckout\Exception\PayPalException; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; use PrestaShop\Module\PrestashopCheckout\Order\Command\CreateOrderCommand; +use PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\CreateOrderCommandHandler; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CapturePayPalOrderCommand; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CapturePayPalOrderCommandHandler; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Exception\PayPalOrderException; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQueryResult; use PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository; use PrestaShopDatabaseException; use PrestaShopException; -use Ps_checkout; use PsCheckoutCart; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Validate; class CheckoutEventSubscriber implements EventSubscriberInterface { - /** - * @var Ps_checkout - */ - private $module; - - /** - * @var CommandBusInterface - */ - private $commandBus; - - /** - * @var CheckoutChecker - */ - private $checkoutChecker; - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; - - public function __construct(CheckoutChecker $checkoutChecker, CommandBusInterface $commandBus, PsCheckoutCartRepository $psCheckoutCartRepository) - { - $this->checkoutChecker = $checkoutChecker; - $this->commandBus = $commandBus; - $this->psCheckoutCartRepository = $psCheckoutCartRepository; - } + public function __construct( + private QueryBusInterface $queryBus, + private CheckoutChecker $checkoutChecker, + private PsCheckoutCartRepository $psCheckoutCartRepository, + private UpdatePaymentMethodSelectedCommandHandler $updatePaymentMethodSelectedCommandHandler, + private CreateOrderCommandHandler $createOrderCommandHandler, + private CapturePayPalOrderCommandHandler $capturePayPalOrderCommandHandler + ) {} /** * {@inheritdoc} @@ -97,7 +82,7 @@ public static function getSubscribedEvents() */ public function updatePaymentMethodSelected(CheckoutCompletedEvent $event) { - $this->commandBus->handle(new UpdatePaymentMethodSelectedCommand( + $this->updatePaymentMethodSelectedCommandHandler->handle(new UpdatePaymentMethodSelectedCommand( $event->getCartId()->getValue(), $event->getPayPalOrderId()->getValue(), $event->getFundingSource(), @@ -118,36 +103,46 @@ public function updatePaymentMethodSelected(CheckoutCompletedEvent $event) * @throws PrestaShopDatabaseException * @throws PrestaShopException * @throws PsCheckoutException + * @throws HttpTimeoutException */ public function proceedToPayment(CheckoutCompletedEvent $event) { + $payPalOrderId = $event->getPayPalOrderId()->getValue(); + + /** @var GetPayPalOrderForCheckoutCompletedQueryResult $getPayPalOrderForCheckoutCompletedQueryResult */ + $getPayPalOrderForCheckoutCompletedQueryResult = $this->queryBus->handle(new GetPayPalOrderForCheckoutCompletedQuery( + $payPalOrderId + )); + + $payPalOrder = $getPayPalOrderForCheckoutCompletedQueryResult->getPayPalOrder(); + try { - /** @var GetPayPalOrderForCheckoutCompletedQueryResult $getPayPalOrderForCheckoutCompletedQueryResult */ - $getPayPalOrderForCheckoutCompletedQueryResult = $this->commandBus->handle(new GetPayPalOrderForCheckoutCompletedQuery( - $event->getPayPalOrderId()->getValue() - )); - } catch (HttpTimeoutException $exception) { - $this->commandBus->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue())); - - return; - } + $this->checkoutChecker->continueWithAuthorization($event->getCartId()->getValue(), $payPalOrder); + } catch (PsCheckoutException $exception) { + if ($exception->getCode() === PsCheckoutException::PAYPAL_ORDER_ALREADY_CAPTURED) { + $capture = isset($payPalOrder['purchase_units'][0]['payments']['captures'][0]) ? $payPalOrder['purchase_units'][0]['payments']['captures'][0] : null; + $this->createOrderCommandHandler->handle(new CreateOrderCommand($payPalOrderId, $capture)); - $this->checkoutChecker->continueWithAuthorization($event->getCartId()->getValue(), $getPayPalOrderForCheckoutCompletedQueryResult->getPayPalOrder()); + return; + } else { + throw $exception; + } + } try { - $this->commandBus->handle( + $this->capturePayPalOrderCommandHandler->handle( new CapturePayPalOrderCommand( - $event->getPayPalOrderId()->getValue(), + $payPalOrderId, $event->getFundingSource() ) ); } catch (PayPalException $exception) { if ($exception->getCode() === PayPalException::ORDER_NOT_APPROVED) { - $this->commandBus->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue())); + $this->createOrderCommandHandler->handle(new CreateOrderCommand($payPalOrderId)); return; } elseif ($exception->getCode() === PayPalException::RESOURCE_NOT_FOUND) { - $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($event->getPayPalOrderId()->getValue()); + $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($payPalOrderId); if (Validate::isLoadedObject($psCheckoutCart)) { $psCheckoutCart->paypal_status = PsCheckoutCart::STATUS_CANCELED; @@ -156,14 +151,22 @@ public function proceedToPayment(CheckoutCompletedEvent $event) throw $exception; } elseif ($exception->getCode() === PayPalException::ORDER_ALREADY_CAPTURED) { + if (isset($payPalOrder['purchase_units'][0]['payments']['captures'][0])) { + $capture = $payPalOrder['purchase_units'][0]['payments']['captures'][0]; + } else { + $payPalOrderQuery = new GetPayPalOrderForCheckoutCompletedQuery($payPalOrderId); + + /** @var GetPayPalOrderForCheckoutCompletedQueryResult $getPayPalOrderForCheckoutCompletedQueryResult */ + $getPayPalOrderForCheckoutCompletedQueryResult = $this->queryBus->handle($payPalOrderQuery); + $payPalOrder = $getPayPalOrderForCheckoutCompletedQueryResult->getPayPalOrder(); + $capture = isset($payPalOrder['purchase_units'][0]['payments']['captures'][0]) ? $payPalOrder['purchase_units'][0]['payments']['captures'][0] : null; + } + $this->createOrderCommandHandler->handle(new CreateOrderCommand($payPalOrderId, $capture)); + return; } else { throw $exception; } - } catch (HttpTimeoutException $exception) { - $this->commandBus->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue())); - - return; } } } diff --git a/src/CommandBus/TacticianCommandBusAdapter.php b/src/CommandBus/CommandBusAdapter.php similarity index 78% rename from src/CommandBus/TacticianCommandBusAdapter.php rename to src/CommandBus/CommandBusAdapter.php index d25a7cae7..36fc88619 100644 --- a/src/CommandBus/TacticianCommandBusAdapter.php +++ b/src/CommandBus/CommandBusAdapter.php @@ -20,22 +20,12 @@ namespace PrestaShop\Module\PrestashopCheckout\CommandBus; -use League\Tactician\CommandBus; +use PrestaShopBundle\CommandBus\MessengerCommandBus; -class TacticianCommandBusAdapter implements CommandBusInterface +class CommandBusAdapter implements CommandBusInterface { - /** - * @var CommandBus - */ - private $bus; - - /** - * @param CommandBus $bus - */ - public function __construct(CommandBus $bus) - { - $this->bus = $bus; - } + public function __construct(private MessengerCommandBus $bus) + {} /** * {@inheritdoc} diff --git a/src/CommandBus/CommandBusFactory.php b/src/CommandBus/CommandBusFactory.php new file mode 100644 index 000000000..ad630bebd --- /dev/null +++ b/src/CommandBus/CommandBusFactory.php @@ -0,0 +1,48 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 + */ + +namespace PrestaShop\Module\PrestashopCheckout\CommandBus; + +use PrestaShopBundle\CommandBus\MessengerCommandBus; +use Psr\Log\LoggerInterface; +use Symfony\Component\Messenger\Handler\HandlersLocator; +use Symfony\Component\Messenger\MessageBus; +use Symfony\Component\Messenger\Middleware\HandleMessageMiddleware; + +class CommandBusFactory +{ + public function __construct(private LoggerInterface $logger, private array $commandToHandlerMap) + {} + + public function create(): CommandBusAdapter + { + $handlerMiddleWare = new HandleMessageMiddleware( + new HandlersLocator($this->commandToHandlerMap), + ); + + $handlerMiddleWare->setLogger($this->logger); + + $messengerBus = new MessengerCommandBus( + new MessageBus([$handlerMiddleWare]) + ); + + return new CommandBusAdapter($messengerBus); + } +} diff --git a/views/templates/hook/displayAdminOrderLeft.tpl b/src/CommandBus/QueryBusAdapter.php similarity index 58% rename from views/templates/hook/displayAdminOrderLeft.tpl rename to src/CommandBus/QueryBusAdapter.php index 4995ebe76..7c37c7ff6 100644 --- a/views/templates/hook/displayAdminOrderLeft.tpl +++ b/src/CommandBus/QueryBusAdapter.php @@ -1,4 +1,5 @@ -{** + * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 - *} + */ -
-
- {$moduleName|escape:'html':'UTF-8'} - {$moduleName|escape:'html':'UTF-8'} -
-
-
-
-
-
- -
-
+namespace PrestaShop\Module\PrestashopCheckout\CommandBus; -{include file='./partials/adminOrderView.tpl' legacy=true orderPrestaShopId=$orderPrestaShopId orderPayPalBaseUrl=$orderPayPalBaseUrl} +use PrestaShopBundle\CommandBus\MessengerCommandBus; + +class QueryBusAdapter implements QueryBusInterface +{ + public function __construct(private MessengerCommandBus $bus) + {} + + /** + * {@inheritdoc} + */ + public function handle($query) + { + return $this->bus->handle($query); + } +} diff --git a/src/CommandBus/QueryBusFactory.php b/src/CommandBus/QueryBusFactory.php new file mode 100644 index 000000000..3d18ba565 --- /dev/null +++ b/src/CommandBus/QueryBusFactory.php @@ -0,0 +1,48 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 + */ + +namespace PrestaShop\Module\PrestashopCheckout\CommandBus; + +use PrestaShopBundle\CommandBus\MessengerCommandBus; +use Psr\Log\LoggerInterface; +use Symfony\Component\Messenger\Handler\HandlersLocator; +use Symfony\Component\Messenger\MessageBus; +use Symfony\Component\Messenger\Middleware\HandleMessageMiddleware; + +class QueryBusFactory +{ + public function __construct(private LoggerInterface $logger, private array $queryToHandlerMap) + {} + + public function create(): QueryBusAdapter + { + $handlerMiddleWare = new HandleMessageMiddleware( + new HandlersLocator($this->queryToHandlerMap), + ); + + $handlerMiddleWare->setLogger($this->logger); + + $messengerBus = new MessengerCommandBus( + new MessageBus([$handlerMiddleWare]) + ); + + return new QueryBusAdapter($messengerBus); + } +} diff --git a/src/CommandBus/QueryBusInterface.php b/src/CommandBus/QueryBusInterface.php new file mode 100644 index 000000000..bbf4e046f --- /dev/null +++ b/src/CommandBus/QueryBusInterface.php @@ -0,0 +1,34 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 + */ + +namespace PrestaShop\Module\PrestashopCheckout\CommandBus; + +/** + * Interface QueryBusInterface defines contract for Query bus. + */ +interface QueryBusInterface +{ + /** + * Handle query. + * + * @param object $query + */ + public function handle($query); +} diff --git a/src/CommandBus/TacticianCommandBusFactory.php b/src/CommandBus/TacticianCommandBusFactory.php deleted file mode 100644 index 5e137409d..000000000 --- a/src/CommandBus/TacticianCommandBusFactory.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 - */ - -namespace PrestaShop\Module\PrestashopCheckout\CommandBus; - -use League\Tactician\CommandBus; -use League\Tactician\Handler\CommandHandlerMiddleware; -use League\Tactician\Handler\CommandNameExtractor\ClassNameExtractor; -use League\Tactician\Handler\MethodNameInflector\HandleInflector; -use League\Tactician\Logger\Formatter\ClassPropertiesFormatter; -use League\Tactician\Logger\LoggerMiddleware; -use Ps_checkout; -use Psr\Log\LoggerInterface; - -class TacticianCommandBusFactory -{ - /** - * @var Ps_checkout - */ - private $module; - - /** - * @var array - */ - private $commandToHandlerMap; - - /** - * @var LoggerInterface - */ - private $logger; - - /** - * @param Ps_checkout $module - * @param LoggerInterface $logger - * @param array $commandToHandlerMap - */ - public function __construct(Ps_checkout $module, LoggerInterface $logger, array $commandToHandlerMap) - { - $this->module = $module; - $this->logger = $logger; - $this->commandToHandlerMap = $commandToHandlerMap; - } - - /** - * @return CommandBus - */ - public function create() - { - return new CommandBus([ - new LoggerMiddleware( - new ClassPropertiesFormatter(), - $this->logger - ), - new CommandHandlerMiddleware( - new ClassNameExtractor(), - new TacticianContainerLocator( - $this->module, - $this->commandToHandlerMap - ), - new HandleInflector() - ), - ]); - } -} diff --git a/src/CommandBus/TacticianContainerLocator.php b/src/CommandBus/TacticianContainerLocator.php deleted file mode 100644 index bc78ede07..000000000 --- a/src/CommandBus/TacticianContainerLocator.php +++ /dev/null @@ -1,97 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 - */ - -namespace PrestaShop\Module\PrestashopCheckout\CommandBus; - -use League\Tactician\Exception\MissingHandlerException; -use League\Tactician\Handler\Locator\HandlerLocator; -use Ps_checkout; - -class TacticianContainerLocator implements HandlerLocator -{ - /** - * @var Ps_checkout - */ - protected $module; - - /** - * @var array - */ - protected $commandNameToHandlerMap = []; - - /** - * @param Ps_checkout $module - * @param array $commandNameToHandlerMap - */ - public function __construct(Ps_checkout $module, array $commandNameToHandlerMap = []) - { - $this->module = $module; - $this->addHandlers($commandNameToHandlerMap); - } - - /** - * Bind a handler instance to receive all commands with a certain class - * - * @param string $handler Handler to receive class - * @param string $commandName Can be a class name or name of a NamedCommand - */ - public function addHandler($handler, $commandName) - { - $this->commandNameToHandlerMap[$commandName] = $handler; - } - - /** - * Allows you to add multiple handlers at once. - * - * The map should be an array in the format of: - * [ - * 'AddTaskCommand' => 'AddTaskCommandHandler', - * 'CompleteTaskCommand' => 'CompleteTaskCommandHandler', - * ] - * - * @param array $commandNameToHandlerMap - */ - public function addHandlers(array $commandNameToHandlerMap) - { - foreach ($commandNameToHandlerMap as $commandName => $handler) { - $this->addHandler($handler, $commandName); - } - } - - /** - * Retrieves the handler for a specified command - * - * @param string $commandName - * - * @return object - * - * @throws MissingHandlerException - */ - public function getHandlerForCommand($commandName) - { - if (!isset($this->commandNameToHandlerMap[$commandName])) { - throw MissingHandlerException::forCommand($commandName); - } - - $serviceId = $this->commandNameToHandlerMap[$commandName]; - - return $this->module->getService($serviceId); - } -} diff --git a/src/Configuration/PrestaShopConfiguration.php b/src/Configuration/PrestaShopConfiguration.php index e07359ca8..ca61a6621 100644 --- a/src/Configuration/PrestaShopConfiguration.php +++ b/src/Configuration/PrestaShopConfiguration.php @@ -28,18 +28,8 @@ */ class PrestaShopConfiguration { - /** - * @var PrestaShopConfigurationOptionsResolver - */ - private $optionsResolver; - - /** - * @param PrestaShopConfigurationOptionsResolver $optionsResolver - */ - public function __construct(PrestaShopConfigurationOptionsResolver $optionsResolver) - { - $this->optionsResolver = $optionsResolver; - } + public function __construct(private PrestaShopConfigurationOptionsResolver $optionsResolver) + {} /** * @param string $key diff --git a/src/Configuration/ToggleShopConfigurationCommandHandler.php b/src/Configuration/ToggleShopConfigurationCommandHandler.php index 9756cfd3f..07c11791b 100644 --- a/src/Configuration/ToggleShopConfigurationCommandHandler.php +++ b/src/Configuration/ToggleShopConfigurationCommandHandler.php @@ -34,6 +34,10 @@ public function __construct() $this->db = Db::getInstance(); } + public function __invoke(ToggleShopConfigurationCommand $command) { + $this->handle($command); + } + /** * @param ToggleShopConfigurationCommand $command */ diff --git a/src/Context/ContextStateManager.php b/src/Context/ContextStateManager.php index f2b542578..1ffe0ae51 100644 --- a/src/Context/ContextStateManager.php +++ b/src/Context/ContextStateManager.php @@ -132,11 +132,7 @@ public function setLanguage(Language $language = null) $this->saveContextField('language'); $this->getContext()->language = $language; - if ($language - && method_exists($this->getContext(), 'getTranslator') - && property_exists($language, 'locale')) { - $this->getContext()->getTranslator()->setLocale($language->locale); - } + $this->getContext()->getTranslator()->setLocale($language->locale); return $this; } @@ -293,13 +289,7 @@ private function restoreContextField($fieldName) $this->restoreShopContext($currentStashIndex); } - if ('language' === $fieldName - && $this->contextFieldsStack[$currentStashIndex][$fieldName] instanceof Language - && method_exists($this->getContext(), 'getTranslator') - && property_exists($this->contextFieldsStack[$currentStashIndex][$fieldName], 'locale') - ) { - $this->getContext()->getTranslator()->setLocale($this->contextFieldsStack[$currentStashIndex][$fieldName]->locale); - } + $this->getContext()->getTranslator()->setLocale($this->contextFieldsStack[$currentStashIndex][$fieldName]->locale); $this->getContext()->$fieldName = $this->contextFieldsStack[$currentStashIndex][$fieldName]; unset($this->contextFieldsStack[$currentStashIndex][$fieldName]); diff --git a/src/Customer/ValueObject/CustomerId.php b/src/Customer/ValueObject/CustomerId.php index 483d54751..caa352b97 100644 --- a/src/Customer/ValueObject/CustomerId.php +++ b/src/Customer/ValueObject/CustomerId.php @@ -50,7 +50,7 @@ public function getValue() } /** - * @param int $customerId + * @param int|mixed $customerId * * @throws CustomerException */ diff --git a/src/Dispatcher/OrderDispatcher.php b/src/Dispatcher/OrderDispatcher.php index fe56d6c57..35f2eeba6 100644 --- a/src/Dispatcher/OrderDispatcher.php +++ b/src/Dispatcher/OrderDispatcher.php @@ -81,7 +81,7 @@ public function dispatchEventType($payload) $logger = $module->getService('ps_checkout.logger'); /** @var PayPalConfiguration $payPalConfiguration */ - $payPalConfiguration = $module->get(PayPalConfiguration::class); + $payPalConfiguration = $module->getService(PayPalConfiguration::class); switch ($payload['eventType']) { case static::PS_CHECKOUT_PAYMENT_COMPLETED: diff --git a/src/Event/SymfonyEventDispatcherAdapter.php b/src/Event/SymfonyEventDispatcherAdapter.php index f66ff550a..b7d3cbb38 100644 --- a/src/Event/SymfonyEventDispatcherAdapter.php +++ b/src/Event/SymfonyEventDispatcherAdapter.php @@ -21,7 +21,6 @@ namespace PrestaShop\Module\PrestashopCheckout\Event; use Symfony\Component\EventDispatcher\EventDispatcherInterface as SymfonyComponentEventDispatcherInterface; -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as SymfonyContractsEventDispatcherInterface; class SymfonyEventDispatcherAdapter implements EventDispatcherInterface { @@ -43,12 +42,6 @@ public function __construct(SymfonyComponentEventDispatcherInterface $eventDispa */ public function dispatch($event) { - if (interface_exists(SymfonyContractsEventDispatcherInterface::class) && $this->eventDispatcher instanceof SymfonyContractsEventDispatcherInterface) { - // @phpstan-ignore-next-line - return $this->eventDispatcher->dispatch($event, get_class($event)); - } else { - // @phpstan-ignore-next-line - return $this->eventDispatcher->dispatch(get_class($event), $event); - } + return $this->eventDispatcher->dispatch($event, get_class($event)); } } diff --git a/src/Event/SymfonyEventDispatcherFactory.php b/src/Event/SymfonyEventDispatcherFactory.php index f6908f820..ab9f78ba7 100644 --- a/src/Event/SymfonyEventDispatcherFactory.php +++ b/src/Event/SymfonyEventDispatcherFactory.php @@ -30,25 +30,10 @@ class SymfonyEventDispatcherFactory { - /** - * @var LoggerInterface - */ - private $logger; - - /** - * @var LoggerConfiguration - */ - private $configuration; - - /** - * @param LoggerInterface $logger - * @param LoggerConfiguration $configuration - */ - public function __construct(LoggerInterface $logger, LoggerConfiguration $configuration) - { - $this->logger = $logger; - $this->configuration = $configuration; - } + public function __construct( + private LoggerInterface $psCheckoutLogger, + private LoggerConfiguration $configuration + ) {} /** * @param SymfonyEventSubscriberInterface[] $eventSubscribers @@ -61,7 +46,7 @@ public function create(array $eventSubscribers) ? new SymfonyTraceableEventDispatcher( new SymfonyEventDispatcher(), new SymfonyStopwatch(), - $this->logger + $this->psCheckoutLogger ) : new SymfonyEventDispatcher(); diff --git a/src/Exception/PsCheckoutException.php b/src/Exception/PsCheckoutException.php index 627675825..1b5256976 100644 --- a/src/Exception/PsCheckoutException.php +++ b/src/Exception/PsCheckoutException.php @@ -89,4 +89,6 @@ class PsCheckoutException extends \Exception const CART_ADDRESS_DELIVERY_INVALID = 57; const CART_DELIVERY_OPTION_INVALID = 58; const PSCHECKOUT_HTTP_UNAUTHORIZED = 59; + + const PAYPAL_ORDER_ALREADY_CAPTURED = 60; } diff --git a/src/ExpressCheckout/ExpressCheckoutConfiguration.php b/src/ExpressCheckout/ExpressCheckoutConfiguration.php index 0b496a6f7..db5c30797 100644 --- a/src/ExpressCheckout/ExpressCheckoutConfiguration.php +++ b/src/ExpressCheckout/ExpressCheckoutConfiguration.php @@ -25,15 +25,8 @@ class ExpressCheckoutConfiguration { - /** - * @var PrestaShopConfiguration - */ - private $configuration; - - public function __construct(PrestaShopConfiguration $configuration) - { - $this->configuration = $configuration; - } + public function __construct(private PrestaShopConfiguration $configuration) + {} public function isOrderPageEnabled() { diff --git a/src/FundingSource/FundingSourceCollectionBuilder.php b/src/FundingSource/FundingSourceCollectionBuilder.php index a97fb3344..5b6f2f210 100644 --- a/src/FundingSource/FundingSourceCollectionBuilder.php +++ b/src/FundingSource/FundingSourceCollectionBuilder.php @@ -22,25 +22,10 @@ class FundingSourceCollectionBuilder { - /** - * @var FundingSourceConfiguration - */ - private $configuration; - - /** - * @var FundingSourceEligibilityConstraint - */ - private $eligibilityConstraint; - - /** - * @param FundingSourceConfiguration $configuration - * @param FundingSourceEligibilityConstraint $eligibilityConstraint - */ - public function __construct(FundingSourceConfiguration $configuration, FundingSourceEligibilityConstraint $eligibilityConstraint) - { - $this->configuration = $configuration; - $this->eligibilityConstraint = $eligibilityConstraint; - } + public function __construct( + private FundingSourceConfiguration $configuration, + private FundingSourceEligibilityConstraint $eligibilityConstraint + ){} /** * Create the funding sources collection diff --git a/src/FundingSource/FundingSourceConfiguration.php b/src/FundingSource/FundingSourceConfiguration.php index e16033be2..349e68955 100644 --- a/src/FundingSource/FundingSourceConfiguration.php +++ b/src/FundingSource/FundingSourceConfiguration.php @@ -22,18 +22,8 @@ class FundingSourceConfiguration { - /** - * @var FundingSourceConfigurationRepository - */ - private $repository; - - /** - * @param FundingSourceConfigurationRepository $repository - */ - public function __construct(FundingSourceConfigurationRepository $repository) - { - $this->repository = $repository; - } + public function __construct(private FundingSourceConfigurationRepository $repository) + {} /** * Get the funding source position stored in database configuration if exists or the default position diff --git a/src/FundingSource/FundingSourceConfigurationRepository.php b/src/FundingSource/FundingSourceConfigurationRepository.php index 6e0ce9863..e03b8a7f9 100644 --- a/src/FundingSource/FundingSourceConfigurationRepository.php +++ b/src/FundingSource/FundingSourceConfigurationRepository.php @@ -20,20 +20,12 @@ namespace PrestaShop\Module\PrestashopCheckout\FundingSource; +use Db; use PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext; +use PrestaShopDatabaseException; class FundingSourceConfigurationRepository { - /** - * @var \Db - */ - private $db; - - /** - * @var PrestaShopContext - */ - private $context; - /** * @var array In memory cache of funding sources */ @@ -42,11 +34,8 @@ class FundingSourceConfigurationRepository /** * @param PrestaShopContext $context */ - public function __construct(PrestaShopContext $context) - { - $this->db = \Db::getInstance(); - $this->context = $context; - } + public function __construct(private PrestaShopContext $context, private Db $db) + {} /** * @param string $name @@ -80,7 +69,7 @@ public function getAll($shopId = null) { $shopId = (int) ($shopId === null ? $this->context->getShopId() : $shopId); - if (isset($this->fundingSources[$shopId]) && null !== $this->fundingSources[$shopId]) { + if (isset($this->fundingSources[$shopId]) && !empty($this->fundingSources[$shopId])) { return $this->fundingSources[$shopId]; } @@ -103,7 +92,7 @@ public function getAll($shopId = null) * * @return bool * - * @throws \PrestaShopDatabaseException + * @throws PrestaShopDatabaseException */ public function save($data, $shopId = null) { diff --git a/src/FundingSource/FundingSourceInstaller.php b/src/FundingSource/FundingSourceInstaller.php index 150e6d870..b9c3fa9bf 100644 --- a/src/FundingSource/FundingSourceInstaller.php +++ b/src/FundingSource/FundingSourceInstaller.php @@ -20,6 +20,7 @@ namespace PrestaShop\Module\PrestashopCheckout\FundingSource; +use Db; use PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext; class FundingSourceInstaller @@ -33,7 +34,7 @@ class FundingSourceInstaller */ public function createFundingSources($shopId = null) { - $fundingSourceConfigurationRepository = new FundingSourceConfigurationRepository(new PrestaShopContext()); + $fundingSourceConfigurationRepository = new FundingSourceConfigurationRepository(new PrestaShopContext(), Db::getInstance()); $fundingSourceCollectionBuilder = new FundingSourceCollectionBuilder( new FundingSourceConfiguration($fundingSourceConfigurationRepository), new FundingSourceEligibilityConstraint() diff --git a/src/FundingSource/FundingSourcePresenter.php b/src/FundingSource/FundingSourcePresenter.php index 4e91198b1..3e2ee7ee2 100644 --- a/src/FundingSource/FundingSourcePresenter.php +++ b/src/FundingSource/FundingSourcePresenter.php @@ -26,33 +26,11 @@ class FundingSourcePresenter { - /** - * @var FundingSourceTranslationProvider - */ - private $translation; - - /** - * @var CountryRepository - */ - private $country; - /** - * @var PaymentMethodLogoProvider - */ - private $paymentMethodLogoProvider; - - /** - * @param FundingSourceTranslationProvider $translation - * @param CountryRepository $country - */ public function __construct( - FundingSourceTranslationProvider $translation, - CountryRepository $country, - PaymentMethodLogoProvider $paymentMethodLogoProvider - ) { - $this->translation = $translation; - $this->country = $country; - $this->paymentMethodLogoProvider = $paymentMethodLogoProvider; - } + private FundingSourceTranslationProvider $translation, + private CountryRepository $country, + private PaymentMethodLogoProvider $paymentMethodLogoProvider + ) {} /** * @param FundingSourceEntity $entity diff --git a/src/FundingSource/FundingSourceProvider.php b/src/FundingSource/FundingSourceProvider.php index 596f32340..c3942a68b 100644 --- a/src/FundingSource/FundingSourceProvider.php +++ b/src/FundingSource/FundingSourceProvider.php @@ -22,43 +22,19 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration; use PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository; +use PrestaShopDatabaseException; class FundingSourceProvider { - /** - * @var FundingSourceCollection - */ - private $collection; + private FundingSourceCollection $collection; - /** - * @var FundingSourcePresenter - */ - private $presenter; - /** - * @var PaymentTokenRepository - */ - private $paymentTokenRepository; - /** - * @var PayPalConfiguration - */ - private $payPalConfiguration; - - /** - * @param FundingSourceCollectionBuilder $fundingSourceCollectionBuilder - * @param FundingSourcePresenter $presenter - * @param PaymentTokenRepository $paymentTokenRepository - * @param PayPalConfiguration $payPalConfiguration - */ public function __construct( FundingSourceCollectionBuilder $fundingSourceCollectionBuilder, - FundingSourcePresenter $presenter, - PaymentTokenRepository $paymentTokenRepository, - PayPalConfiguration $payPalConfiguration + private FundingSourcePresenter $presenter, + private PaymentTokenRepository $paymentTokenRepository, + private PayPalConfiguration $payPalConfiguration ) { $this->collection = new FundingSourceCollection($fundingSourceCollectionBuilder->create()); - $this->presenter = $presenter; - $this->paymentTokenRepository = $paymentTokenRepository; - $this->payPalConfiguration = $payPalConfiguration; } /** @@ -89,7 +65,7 @@ public function getAll($isAdmin = false) * * @return FundingSource[] * - * @throws \PrestaShopDatabaseException + * @throws PrestaShopDatabaseException */ public function getSavedTokens($customerId) { diff --git a/src/FundingSource/FundingSourceTranslationProvider.php b/src/FundingSource/FundingSourceTranslationProvider.php index 9b1a8f08e..3a3754a54 100644 --- a/src/FundingSource/FundingSourceTranslationProvider.php +++ b/src/FundingSource/FundingSourceTranslationProvider.php @@ -20,27 +20,18 @@ namespace PrestaShop\Module\PrestashopCheckout\FundingSource; -use Module; +use Ps_checkout; class FundingSourceTranslationProvider { - /** - * @var array - */ - private $fundingSourceNames; + private array $fundingSourceNames; - /** - * @var array - */ - private $paymentOptionNames; + private array $paymentOptionNames; - /** - * @param Module $module - */ - public function __construct(Module $module) + public function __construct(Ps_checkout $psCheckout) { $this->fundingSourceNames = [ - 'card' => $module->l('Card', 'fundingsourcetranslationprovider'), + 'card' => $psCheckout->l('Card', 'fundingsourcetranslationprovider'), 'paypal' => 'PayPal', 'venmo' => 'Venmo', 'itau' => 'Itau', @@ -66,21 +57,21 @@ public function __construct(Module $module) 'sepa' => 'SEPA', 'google_pay' => 'Google Pay', 'apple_pay' => 'Apple Pay', - 'token' => $module->l('Pay with %s', 'fundingsourcetranslationprovider'), + 'token' => $psCheckout->l('Pay with %s', 'fundingsourcetranslationprovider'), ]; - $payByTranslation = $module->l('Pay by %s', 'fundingsourcetranslationprovider'); + $payByTranslation = $psCheckout->l('Pay by %s', 'fundingsourcetranslationprovider'); foreach ($this->fundingSourceNames as $fundingSource => $name) { switch ($fundingSource) { case 'paypal': - $this->paymentOptionNames[$fundingSource] = $module->l('Pay with a PayPal account', 'fundingsourcetranslationprovider'); + $this->paymentOptionNames[$fundingSource] = $psCheckout->l('Pay with a PayPal account', 'fundingsourcetranslationprovider'); break; case 'card': - $this->paymentOptionNames[$fundingSource] = $module->l('Pay by Card - 100% secure payments', 'fundingsourcetranslationprovider'); + $this->paymentOptionNames[$fundingSource] = $psCheckout->l('Pay by Card - 100% secure payments', 'fundingsourcetranslationprovider'); break; case 'paylater': - $this->paymentOptionNames[$fundingSource] = $module->l('Pay in installments with PayPal Pay Later', 'fundingsourcetranslationprovider'); + $this->paymentOptionNames[$fundingSource] = $psCheckout->l('Pay in installments with PayPal Pay Later', 'fundingsourcetranslationprovider'); break; default: $this->paymentOptionNames[$fundingSource] = sprintf($payByTranslation, $name); @@ -98,7 +89,7 @@ public function __construct(Module $module) */ public function getPaymentMethodName($fundingSource) { - return isset($this->fundingSourceNames[$fundingSource]) ? $this->fundingSourceNames[$fundingSource] : ''; + return $this->fundingSourceNames[$fundingSource] ?? ''; } /** @@ -126,6 +117,6 @@ public function getPaymentOptionNames() */ public function getPaymentOptionName($fundingSource) { - return isset($this->paymentOptionNames[$fundingSource]) ? $this->paymentOptionNames[$fundingSource] : ''; + return $this->paymentOptionNames[$fundingSource] ?? ''; } } diff --git a/src/Handler/CreatePaypalOrderHandler.php b/src/Handler/CreatePaypalOrderHandler.php deleted file mode 100644 index beb2d808f..000000000 --- a/src/Handler/CreatePaypalOrderHandler.php +++ /dev/null @@ -1,124 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 - */ - -namespace PrestaShop\Module\PrestashopCheckout\Handler; - -use Context; -use Module; -use PrestaShop\Module\PrestashopCheckout\Builder\Payload\OrderPayloadBuilder; -use PrestaShop\Module\PrestashopCheckout\Exception\PayPalException; -use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; -use PrestaShop\Module\PrestashopCheckout\Handler\Response\ResponseApiHandler; -use PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient; -use PrestaShop\Module\PrestashopCheckout\Presenter\Cart\CartPresenter; -use PrestaShop\Module\PrestashopCheckout\ShopContext; -use Ps_checkout; - -class CreatePaypalOrderHandler -{ - /** - * Prestashop context object - * - * @var Context - */ - private $context; - - public function __construct(Context $context) - { - $this->context = $context; - } - - /** - * @param bool $expressCheckout - * @param bool $updateOrder - * @param string|null $paypalOrderId - * - * @return array - * - * @throws PsCheckoutException - */ - public function handle($expressCheckout = false, $isCardPayment = false, $updateOrder = false, $paypalOrderId = null) - { - // Present an improved cart in order to create the payload - $cartPresenter = (new CartPresenter())->present(); - - $builder = new OrderPayloadBuilder($cartPresenter, true); - - /** @var Ps_checkout $module */ - $module = Module::getInstanceByName('ps_checkout'); - - /** @var ShopContext $shopContext */ - $shopContext = $module->getService(ShopContext::class); - - $builder->setIsCard($isCardPayment); - - // enable express checkout mode if in express checkout - $builder->setExpressCheckout($expressCheckout); - - // enable update mode if we build an order for update it - $builder->setIsUpdate($updateOrder); - if ($updateOrder) { - $builder->setPaypalOrderId($paypalOrderId); - } - - if ($shopContext->isShop17()) { - // Build full payload in 1.7 - $builder->buildFullPayload(); - } else { - // if on 1.6 always build minimal payload - $builder->buildMinimalPayload(); - } - - $payload = $builder->presentPayload()->getArray(); - - /** @var MaaslandHttpClient $checkoutHttpClient */ - $checkoutHttpClient = $module->getService(MaaslandHttpClient::class); - - // Create the paypal order or update it - try { - if (true === $updateOrder) { - $response = $checkoutHttpClient->updateOrder($payload); - } else { - $response = $checkoutHttpClient->createOrder($payload); - } - } catch (PayPalException $exception) { - $previousException = $exception->getPrevious(); - $response = method_exists($previousException, 'getResponse') ? $previousException->getResponse() : null; - // Retry with minimal payload when full payload failed (only on 1.7) - if ($response && substr((string) $response->getStatusCode(), 0, 1) === '4' && $shopContext->isShop17()) { - $builder->buildMinimalPayload(); - $payload = $builder->presentPayload()->getArray(); - - if (true === $updateOrder) { - $response = $checkoutHttpClient->updateOrder($payload); - } else { - $response = $checkoutHttpClient->createOrder($payload); - } - } else { - throw $exception; - } - } - - $responseHandler = new ResponseApiHandler(); - - return $responseHandler->handleResponse($response); - } -} diff --git a/src/Handler/Response/ResponseApiHandler.php b/src/Handler/Response/ResponseApiHandler.php index 3531220a8..3b59cd868 100644 --- a/src/Handler/Response/ResponseApiHandler.php +++ b/src/Handler/Response/ResponseApiHandler.php @@ -51,7 +51,7 @@ public function handleResponse(ResponseInterface $response) /** * Check if the response is successful or not (response code 200 to 299) * - * @param array $responseContents + * @param array|null $responseContents * @param int $httpStatusCode * * @return bool diff --git a/src/Http/MaaslandHttpClient.php b/src/Http/MaaslandHttpClient.php index e68bbc29e..63a3f8f24 100644 --- a/src/Http/MaaslandHttpClient.php +++ b/src/Http/MaaslandHttpClient.php @@ -33,15 +33,8 @@ class MaaslandHttpClient implements HttpClientInterface { - /** - * @var HttpClientInterface - */ - private $httpClient; - - public function __construct(HttpClientInterface $httpClient) - { - $this->httpClient = $httpClient; - } + public function __construct(private HttpClientInterface $httpClient) + {} /** * @param array $payload diff --git a/src/Logger/LoggerConfiguration.php b/src/Logger/LoggerConfiguration.php index b7f19baf1..2dcecd6af 100644 --- a/src/Logger/LoggerConfiguration.php +++ b/src/Logger/LoggerConfiguration.php @@ -76,18 +76,11 @@ class LoggerConfiguration */ const LEVEL_EMERGENCY = 600; - /** - * @var PrestaShopConfiguration - */ - private $configuration; - /** * @param PrestaShopConfiguration $configuration */ - public function __construct(PrestaShopConfiguration $configuration) - { - $this->configuration = $configuration; - } + public function __construct(private PrestaShopConfiguration $configuration) + {} /** * @return int diff --git a/src/Logger/LoggerFactory.php b/src/Logger/LoggerFactory.php index b6c5043d5..2917fb687 100644 --- a/src/Logger/LoggerFactory.php +++ b/src/Logger/LoggerFactory.php @@ -78,7 +78,7 @@ public function build() } /** - * @param string $name + * @param string|mixed $name * * @throws PsCheckoutException */ diff --git a/src/Logger/LoggerFileFinder.php b/src/Logger/LoggerFileFinder.php index c10cb52ac..c9cdd8f00 100644 --- a/src/Logger/LoggerFileFinder.php +++ b/src/Logger/LoggerFileFinder.php @@ -28,25 +28,14 @@ */ class LoggerFileFinder { - /** - * @var LoggerDirectory - */ - private $loggerDirectory; - - /** - * @var LoggerFilename - */ - private $loggerFilename; - /** * @param LoggerDirectory $loggerDirectory * @param LoggerFilename $loggerFilename */ - public function __construct($loggerDirectory, LoggerFilename $loggerFilename) - { - $this->loggerDirectory = $loggerDirectory; - $this->loggerFilename = $loggerFilename; - } + public function __construct( + private LoggerDirectory $loggerDirectory, + private LoggerFilename $loggerFilename + ) {} /** * @return array|string[] diff --git a/src/Logger/LoggerFilename.php b/src/Logger/LoggerFilename.php index 7e106e43e..e63d368f6 100644 --- a/src/Logger/LoggerFilename.php +++ b/src/Logger/LoggerFilename.php @@ -59,7 +59,7 @@ public function get() } /** - * @param string $name + * @param string|mixed $name * * @throws PsCheckoutException */ diff --git a/src/Order/CommandHandler/AddOrderPaymentCommandHandler.php b/src/Order/CommandHandler/AddOrderPaymentCommandHandler.php index 432b31b9c..219f039e0 100644 --- a/src/Order/CommandHandler/AddOrderPaymentCommandHandler.php +++ b/src/Order/CommandHandler/AddOrderPaymentCommandHandler.php @@ -25,11 +25,9 @@ use DateTimeZone; use OrderInvoice; use OrderPayment; -use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; use PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceTranslationProvider; use PrestaShop\Module\PrestashopCheckout\Order\AbstractOrderHandler; use PrestaShop\Module\PrestashopCheckout\Order\Command\AddOrderPaymentCommand; -use PrestaShop\Module\PrestashopCheckout\Order\Event\OrderPaymentCreatedEvent; use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderException; use PrestaShop\Module\PrestashopCheckout\Order\Payment\Exception\OrderPaymentException; use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration; @@ -37,27 +35,13 @@ class AddOrderPaymentCommandHandler extends AbstractOrderHandler { - /** - * @var EventDispatcherInterface - */ - private $eventDispatcher; - /** - * @var FundingSourceTranslationProvider - */ - private $fundingSourceTranslationProvider; - /** - * @var PayPalConfiguration - */ - private $configuration; - public function __construct( - EventDispatcherInterface $eventDispatcher, - FundingSourceTranslationProvider $fundingSourceTranslationProvider, - PayPalConfiguration $configuration - ) { - $this->eventDispatcher = $eventDispatcher; - $this->fundingSourceTranslationProvider = $fundingSourceTranslationProvider; - $this->configuration = $configuration; + private FundingSourceTranslationProvider $fundingSourceTranslationProvider, + private PayPalConfiguration $configuration + ) {} + + public function __invoke(AddOrderPaymentCommand $command) { + $this->handle($command); } /** @@ -95,11 +79,5 @@ public function handle(AddOrderPaymentCommand $command) if (!$paymentAdded) { throw new OrderException(sprintf('Failed to add a payment to Order #%s.', $command->getOrderId()->getValue()), OrderException::FAILED_ADD_PAYMENT); } - - /** @var OrderPayment[] $orderPayments */ - $orderPayments = $order->getOrderPayments(); - $latestOrderPayment = end($orderPayments); - - $this->eventDispatcher->dispatch(new OrderPaymentCreatedEvent((int) $latestOrderPayment->id)); } } diff --git a/src/Order/CommandHandler/CreateOrderCommandHandler.php b/src/Order/CommandHandler/CreateOrderCommandHandler.php index 2a6d0ee4c..154ec5824 100644 --- a/src/Order/CommandHandler/CreateOrderCommandHandler.php +++ b/src/Order/CommandHandler/CreateOrderCommandHandler.php @@ -26,11 +26,11 @@ use Order; use PrestaShop\Module\PrestashopCheckout\Cart\Exception\CartException; use PrestaShop\Module\PrestashopCheckout\Context\ContextStateManager; -use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; use PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceTranslationProvider; use PrestaShop\Module\PrestashopCheckout\Order\Command\CreateOrderCommand; use PrestaShop\Module\PrestashopCheckout\Order\Event\OrderCreatedEvent; +use PrestaShop\Module\PrestashopCheckout\Order\EventSubscriber\OrderEventSubscriber; use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderException; use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderNotFoundException; use PrestaShop\Module\PrestashopCheckout\Order\Service\CheckOrderAmount; @@ -39,65 +39,27 @@ use PrestaShop\Module\PrestashopCheckout\Order\State\OrderStateInstaller; use PrestaShop\Module\PrestashopCheckout\Order\State\Service\OrderStateMapper; use PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository; +use PrestaShop\PrestaShop\Adapter\Validate; use PrestaShopCollection; use PrestaShopDatabaseException; use PrestaShopException; use Ps_checkout; use PsCheckoutCart; -use Validate; class CreateOrderCommandHandler extends AbstractOrderCommandHandler { - /** - * @var EventDispatcherInterface - */ - private $eventDispatcher; - - /** - * @var ContextStateManager - */ - private $contextStateManager; - - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; - - /** - * @var OrderStateMapper - */ - private $psOrderStateMapper; - - /** - * @var Ps_checkout - */ - private $module; - - /** - * @var CheckOrderAmount - */ - private $checkOrderAmount; - /** - * @var FundingSourceTranslationProvider - */ - private $fundingSourceTranslationProvider; - public function __construct( - ContextStateManager $contextStateManager, - EventDispatcherInterface $eventDispatcher, - PsCheckoutCartRepository $psCheckoutCartRepository, - OrderStateMapper $psOrderStateMapper, - Ps_checkout $module, - CheckOrderAmount $checkOrderAmount, - FundingSourceTranslationProvider $fundingSourceTranslationProvider - ) { - $this->contextStateManager = $contextStateManager; - $this->eventDispatcher = $eventDispatcher; - $this->psCheckoutCartRepository = $psCheckoutCartRepository; - $this->psOrderStateMapper = $psOrderStateMapper; - $this->module = $module; - $this->checkOrderAmount = $checkOrderAmount; - $this->fundingSourceTranslationProvider = $fundingSourceTranslationProvider; + private ContextStateManager $contextStateManager, + private PsCheckoutCartRepository $psCheckoutCartRepository, + private OrderStateMapper $psOrderStateMapper, + private Ps_checkout $module, + private CheckOrderAmount $checkOrderAmount, + private FundingSourceTranslationProvider $fundingSourceTranslationProvider, + private OrderEventSubscriber $orderEventSubscriber + ) {} + + public function __invoke(CreateOrderCommand $command) { + $this->handle($command); } /** @@ -209,7 +171,7 @@ public function handle(CreateOrderCommand $command) } foreach ($orders as $order) { - $this->eventDispatcher->dispatch(new OrderCreatedEvent((int) $order->id, (int) $cart->id)); + $this->orderEventSubscriber->updateOrderMatrice(new OrderCreatedEvent((int) $order->id, (int) $cart->id)); } } } diff --git a/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php b/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php index 199d1735a..4d0df83c5 100644 --- a/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php +++ b/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php @@ -23,22 +23,14 @@ use Exception; use OrderHistory; use OrderState; -use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; use PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand; -use PrestaShop\Module\PrestashopCheckout\Order\Event\OrderStatusUpdatedEvent; use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderException; use PrestaShop\Module\PrestashopCheckout\Order\State\ValueObject\OrderStateId; class UpdateOrderStatusCommandHandler extends AbstractOrderCommandHandler { - /** - * @var EventDispatcherInterface - */ - private $eventDispatcher; - - public function __construct(EventDispatcherInterface $eventDispatcher) - { - $this->eventDispatcher = $eventDispatcher; + public function __invoke(UpdateOrderStatusCommand $command) { + $this->handle($command); } /** @@ -79,8 +71,6 @@ public function handle(UpdateOrderStatusCommand $command) if (!$historyAdded) { throw new OrderException(sprintf('Failed to update status or send email when changing OrderState #%d of Order #%d.', $command->getNewOrderStatusId()->getValue(), $command->getOrderId()->getValue()), OrderException::FAILED_UPDATE_ORDER_STATUS); } - - $this->eventDispatcher->dispatch(new OrderStatusUpdatedEvent($orderStateId)); } /** diff --git a/src/Order/EventSubscriber/OrderEventSubscriber.php b/src/Order/EventSubscriber/OrderEventSubscriber.php index 59dff925a..3da63bc07 100644 --- a/src/Order/EventSubscriber/OrderEventSubscriber.php +++ b/src/Order/EventSubscriber/OrderEventSubscriber.php @@ -21,32 +21,17 @@ namespace PrestaShop\Module\PrestashopCheckout\Order\EventSubscriber; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; use PrestaShop\Module\PrestashopCheckout\Order\Event\OrderCreatedEvent; use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderException; -use PrestaShop\Module\PrestashopCheckout\Order\Matrice\Command\UpdateOrderMatriceCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Exception\PayPalOrderException; use PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository; use PrestaShopException; -use Ps_checkout; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class OrderEventSubscriber implements EventSubscriberInterface { - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; - /** - * @var CommandBusInterface - */ - private $commandBus; - - public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository, Ps_checkout $module) - { - $this->psCheckoutCartRepository = $psCheckoutCartRepository; - $this->commandBus = $module->getService('ps_checkout.bus.command'); - } + public function __construct(private PsCheckoutCartRepository $psCheckoutCartRepository) + {} /** * {@inheritdoc} @@ -72,9 +57,10 @@ public function updateOrderMatrice(OrderCreatedEvent $event) $cartId = $event->getCartId()->getValue(); $psCheckoutCart = $this->psCheckoutCartRepository->findOneByCartId($cartId); - $this->commandBus->handle(new UpdateOrderMatriceCommand( - $event->getOrderId()->getValue(), - $psCheckoutCart->getPaypalOrderId() - )); + $orderMatrice = new \OrderMatrice(); + $orderMatrice->id_order_prestashop = $event->getOrderId()->getValue(); + $orderMatrice->id_order_paypal = $psCheckoutCart->getPaypalOrderId(); + + $orderMatrice->add(); } } diff --git a/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php b/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php index 715e871da..8cdb32f6e 100644 --- a/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php +++ b/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php @@ -20,33 +20,20 @@ namespace PrestaShop\Module\PrestashopCheckout\Order\Matrice\CommandHandler; -use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; use PrestaShop\Module\PrestashopCheckout\Order\Matrice\Command\UpdateOrderMatriceCommand; -use PrestaShop\Module\PrestashopCheckout\Order\Matrice\Event\OrderMatriceUpdatedEvent; class UpdateOrderMatriceCommandHandler { - private $eventDispatcher; - - public function __construct(EventDispatcherInterface $eventDispatcher) - { - $this->eventDispatcher = $eventDispatcher; - } - /** * @throws \PrestaShopException * @throws \PrestaShopDatabaseException */ - public function handle(UpdateOrderMatriceCommand $command) + public function __invoke(UpdateOrderMatriceCommand $command) { $orderMatrice = new \OrderMatrice(); $orderMatrice->id_order_prestashop = $command->getOrderId()->getValue(); $orderMatrice->id_order_paypal = $command->getOrderPayPalId()->getValue(); - $res = $orderMatrice->add(); - - if (!empty($res)) { - $this->eventDispatcher->dispatch(new OrderMatriceUpdatedEvent()); - } + $orderMatrice->add(); } } diff --git a/src/Order/Payment/ValueObject/OrderPaymentId.php b/src/Order/Payment/ValueObject/OrderPaymentId.php index ef5d30489..e2790acd8 100644 --- a/src/Order/Payment/ValueObject/OrderPaymentId.php +++ b/src/Order/Payment/ValueObject/OrderPaymentId.php @@ -50,7 +50,7 @@ public function getValue() } /** - * @param int $orderPaymentId + * @param int|mixed $orderPaymentId * * @throws OrderPaymentException */ diff --git a/src/Order/Query/GetOrderForApprovalReversedQueryResult.php b/src/Order/Query/GetOrderForApprovalReversedQueryResult.php index 668e862bb..70cf48c6e 100644 --- a/src/Order/Query/GetOrderForApprovalReversedQueryResult.php +++ b/src/Order/Query/GetOrderForApprovalReversedQueryResult.php @@ -47,7 +47,6 @@ class GetOrderForApprovalReversedQueryResult * @param bool $hasBeenCanceled * * @throws OrderException - * @throws OrderStateException */ public function __construct( $orderId, diff --git a/src/Order/QueryHandler/GetOrderForApprovalReversedQueryHandler.php b/src/Order/QueryHandler/GetOrderForApprovalReversedQueryHandler.php index b188f5673..792b6d4bc 100644 --- a/src/Order/QueryHandler/GetOrderForApprovalReversedQueryHandler.php +++ b/src/Order/QueryHandler/GetOrderForApprovalReversedQueryHandler.php @@ -38,15 +38,8 @@ class GetOrderForApprovalReversedQueryHandler { - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; - - public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) - { - $this->psCheckoutCartRepository = $psCheckoutCartRepository; - } + public function __construct(private PsCheckoutCartRepository $psCheckoutCartRepository) + {} /** * @param GetOrderForApprovalReversedQuery $query @@ -57,7 +50,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * @throws PrestaShopDatabaseException * @throws PrestaShopException */ - public function handle(GetOrderForApprovalReversedQuery $query) + public function __invoke(GetOrderForApprovalReversedQuery $query) { /** @var PsCheckoutCart|false $psCheckoutCart */ $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($query->getOrderPayPalId()->getValue()); diff --git a/src/Order/QueryHandler/GetOrderForPaymentCompletedQueryHandler.php b/src/Order/QueryHandler/GetOrderForPaymentCompletedQueryHandler.php index b94423127..6c24dd3e8 100644 --- a/src/Order/QueryHandler/GetOrderForPaymentCompletedQueryHandler.php +++ b/src/Order/QueryHandler/GetOrderForPaymentCompletedQueryHandler.php @@ -38,15 +38,8 @@ class GetOrderForPaymentCompletedQueryHandler { - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; - - public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) - { - $this->psCheckoutCartRepository = $psCheckoutCartRepository; - } + public function __construct(private PsCheckoutCartRepository $psCheckoutCartRepository) + {} /** * @param GetOrderForPaymentCompletedQuery $query @@ -57,7 +50,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * @throws PrestaShopDatabaseException * @throws PrestaShopException */ - public function handle(GetOrderForPaymentCompletedQuery $query) + public function __invoke(GetOrderForPaymentCompletedQuery $query) { $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($query->getOrderPayPalId()->getValue()); diff --git a/src/Order/QueryHandler/GetOrderForPaymentDeniedQueryHandler.php b/src/Order/QueryHandler/GetOrderForPaymentDeniedQueryHandler.php index 8b8347e07..d4fa6fcea 100644 --- a/src/Order/QueryHandler/GetOrderForPaymentDeniedQueryHandler.php +++ b/src/Order/QueryHandler/GetOrderForPaymentDeniedQueryHandler.php @@ -38,15 +38,8 @@ class GetOrderForPaymentDeniedQueryHandler { - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; - - public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) - { - $this->psCheckoutCartRepository = $psCheckoutCartRepository; - } + public function __construct(private PsCheckoutCartRepository $psCheckoutCartRepository) + {} /** * @param GetOrderForPaymentDeniedQuery $query @@ -57,7 +50,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * @throws PrestaShopDatabaseException * @throws PrestaShopException */ - public function handle(GetOrderForPaymentDeniedQuery $query) + public function __invoke(GetOrderForPaymentDeniedQuery $query) { /** @var PsCheckoutCart|false $psCheckoutCart */ $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($query->getOrderPayPalId()->getValue()); diff --git a/src/Order/QueryHandler/GetOrderForPaymentPendingQueryHandler.php b/src/Order/QueryHandler/GetOrderForPaymentPendingQueryHandler.php index a978cebe2..e9f33d0af 100644 --- a/src/Order/QueryHandler/GetOrderForPaymentPendingQueryHandler.php +++ b/src/Order/QueryHandler/GetOrderForPaymentPendingQueryHandler.php @@ -38,15 +38,8 @@ class GetOrderForPaymentPendingQueryHandler { - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; - - public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) - { - $this->psCheckoutCartRepository = $psCheckoutCartRepository; - } + public function __construct(private PsCheckoutCartRepository $psCheckoutCartRepository) + {} /** * @param GetOrderForPaymentPendingQuery $query @@ -57,7 +50,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * @throws PrestaShopDatabaseException * @throws PrestaShopException */ - public function handle(GetOrderForPaymentPendingQuery $query) + public function __invoke(GetOrderForPaymentPendingQuery $query) { /** @var PsCheckoutCart|false $psCheckoutCart */ $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($query->getOrderPayPalId()->getValue()); diff --git a/src/Order/QueryHandler/GetOrderForPaymentRefundedQueryHandler.php b/src/Order/QueryHandler/GetOrderForPaymentRefundedQueryHandler.php index bc94cb115..ca82b9708 100644 --- a/src/Order/QueryHandler/GetOrderForPaymentRefundedQueryHandler.php +++ b/src/Order/QueryHandler/GetOrderForPaymentRefundedQueryHandler.php @@ -38,15 +38,8 @@ class GetOrderForPaymentRefundedQueryHandler { - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; - - public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) - { - $this->psCheckoutCartRepository = $psCheckoutCartRepository; - } + public function __construct(private PsCheckoutCartRepository $psCheckoutCartRepository) + {} /** * @param GetOrderForPaymentRefundedQuery $query @@ -57,7 +50,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * @throws PrestaShopDatabaseException * @throws PrestaShopException */ - public function handle(GetOrderForPaymentRefundedQuery $query) + public function __invoke(GetOrderForPaymentRefundedQuery $query) { /** @var PsCheckoutCart|false $psCheckoutCart */ $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($query->getOrderPayPalId()->getValue()); diff --git a/src/Order/QueryHandler/GetOrderForPaymentReversedQueryHandler.php b/src/Order/QueryHandler/GetOrderForPaymentReversedQueryHandler.php index 06676d5b7..03c1aa563 100644 --- a/src/Order/QueryHandler/GetOrderForPaymentReversedQueryHandler.php +++ b/src/Order/QueryHandler/GetOrderForPaymentReversedQueryHandler.php @@ -38,15 +38,8 @@ class GetOrderForPaymentReversedQueryHandler { - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; - - public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) - { - $this->psCheckoutCartRepository = $psCheckoutCartRepository; - } + public function __construct(private PsCheckoutCartRepository $psCheckoutCartRepository) + {} /** * @param GetOrderForPaymentReversedQuery $query @@ -57,7 +50,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * @throws PrestaShopDatabaseException * @throws PrestaShopException */ - public function handle(GetOrderForPaymentReversedQuery $query) + public function __invoke(GetOrderForPaymentReversedQuery $query) { /** @var PsCheckoutCart|false $psCheckoutCart */ $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($query->getOrderPayPalId()->getValue()); diff --git a/src/Order/Service/CheckOrderAmount.php b/src/Order/Service/CheckOrderAmount.php index 91cf46ec9..28f1b3426 100644 --- a/src/Order/Service/CheckOrderAmount.php +++ b/src/Order/Service/CheckOrderAmount.php @@ -35,8 +35,8 @@ class CheckOrderAmount const ORDER_TO_MUCH_PAID = 3; /** - * @param string $totalAmount - * @param string $totalAmountPaid + * @param string|mixed $totalAmount + * @param string|mixed $totalAmountPaid * * @return int * diff --git a/src/Order/State/ValueObject/OrderStateId.php b/src/Order/State/ValueObject/OrderStateId.php index 259ab2750..37be0f614 100644 --- a/src/Order/State/ValueObject/OrderStateId.php +++ b/src/Order/State/ValueObject/OrderStateId.php @@ -50,7 +50,7 @@ public function getValue() } /** - * @param int $orderStateId + * @param int|mixed $orderStateId * * @throws OrderStateException */ diff --git a/src/Order/ValueObject/OrderId.php b/src/Order/ValueObject/OrderId.php index b296b6037..d5b82b3b6 100644 --- a/src/Order/ValueObject/OrderId.php +++ b/src/Order/ValueObject/OrderId.php @@ -50,7 +50,7 @@ public function getValue() } /** - * @param int $orderId + * @param int|mixed $orderId * * @throws OrderException */ diff --git a/src/PayPal/ApplePay/Builder/ApplePayPaymentRequestBuilder.php b/src/PayPal/ApplePay/Builder/ApplePayPaymentRequestBuilder.php index 8a92eb432..6f363f632 100644 --- a/src/PayPal/ApplePay/Builder/ApplePayPaymentRequestBuilder.php +++ b/src/PayPal/ApplePay/Builder/ApplePayPaymentRequestBuilder.php @@ -52,30 +52,4 @@ public function buildMinimalPaymentRequestFromPayPalPayload($payload) return $paymentRequest; } - - /** - * Get decimal to round correspondent to the payment currency used - * Advise from PayPal: Always round to 2 decimals except for HUF, JPY and TWD - * currencies which require a round with 0 decimal - * - * @return int - */ - private function getNbDecimalToRound($currencyIsoCode) - { - if (in_array($currencyIsoCode, ['HUF', 'JPY', 'TWD'], true)) { - return 0; - } - - return 2; - } - - /** - * @param float|int|string $amount - * - * @return string - */ - private function formatAmount($amount, $currencyIsoCode) - { - return sprintf("%01.{$this->getNbDecimalToRound($currencyIsoCode)}F", $amount); - } } diff --git a/src/PayPal/ApplePay/Query/GetApplePayPaymentRequestQueryHandler.php b/src/PayPal/ApplePay/Query/GetApplePayPaymentRequestQueryHandler.php index 9e6207f59..bef690049 100644 --- a/src/PayPal/ApplePay/Query/GetApplePayPaymentRequestQueryHandler.php +++ b/src/PayPal/ApplePay/Query/GetApplePayPaymentRequestQueryHandler.php @@ -27,15 +27,8 @@ class GetApplePayPaymentRequestQueryHandler { - /** - * @var ApplePayPaymentRequestBuilder - */ - private $builder; - - public function __construct(ApplePayPaymentRequestBuilder $builder) - { - $this->builder = $builder; - } + public function __construct(private ApplePayPaymentRequestBuilder $builder) + {} /** * @param GetApplePayPaymentRequestQuery $query @@ -44,7 +37,7 @@ public function __construct(ApplePayPaymentRequestBuilder $builder) * * @throws PsCheckoutException */ - public function handle(GetApplePayPaymentRequestQuery $query) + public function __invoke(GetApplePayPaymentRequestQuery $query) { $cartPresenter = new CartPresenter(); $cart = $cartPresenter->present(); diff --git a/src/PayPal/Customer/CommandHandler/SavePayPalCustomerCommandHandler.php b/src/PayPal/Customer/CommandHandler/SavePayPalCustomerCommandHandler.php index 7e381e7e1..552c50013 100644 --- a/src/PayPal/Customer/CommandHandler/SavePayPalCustomerCommandHandler.php +++ b/src/PayPal/Customer/CommandHandler/SavePayPalCustomerCommandHandler.php @@ -25,14 +25,12 @@ class SavePayPalCustomerCommandHandler { - /** - * @var PayPalCustomerRepository - */ - private $payPalCustomerRepository; + public function __construct(private PayPalCustomerRepository $payPalCustomerRepository) + {} - public function __construct(PayPalCustomerRepository $payPalCustomerRepository) + public function __invoke(SavePayPalCustomerCommand $command) { - $this->payPalCustomerRepository = $payPalCustomerRepository; + $this->handle($command); } public function handle(SavePayPalCustomerCommand $command) diff --git a/src/PayPal/Customer/ValueObject/PayPalCustomerId.php b/src/PayPal/Customer/ValueObject/PayPalCustomerId.php index 279d22f4f..83d6c735b 100644 --- a/src/PayPal/Customer/ValueObject/PayPalCustomerId.php +++ b/src/PayPal/Customer/ValueObject/PayPalCustomerId.php @@ -49,7 +49,7 @@ public function getValue() } /** - * @param string $customerId + * @param string|mixed $customerId * * @return void * diff --git a/src/PayPal/GooglePay/Query/GetGooglePayTransactionInfoQueryHandler.php b/src/PayPal/GooglePay/Query/GetGooglePayTransactionInfoQueryHandler.php index 4e0f5fe93..079436441 100644 --- a/src/PayPal/GooglePay/Query/GetGooglePayTransactionInfoQueryHandler.php +++ b/src/PayPal/GooglePay/Query/GetGooglePayTransactionInfoQueryHandler.php @@ -27,15 +27,8 @@ class GetGooglePayTransactionInfoQueryHandler { - /** - * @var GooglePayTransactionInfoBuilder - */ - private $builder; - - public function __construct(GooglePayTransactionInfoBuilder $builder) - { - $this->builder = $builder; - } + public function __construct(private GooglePayTransactionInfoBuilder $builder) + {} /** * @param GetGooglePayTransactionInfoQuery $query @@ -44,7 +37,7 @@ public function __construct(GooglePayTransactionInfoBuilder $builder) * * @throws PsCheckoutException */ - public function handle(GetGooglePayTransactionInfoQuery $query) + public function __invoke(GetGooglePayTransactionInfoQuery $query) { $cartPresenter = (new CartPresenter())->present(); $orderPayloadBuilder = new OrderPayloadBuilder($cartPresenter); diff --git a/src/PayPal/Merchant/ValueObject/PayPalMerchantId.php b/src/PayPal/Merchant/ValueObject/PayPalMerchantId.php index cff7399e0..860d87c3c 100644 --- a/src/PayPal/Merchant/ValueObject/PayPalMerchantId.php +++ b/src/PayPal/Merchant/ValueObject/PayPalMerchantId.php @@ -50,7 +50,7 @@ public function getValue() } /** - * @param string $value + * @param string|mixed $value * * @throws PayPalMerchantException */ diff --git a/src/PayPal/OAuth/Query/GetPayPalGetUserIdTokenQueryHandler.php b/src/PayPal/OAuth/Query/GetPayPalGetUserIdTokenQueryHandler.php index 821616b34..1c3c98b8d 100644 --- a/src/PayPal/OAuth/Query/GetPayPalGetUserIdTokenQueryHandler.php +++ b/src/PayPal/OAuth/Query/GetPayPalGetUserIdTokenQueryHandler.php @@ -27,30 +27,11 @@ class GetPayPalGetUserIdTokenQueryHandler { - /** - * @var OAuthService - */ - private $OAuthService; - - /** - * @var PayPalCustomerRepository - */ - private $customerRepository; - /** - * @var PayPalConfiguration - */ - private $payPalConfiguration; - - /** - * @param OAuthService $OAuthService - * @param PayPalCustomerRepository $customerRepository - */ - public function __construct(OAuthService $OAuthService, PayPalCustomerRepository $customerRepository, PayPalConfiguration $payPalConfiguration) - { - $this->OAuthService = $OAuthService; - $this->customerRepository = $customerRepository; - $this->payPalConfiguration = $payPalConfiguration; - } + public function __construct( + private OAuthService $OAuthService, + private PayPalCustomerRepository $customerRepository, + private PayPalConfiguration $payPalConfiguration + ) {} /** * @param GetPayPalGetUserIdTokenQuery $query @@ -59,7 +40,7 @@ public function __construct(OAuthService $OAuthService, PayPalCustomerRepository * * @throws Exception */ - public function handle(GetPayPalGetUserIdTokenQuery $query) + public function __invoke(GetPayPalGetUserIdTokenQuery $query) { $customerIdPayPal = $query->getCustomerId() ? $this->customerRepository->findPayPalCustomerIdByCustomerId($query->getCustomerId()) : null; $merchantId = $this->payPalConfiguration->getMerchantId(); diff --git a/src/PayPal/Order/Cache/PayPalOrderCache.php b/src/PayPal/Order/Cache/PayPalOrderCache.php new file mode 100644 index 000000000..8d704766f --- /dev/null +++ b/src/PayPal/Order/Cache/PayPalOrderCache.php @@ -0,0 +1,57 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 + */ + +namespace PrestaShop\Module\PrestashopCheckout\PayPal\Order\Cache; + +use PsCheckoutCart; +use Psr\Cache\InvalidArgumentException; +use Symfony\Component\Cache\Adapter\ChainAdapter; + +class PayPalOrderCache extends ChainAdapter +{ + public const CACHE_TTL = [ + PsCheckoutCart::STATUS_CREATED => 600, + PsCheckoutCart::STATUS_PAYER_ACTION_REQUIRED => 600, + PsCheckoutCart::STATUS_APPROVED => 600, + PsCheckoutCart::STATUS_VOIDED => 3600, + PsCheckoutCart::STATUS_SAVED => 3600, + PsCheckoutCart::STATUS_CANCELED => 3600, + PsCheckoutCart::STATUS_COMPLETED => 3600, + ]; + + /** + * @param string $key + * @param array $value + * @param int $ttl + * + * @throws InvalidArgumentException + */ + public function set($key, $value, $ttl = null): bool + { + if (!$ttl && isset($value['status'], self::CACHE_TTL[$value['status']])) { + $ttl = self::CACHE_TTL[$value['status']]; + } + + $cacheItem = $this->getItem($key)->set($value)->expiresAfter($ttl); + + return $this->save($cacheItem); + } +} diff --git a/src/Updater/index.php b/src/PayPal/Order/Cache/index.php old mode 100755 new mode 100644 similarity index 100% rename from src/Updater/index.php rename to src/PayPal/Order/Cache/index.php diff --git a/src/PayPal/Order/CheckTransitionPayPalOrderStatusService.php b/src/PayPal/Order/CheckTransitionPayPalOrderStatusService.php index c2b8f79c0..8347bc8d4 100644 --- a/src/PayPal/Order/CheckTransitionPayPalOrderStatusService.php +++ b/src/PayPal/Order/CheckTransitionPayPalOrderStatusService.php @@ -25,8 +25,8 @@ class CheckTransitionPayPalOrderStatusService { /** - * @param string $oldStatus - * @param string $newStatus + * @param string|mixed $oldStatus + * @param string|mixed $newStatus * * @return bool * diff --git a/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php index eb42059fb..c71b13bdf 100644 --- a/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php @@ -22,7 +22,7 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler; use Configuration; -use Context; +use Exception; use PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext; use PrestaShop\Module\PrestashopCheckout\Customer\ValueObject\CustomerId; use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; @@ -32,6 +32,7 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CapturePayPalOrderCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Entity\PayPalOrder; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderCompletedEvent; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventProcessor\PayPalOrderEventProcessor; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\PayPalOrderStatus; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\Event\PayPalCaptureCompletedEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\Event\PayPalCaptureDeclinedEvent; @@ -41,57 +42,29 @@ use PrestaShop\Module\PrestashopCheckout\PayPalProcessorResponse; use PrestaShop\Module\PrestashopCheckout\Repository\PayPalCustomerRepository; use PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository; -use Psr\SimpleCache\CacheInterface; +use Symfony\Component\Cache\Adapter\ChainAdapter; class CapturePayPalOrderCommandHandler { - /** - * @var EventDispatcherInterface - */ - private $eventDispatcher; - - /** - * @var CacheInterface - */ - private $orderPayPalCache; - - /** - * @var MaaslandHttpClient - */ - private $maaslandHttpClient; - /** - * @var PrestaShopContext - */ - private $prestaShopContext; - /** - * @var PayPalCustomerRepository - */ - private $payPalCustomerRepository; - /** - * @var PayPalOrderRepository - */ - private $payPalOrderRepository; - public function __construct( - MaaslandHttpClient $maaslandHttpClient, - EventDispatcherInterface $eventDispatcher, - CacheInterface $orderPayPalCache, - PrestaShopContext $prestaShopContext, - PayPalCustomerRepository $payPalCustomerRepository, - PayPalOrderRepository $payPalOrderRepository + private MaaslandHttpClient $maaslandHttpClient, + private EventDispatcherInterface $eventDispatcher, + private ChainAdapter $orderPayPalCache, + private PrestaShopContext $prestaShopContext, + private PayPalCustomerRepository $payPalCustomerRepository, + private PayPalOrderRepository $payPalOrderRepository, + private PayPalOrderEventProcessor $payPalOrderEventProcessor ) { - $this->maaslandHttpClient = $maaslandHttpClient; - $this->eventDispatcher = $eventDispatcher; - $this->orderPayPalCache = $orderPayPalCache; - $this->prestaShopContext = $prestaShopContext; - $this->payPalCustomerRepository = $payPalCustomerRepository; - $this->payPalOrderRepository = $payPalOrderRepository; + } + + public function __invoke(CapturePayPalOrderCommand $capturePayPalOrderCommand) + { + $this->handle($capturePayPalOrderCommand); } public function handle(CapturePayPalOrderCommand $capturePayPalOrderCommand) { - $context = Context::getContext(); - $merchantId = Configuration::get('PS_CHECKOUT_PAYPAL_ID_MERCHANT', null, null, $context->shop->id); + $merchantId = Configuration::get('PS_CHECKOUT_PAYPAL_ID_MERCHANT', null, null, $this->prestaShopContext->getShopId()); $payload = [ 'mode' => $capturePayPalOrderCommand->getFundingSource(), @@ -109,7 +82,7 @@ public function handle(CapturePayPalOrderCommand $capturePayPalOrderCommand) $orderPayPal = json_decode($response->getBody(), true); - $payPalOrderFromCache = $this->orderPayPalCache->get($orderPayPal['id']); + $payPalOrderFromCache = $this->orderPayPalCache->getItem($orderPayPal['id'])->get(); $orderPayPal = array_replace_recursive($payPalOrderFromCache, $orderPayPal); @@ -122,7 +95,7 @@ public function handle(CapturePayPalOrderCommand $capturePayPalOrderCommand) $payPalCustomerId = new PayPalCustomerId($vault['customer']['id']); $customerId = new CustomerId($this->prestaShopContext->getCustomerId()); $this->payPalCustomerRepository->save($customerId, $payPalCustomerId); - } catch (\Exception $exception) { + } catch (Exception $exception) { } } @@ -144,7 +117,9 @@ public function handle(CapturePayPalOrderCommand $capturePayPalOrderCommand) } if ($orderPayPal['status'] === PayPalOrderStatus::COMPLETED) { - $this->eventDispatcher->dispatch(new PayPalOrderCompletedEvent($orderPayPal['id'], $orderPayPal)); + $event = new PayPalOrderCompletedEvent($orderPayPal['id'], $orderPayPal); + $this->payPalOrderEventProcessor->saveCompletedPayPalOrder($event); + $this->payPalOrderEventProcessor->updateCache($event); } if ($capturePayPal['status'] === PayPalCaptureStatus::PENDING) { diff --git a/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php index 3dd9fa832..869b0061f 100644 --- a/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php @@ -25,7 +25,6 @@ use PrestaShop\Module\PrestashopCheckout\Cart\Exception\CartNotFoundException; use PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext; use PrestaShop\Module\PrestashopCheckout\Customer\ValueObject\CustomerId; -use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; use PrestaShop\Module\PrestashopCheckout\Exception\InvalidRequestException; use PrestaShop\Module\PrestashopCheckout\Exception\NotAuthorizedException; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; @@ -34,6 +33,7 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CreatePayPalOrderCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Entity\PayPalOrder; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderCreatedEvent; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventSubscriber\PayPalOrderEventSubscriber; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Exception\PayPalOrderException; use PrestaShop\Module\PrestashopCheckout\Presenter\Cart\CartPresenter; use PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository; @@ -42,51 +42,24 @@ class CreatePayPalOrderCommandHandler { - /** - * @var MaaslandHttpClient - */ - private $maaslandHttpClient; - /** - * @var EventDispatcherInterface - */ - private $eventDispatcher; - /** - * @var PayPalCustomerRepository - */ - private $payPalCustomerRepository; - /** - * @var PaymentTokenRepository - */ - private $paymentTokenRepository; - /** - * @var ShopContext - */ - private $shopContext; - /** - * @var PrestaShopContext - */ - private $prestaShopContext; - public function __construct( - MaaslandHttpClient $maaslandHttpClient, - ShopContext $shopContext, - PrestaShopContext $prestaShopContext, - EventDispatcherInterface $eventDispatcher, - PayPalCustomerRepository $payPalCustomerRepository, - PaymentTokenRepository $paymentTokenRepository - ) { - $this->maaslandHttpClient = $maaslandHttpClient; - $this->shopContext = $shopContext; - $this->eventDispatcher = $eventDispatcher; - $this->payPalCustomerRepository = $payPalCustomerRepository; - $this->paymentTokenRepository = $paymentTokenRepository; - $this->prestaShopContext = $prestaShopContext; + private MaaslandHttpClient $maaslandHttpClient, + private PrestaShopContext $prestaShopContext, + private PayPalCustomerRepository $payPalCustomerRepository, + private PaymentTokenRepository $paymentTokenRepository, + private PayPalOrderEventSubscriber $payPalOrderEventSubscriber + ) {} + + public function __invoke(CreatePayPalOrderCommand $command) + { + $this->handle($command); } /** * @param CreatePayPalOrderCommand $command * * @return void + * @return void * * @throws CartNotFoundException * @throws PayPalOrderException @@ -98,8 +71,8 @@ public function __construct( */ public function handle(CreatePayPalOrderCommand $command) { - $cartPresenter = (new CartPresenter())->present(); - $builder = new OrderPayloadBuilder($cartPresenter); + $cartPresenter = new CartPresenter(); + $builder = new OrderPayloadBuilder($cartPresenter->present()); try { $customerId = $this->prestaShopContext->getCustomerId(); @@ -130,13 +103,7 @@ public function handle(CreatePayPalOrderCommand $command) $builder->setSavePaymentMethod($command->vault()); $builder->setVault($command->getPaymentTokenId() || $command->vault()); - if ($this->shopContext->isShop17()) { - // Build full payload in 1.7 - $builder->buildFullPayload(); - } else { - // if on 1.6 always build minimal payload - $builder->buildMinimalPayload(); - } + $builder->buildFullPayload(); $response = $this->maaslandHttpClient->createOrder($builder->presentPayload()->getArray()); $order = json_decode($response->getBody(), true); @@ -150,7 +117,7 @@ public function handle(CreatePayPalOrderCommand $command) $customerIntent[] = PayPalOrder::CUSTOMER_INTENT_FAVORITE; } - $this->eventDispatcher->dispatch(new PayPalOrderCreatedEvent( + $event = new PayPalOrderCreatedEvent( $order['id'], $order, $command->getCartId()->getValue(), @@ -159,6 +126,9 @@ public function handle(CreatePayPalOrderCommand $command) $command->isExpressCheckout(), $customerIntent, $command->getPaymentTokenId() - )); + ); + + $this->payPalOrderEventSubscriber->saveCreatedPayPalOrder($event); + $this->payPalOrderEventSubscriber->updateCache($event); } } diff --git a/src/PayPal/Order/CommandHandler/SavePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/SavePayPalOrderCommandHandler.php index 946c13129..ba6f48a0a 100644 --- a/src/PayPal/Order/CommandHandler/SavePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/SavePayPalOrderCommandHandler.php @@ -32,14 +32,12 @@ class SavePayPalOrderCommandHandler { - /** - * @var PayPalOrderRepository - */ - private $payPalOrderRepository; + public function __construct(private PayPalOrderRepository $payPalOrderRepository) + {} - public function __construct(PayPalOrderRepository $payPalOrderRepository) + public function __invoke(SavePayPalOrderCommand $command) { - $this->payPalOrderRepository = $payPalOrderRepository; + $this->handle($command); } public function handle(SavePayPalOrderCommand $command) diff --git a/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php index 5e65221f4..9b252e0a9 100644 --- a/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php @@ -29,6 +29,7 @@ use PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\UpdatePayPalOrderCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderUpdatedEvent; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventSubscriber\PayPalOrderEventSubscriber; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Exception\PayPalOrderException; use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalOrderProvider; use PrestaShop\Module\PrestashopCheckout\Presenter\Cart\CartPresenter; @@ -36,43 +37,11 @@ class UpdatePayPalOrderCommandHandler { - /** - * @var EventDispatcherInterface - */ - private $eventDispatcher; - - /** - * @var MaaslandHttpClient - */ - private $httpClient; - - /** - * @var ShopContext - */ - private $shopContext; - - /** - * @var PayPalOrderProvider - */ - private $paypalOrderProvider; - - /** - * @param MaaslandHttpClient $httpClient - * @param EventDispatcherInterface $eventDispatcher - * @param ShopContext $shopContext - * @param PayPalOrderProvider $paypalOrderProvider - */ public function __construct( - MaaslandHttpClient $httpClient, - EventDispatcherInterface $eventDispatcher, - ShopContext $shopContext, - PayPalOrderProvider $paypalOrderProvider - ) { - $this->httpClient = $httpClient; - $this->eventDispatcher = $eventDispatcher; - $this->shopContext = $shopContext; - $this->paypalOrderProvider = $paypalOrderProvider; - } + private MaaslandHttpClient $httpClient, + private PayPalOrderProvider $paypalOrderProvider, + private PayPalOrderEventSubscriber $payPalOrderEventSubscriber + ) {} /** * @param UpdatePayPalOrderCommand $command @@ -81,7 +50,7 @@ public function __construct( * * @throws CartException|PayPalException|PayPalOrderException|PsCheckoutException|Exception */ - public function handle(UpdatePayPalOrderCommand $command) + public function __invoke(UpdatePayPalOrderCommand $command) { try { $paypalOrder = $this->paypalOrderProvider->getById($command->getPayPalOrderId()->getValue()); @@ -94,19 +63,13 @@ public function handle(UpdatePayPalOrderCommand $command) } $cartPresenter = (new CartPresenter())->present(); - $builder = new OrderPayloadBuilder($cartPresenter, true); + $builder = new OrderPayloadBuilder($cartPresenter); $builder->setIsUpdate(true); $builder->setPaypalOrderId($command->getPayPalOrderId()->getValue()); $builder->setIsCard($command->getFundingSource() === 'card' && $command->isHostedFields()); $builder->setExpressCheckout($command->isExpressCheckout()); - if ($this->shopContext->isShop17()) { - // Build full payload in 1.7 - $builder->buildFullPayload(); - } else { - // if on 1.6 always build minimal payload - $builder->buildMinimalPayload(); - } + $builder->buildFullPayload(); $payload = $builder->presentPayload()->getArray(); $needToUpdate = false; @@ -146,14 +109,17 @@ public function handle(UpdatePayPalOrderCommand $command) throw new PayPalOrderException('Failed to update PayPal Order', PayPalOrderException::PAYPAL_ORDER_UPDATE_FAILED); } - $this->eventDispatcher->dispatch(new PayPalOrderUpdatedEvent( + $event = new PayPalOrderUpdatedEvent( $command->getPayPalOrderId()->getValue(), $updatedPayPalOrder, $command->getCartId()->getValue(), $command->isHostedFields(), $command->isExpressCheckout(), $command->getFundingSource() - )); + ); + + $this->payPalOrderEventSubscriber->updatePayPalOrder($event); + $this->payPalOrderEventSubscriber->clearCache($event); } /** diff --git a/src/PayPal/Order/EventProcessor/PayPalOrderEventProcessor.php b/src/PayPal/Order/EventProcessor/PayPalOrderEventProcessor.php new file mode 100644 index 000000000..cf7d1af4f --- /dev/null +++ b/src/PayPal/Order/EventProcessor/PayPalOrderEventProcessor.php @@ -0,0 +1,214 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 + */ + +namespace PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventProcessor; + +use Exception; +use PrestaShop\Module\PrestashopCheckout\Checkout\Command\SaveCheckoutCommand; +use PrestaShop\Module\PrestashopCheckout\Checkout\Command\SavePayPalOrderStatusCommand; +use PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SaveCheckoutCommandHandler; +use PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SavePayPalOrderStatusCommandHandler; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; +use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; +use PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand; +use PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler; +use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderNotFoundException; +use PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForApprovalReversedQuery; +use PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForApprovalReversedQueryResult; +use PrestaShop\Module\PrestashopCheckout\Order\State\OrderStateConfigurationKeys; +use PrestaShop\Module\PrestashopCheckout\Order\State\Service\OrderStateMapper; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\CheckTransitionPayPalOrderStatusService; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\SavePayPalOrderCommand; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\SavePayPalOrderCommandHandler; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderApprovalReversedEvent; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderApprovedEvent; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderCompletedEvent; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderCreatedEvent; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderEvent; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\PayPalOrderStatus; +use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration; +use PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository; +use PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository; +use Symfony\Component\Cache\Adapter\ChainAdapter; + +class PayPalOrderEventProcessor +{ + public function __construct( + private QueryBusInterface $queryBus, + private PsCheckoutCartRepository $psCheckoutCartRepository, + private ChainAdapter $orderPayPalCache, + private CheckTransitionPayPalOrderStatusService $checkTransitionPayPalOrderStatusService, + private OrderStateMapper $orderStateMapper, + private PayPalConfiguration $payPalConfiguration, + private PayPalOrderRepository $payPalOrderRepository, + private SavePayPalOrderCommandHandler $savePayPalOrderCommandHandler, + private SaveCheckoutCommandHandler $saveCheckoutCommandHandler, + private SavePayPalOrderStatusCommandHandler $savePayPalOrderStatusCommandHandler, + private UpdateOrderStatusCommandHandler $updateOrderStatusCommandHandler + ) {} + + public function saveCreatedPayPalOrder(PayPalOrderCreatedEvent $event) + { + $order = $event->getOrderPayPal(); + + try { + $payPalOrder = $this->payPalOrderRepository->getPayPalOrderByCartId($event->getCartId()->getValue()); + $this->payPalOrderRepository->deletePayPalOrder($payPalOrder->getId()); + } catch (Exception $e) { + } + + $this->savePayPalOrderCommandHandler->handle(new SavePayPalOrderCommand( + $order, + $event->getCartId(), + $event->getFundingSource(), + $this->payPalConfiguration->getPaymentMode(), + $event->getCustomerIntent(), + $event->isExpressCheckout(), + $event->isCardFields(), + $event->getPaymentTokenId() + )); + + $this->saveCheckoutCommandHandler->handle(new SaveCheckoutCommand( + $event->getCartId()->getValue(), + $event->getOrderPayPalId()->getValue(), + $order['status'], + isset($order['intent']) ? $order['intent'] : $this->payPalConfiguration->getIntent(), + $event->getFundingSource(), + $event->isExpressCheckout(), + $event->isCardFields(), + $this->payPalConfiguration->getPaymentMode() + )); + } + + public function saveApprovedPayPalOrder(PayPalOrderApprovedEvent $event) + { + $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($event->getOrderPayPalId()->getValue()); + + if (false === $psCheckoutCart) { + throw new PsCheckoutException(sprintf('PayPal Order %s is not linked to a cart', $event->getOrderPayPalId()->getValue()), PsCheckoutException::PRESTASHOP_CART_NOT_FOUND); + } + + if (!$this->checkTransitionPayPalOrderStatusService->checkAvailableStatus($psCheckoutCart->getPaypalStatus(), PayPalOrderStatus::APPROVED)) { + return; + } + + try { + $this->savePayPalOrderCommandHandler->handle(new SavePayPalOrderCommand($event->getOrderPayPal())); + } catch (Exception $exception) { + } + + $this->savePayPalOrderStatusCommandHandler->handle(new SavePayPalOrderStatusCommand( + $event->getOrderPayPalId()->getValue(), + PayPalOrderStatus::APPROVED + )); + } + + public function saveCompletedPayPalOrder(PayPalOrderCompletedEvent $event) + { + $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($event->getOrderPayPalId()->getValue()); + + if (false === $psCheckoutCart) { + throw new PsCheckoutException(sprintf('PayPal Order %s is not linked to a cart', $event->getOrderPayPalId()->getValue()), PsCheckoutException::PRESTASHOP_CART_NOT_FOUND); + } + + if (!$this->checkTransitionPayPalOrderStatusService->checkAvailableStatus($psCheckoutCart->getPaypalStatus(), PayPalOrderStatus::COMPLETED)) { + return; + } + + try { + $this->savePayPalOrderCommandHandler->handle(new SavePayPalOrderCommand($event->getOrderPayPal())); + } catch (Exception $exception) { + } + + $this->savePayPalOrderStatusCommandHandler->handle(new SavePayPalOrderStatusCommand( + $event->getOrderPayPalId()->getValue(), + PayPalOrderStatus::COMPLETED + )); + } + + public function saveApprovalReversedPayPalOrder(PayPalOrderApprovalReversedEvent $event) + { + $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($event->getOrderPayPalId()->getValue()); + + if (false === $psCheckoutCart) { + throw new PsCheckoutException(sprintf('PayPal Order %s is not linked to a cart', $event->getOrderPayPalId()->getValue()), PsCheckoutException::PRESTASHOP_CART_NOT_FOUND); + } + + if (!$this->checkTransitionPayPalOrderStatusService->checkAvailableStatus($psCheckoutCart->getPaypalStatus(), PayPalOrderStatus::REVERSED)) { + return; + } + + $this->savePayPalOrderStatusCommandHandler->handle(new SavePayPalOrderStatusCommand( + $event->getOrderPayPalId()->getValue(), + PayPalOrderStatus::REVERSED + )); + } + + public function setApprovalReversedOrderStatus(PayPalOrderApprovalReversedEvent $event) + { + try { + /** @var GetOrderForApprovalReversedQueryResult $order */ + $order = $this->queryBus->handle( + new GetOrderForApprovalReversedQuery( + $event->getOrderPayPalId()->getValue() + ) + ); + } catch (OrderNotFoundException $exception) { + return; + } + + if ($order->hasBeenCanceled() || $order->hasBeenPaid()) { + return; + } + + $this->updateOrderStatusCommandHandler->handle( + new UpdateOrderStatusCommand( + $order->getOrderId()->getValue(), + $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_CANCELED) + ) + ); + } + + public function updatePayPalOrder(PayPalOrderEvent $event) + { + $this->savePayPalOrderCommandHandler->handle(new SavePayPalOrderCommand( + $event->getOrderPayPal() + )); + } + + public function updateCache(PayPalOrderEvent $event) + { + $currentOrderPayPalCacheItem = $this->orderPayPalCache->getItem($event->getOrderPayPalId()->getValue()); + $currentOrderPayPal = $currentOrderPayPalCacheItem->get(); + $newOrderPayPal = $event->getOrderPayPal(); + + if ($currentOrderPayPal && !$this->checkTransitionPayPalOrderStatusService->checkAvailableStatus($currentOrderPayPal['status'], $newOrderPayPal['status'])) { + return; + } + + $currentOrderPayPalCacheItem->set($newOrderPayPal); + $this->orderPayPalCache->save($currentOrderPayPalCacheItem); + } + + public function clearCache(PayPalOrderEvent $event) + { + $this->orderPayPalCache->delete($event->getOrderPayPalId()->getValue()); + } +} diff --git a/src/PayPal/Order/EventProcessor/index.php b/src/PayPal/Order/EventProcessor/index.php new file mode 100644 index 000000000..296d682e8 --- /dev/null +++ b/src/PayPal/Order/EventProcessor/index.php @@ -0,0 +1,28 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php b/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php index cd03d5b44..b2069bc8b 100644 --- a/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php +++ b/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php @@ -21,100 +21,29 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventSubscriber; -use Exception; use PrestaShop\Module\PrestashopCheckout\Checkout\CheckoutChecker; -use PrestaShop\Module\PrestashopCheckout\Checkout\Command\SaveCheckoutCommand; -use PrestaShop\Module\PrestashopCheckout\Checkout\Command\SavePayPalOrderStatusCommand; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; -use PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand; -use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderNotFoundException; -use PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForApprovalReversedQuery; -use PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForApprovalReversedQueryResult; -use PrestaShop\Module\PrestashopCheckout\Order\State\OrderStateConfigurationKeys; -use PrestaShop\Module\PrestashopCheckout\Order\State\Service\OrderStateMapper; -use PrestaShop\Module\PrestashopCheckout\PayPal\Order\CheckTransitionPayPalOrderStatusService; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CapturePayPalOrderCommand; -use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\SavePayPalOrderCommand; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CapturePayPalOrderCommandHandler; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderApprovalReversedEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderApprovedEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderCompletedEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderCreatedEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderUpdatedEvent; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventProcessor\PayPalOrderEventProcessor; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\PayPalOrderStatus; -use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration; -use PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository; use PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository; -use Ps_checkout; -use Psr\SimpleCache\CacheInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class PayPalOrderEventSubscriber implements EventSubscriberInterface { - /** - * @var Ps_checkout - */ - private $module; - - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; - - /** - * @var CacheInterface - */ - private $orderPayPalCache; - - /** - * @var CheckoutChecker - */ - private $checkoutChecker; - - /** - * @var CheckTransitionPayPalOrderStatusService - */ - private $checkTransitionPayPalOrderStatusService; - - /** - * @var OrderStateMapper - */ - private $orderStateMapper; - - /** - * @var CommandBusInterface - */ - private $commandBus; - /** - * @var PayPalConfiguration - */ - private $payPalConfiguration; - /** - * @var PayPalOrderRepository - */ - private $payPalOrderRepository; - public function __construct( - Ps_checkout $module, - PsCheckoutCartRepository $psCheckoutCartRepository, - CacheInterface $orderPayPalCache, - CheckoutChecker $checkoutChecker, - CheckTransitionPayPalOrderStatusService $checkTransitionPayPalOrderStatusService, - OrderStateMapper $orderStateMapper, - PayPalConfiguration $payPalConfiguration, - PayPalOrderRepository $payPalOrderRepository - ) { - $this->module = $module; - $this->psCheckoutCartRepository = $psCheckoutCartRepository; - $this->orderPayPalCache = $orderPayPalCache; - $this->checkoutChecker = $checkoutChecker; - $this->checkTransitionPayPalOrderStatusService = $checkTransitionPayPalOrderStatusService; - $this->orderStateMapper = $orderStateMapper; - $this->commandBus = $this->module->getService('ps_checkout.bus.command'); - $this->payPalConfiguration = $payPalConfiguration; - $this->payPalOrderRepository = $payPalOrderRepository; - } + private PsCheckoutCartRepository $psCheckoutCartRepository, + private CheckoutChecker $checkoutChecker, + private CapturePayPalOrderCommandHandler $capturePayPalOrderCommandHandler, + private PayPalOrderEventProcessor $payPalOrderEventProcessor + ) {} /** * {@inheritdoc} @@ -149,99 +78,22 @@ public static function getSubscribedEvents() public function saveCreatedPayPalOrder(PayPalOrderCreatedEvent $event) { - $order = $event->getOrderPayPal(); - - try { // NOT SURE WHAT SHOULD HAPPEN IF ORDER WITH THAT ID ALREADY EXISTS - $payPalOrder = $this->payPalOrderRepository->getPayPalOrderByCartId($event->getCartId()->getValue()); - $this->payPalOrderRepository->deletePayPalOrder($payPalOrder->getId()); - } catch (Exception $e) { - } - - $this->commandBus->handle(new SavePayPalOrderCommand( - $order, - $event->getCartId(), - $event->getFundingSource(), - $this->payPalConfiguration->getPaymentMode(), - $event->getCustomerIntent(), - $event->isExpressCheckout(), - $event->isCardFields(), - $event->getPaymentTokenId() - )); - - $this->commandBus->handle(new SaveCheckoutCommand( - $event->getCartId()->getValue(), - $event->getOrderPayPalId()->getValue(), - $order['status'], - isset($order['intent']) ? $order['intent'] : $this->payPalConfiguration->getIntent(), - $event->getFundingSource(), - $event->isExpressCheckout(), - $event->isCardFields(), - $this->payPalConfiguration->getPaymentMode() - )); + $this->payPalOrderEventProcessor->saveCreatedPayPalOrder($event); } public function saveApprovedPayPalOrder(PayPalOrderApprovedEvent $event) { - $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($event->getOrderPayPalId()->getValue()); - - if (false === $psCheckoutCart) { - throw new PsCheckoutException(sprintf('PayPal Order %s is not linked to a cart', $event->getOrderPayPalId()->getValue()), PsCheckoutException::PRESTASHOP_CART_NOT_FOUND); - } - - if (!$this->checkTransitionPayPalOrderStatusService->checkAvailableStatus($psCheckoutCart->getPaypalStatus(), PayPalOrderStatus::APPROVED)) { - return; - } - - try { - $this->commandBus->handle(new SavePayPalOrderCommand($event->getOrderPayPal())); - } catch (Exception $exception) { - } - - $this->commandBus->handle(new SavePayPalOrderStatusCommand( - $event->getOrderPayPalId()->getValue(), - PayPalOrderStatus::APPROVED - )); + $this->payPalOrderEventProcessor->saveApprovedPayPalOrder($event); } public function saveCompletedPayPalOrder(PayPalOrderCompletedEvent $event) { - $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($event->getOrderPayPalId()->getValue()); - - if (false === $psCheckoutCart) { - throw new PsCheckoutException(sprintf('PayPal Order %s is not linked to a cart', $event->getOrderPayPalId()->getValue()), PsCheckoutException::PRESTASHOP_CART_NOT_FOUND); - } - - if (!$this->checkTransitionPayPalOrderStatusService->checkAvailableStatus($psCheckoutCart->getPaypalStatus(), PayPalOrderStatus::COMPLETED)) { - return; - } - - try { - $this->commandBus->handle(new SavePayPalOrderCommand($event->getOrderPayPal())); - } catch (Exception $exception) { - } - - $this->commandBus->handle(new SavePayPalOrderStatusCommand( - $event->getOrderPayPalId()->getValue(), - PayPalOrderStatus::COMPLETED - )); + $this->payPalOrderEventProcessor->saveCompletedPayPalOrder($event); } public function saveApprovalReversedPayPalOrder(PayPalOrderApprovalReversedEvent $event) { - $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($event->getOrderPayPalId()->getValue()); - - if (false === $psCheckoutCart) { - throw new PsCheckoutException(sprintf('PayPal Order %s is not linked to a cart', $event->getOrderPayPalId()->getValue()), PsCheckoutException::PRESTASHOP_CART_NOT_FOUND); - } - - if (!$this->checkTransitionPayPalOrderStatusService->checkAvailableStatus($psCheckoutCart->getPaypalStatus(), PayPalOrderStatus::REVERSED)) { - return; - } - - $this->commandBus->handle(new SavePayPalOrderStatusCommand( - $event->getOrderPayPalId()->getValue(), - PayPalOrderStatus::REVERSED - )); + $this->payPalOrderEventProcessor->saveApprovalReversedPayPalOrder($event); } public function capturePayPalOrder(PayPalOrderApprovedEvent $event) @@ -263,60 +115,29 @@ public function capturePayPalOrder(PayPalOrderApprovedEvent $event) $this->checkoutChecker->continueWithAuthorization($psCheckoutCart->getIdCart(), $event->getOrderPayPal()); - $this->commandBus->handle( - new CapturePayPalOrderCommand( - $event->getOrderPayPalId()->getValue(), - $psCheckoutCart->getPaypalFundingSource() - ) - ); + $this->capturePayPalOrderCommandHandler->handle( new CapturePayPalOrderCommand( + $event->getOrderPayPalId()->getValue(), + $psCheckoutCart->getPaypalFundingSource() + )); } public function setApprovalReversedOrderStatus(PayPalOrderApprovalReversedEvent $event) { - try { - /** @var GetOrderForApprovalReversedQueryResult $order */ - $order = $this->commandBus->handle( - new GetOrderForApprovalReversedQuery( - $event->getOrderPayPalId()->getValue() - ) - ); - } catch (OrderNotFoundException $exception) { - return; - } - - if ($order->hasBeenCanceled() || $order->hasBeenPaid()) { - return; - } - - $this->commandBus->handle( - new UpdateOrderStatusCommand( - $order->getOrderId()->getValue(), - $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_CANCELED) - ) - ); + $this->payPalOrderEventProcessor->setApprovalReversedOrderStatus($event); } - public function updateCache(PayPalOrderEvent $event) + public function updatePayPalOrder(PayPalOrderEvent $event) { - $currentOrderPayPal = $this->orderPayPalCache->get($event->getOrderPayPalId()->getValue()); - $newOrderPayPal = $event->getOrderPayPal(); - - if ($currentOrderPayPal && !$this->checkTransitionPayPalOrderStatusService->checkAvailableStatus($currentOrderPayPal['status'], $newOrderPayPal['status'])) { - return; - } - - $this->orderPayPalCache->set($event->getOrderPayPalId()->getValue(), $newOrderPayPal); + $this->payPalOrderEventProcessor->updatePayPalOrder($event); } - public function updatePayPalOrder(PayPalOrderEvent $event) + public function updateCache(PayPalOrderEvent $event) { - $this->commandBus->handle(new SavePayPalOrderCommand( - $event->getOrderPayPal() - )); + $this->payPalOrderEventProcessor->updateCache($event); } public function clearCache(PayPalOrderEvent $event) { - $this->orderPayPalCache->delete($event->getOrderPayPalId()->getValue()); + $this->payPalOrderEventProcessor->clearCache($event); } } diff --git a/src/PayPal/Order/PayPalOrderPresenter.php b/src/PayPal/Order/PayPalOrderPresenter.php index ecfae9266..d8dae62e7 100644 --- a/src/PayPal/Order/PayPalOrderPresenter.php +++ b/src/PayPal/Order/PayPalOrderPresenter.php @@ -20,41 +20,15 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal\Order; -use Currency; -use PrestaShop\Module\PrestashopCheckout\PsCheckoutDataProvider; +use Context; use Tools; class PayPalOrderPresenter { - /** - * @var PaypalOrderDataProvider - */ - public $paypalOrderDataProvider; - - /** - * @var PsCheckoutDataProvider - */ - public $psCheckoutDataProvider; - - /** - * @var PayPalOrderTranslationProvider - */ - public $paypalOrderTranslationProvider; - - /** - * @param PaypalOrderDataProvider $paypalOrderDataProvider - * @param PsCheckoutDataProvider $psCheckoutDataProvider - * @param PayPalOrderTranslationProvider $paypalOrderTranslationProvider - */ public function __construct( - PaypalOrderDataProvider $paypalOrderDataProvider, - PsCheckoutDataProvider $psCheckoutDataProvider, - PayPalOrderTranslationProvider $paypalOrderTranslationProvider - ) { - $this->paypalOrderDataProvider = $paypalOrderDataProvider; - $this->psCheckoutDataProvider = $psCheckoutDataProvider; - $this->paypalOrderTranslationProvider = $paypalOrderTranslationProvider; - } + private PaypalOrderDataProvider $paypalOrderDataProvider, + private PayPalOrderTranslationProvider $paypalOrderTranslationProvider + ) {} /** * @param string $orderStatus @@ -95,10 +69,7 @@ public function getTotalAmountFormatted() return ''; } - return Tools::displayPrice( - (float) $this->paypalOrderDataProvider->getTotalAmount(), - Currency::getCurrencyInstance(Currency::getIdByIsoCode($this->paypalOrderDataProvider->getCurrencyCode())) - ); + return Tools::getContextLocale(Context::getContext())->formatPrice((float) $this->paypalOrderDataProvider->getTotalAmount(), $this->paypalOrderDataProvider->getCurrencyCode()); } /** diff --git a/src/PayPal/Order/PayPalOrderSummaryView.php b/src/PayPal/Order/PayPalOrderSummaryView.php index 02bf762ce..1de9b5572 100644 --- a/src/PayPal/Order/PayPalOrderSummaryView.php +++ b/src/PayPal/Order/PayPalOrderSummaryView.php @@ -23,70 +23,21 @@ use PrestaShop\Module\PrestashopCheckout\Order\OrderDataProvider; use PrestaShop\Module\PrestashopCheckout\PsCheckoutDataProvider; use PrestaShop\Module\PrestashopCheckout\Routing\Router; -use PrestaShop\Module\PrestashopCheckout\ShopContext; class PayPalOrderSummaryView { - /** - * @var PaypalOrderDataProvider - */ - private $orderPayPalDataProvider; - - /** - * @var OrderDataProvider - */ - private $orderDataProvider; - - /** - * @var PsCheckoutDataProvider - */ - private $checkoutDataProvider; - - /** - * @var Router - */ - private $router; - - /** - * @var PayPalOrderPresenter - */ - private $orderPayPalPresenter; - - /** - * @var ShopContext - */ - private $shopContext; - - /** - * @param PaypalOrderDataProvider $orderPayPalDataProvider - * @param OrderDataProvider $orderDataProvider - * @param PsCheckoutDataProvider $checkoutDataProvider - * @param Router $router - * @param PayPalOrderPresenter $orderPayPalPresenter - * @param ShopContext $shopContext - */ public function __construct( - PaypalOrderDataProvider $orderPayPalDataProvider, - OrderDataProvider $orderDataProvider, - PsCheckoutDataProvider $checkoutDataProvider, - Router $router, - PayPalOrderPresenter $orderPayPalPresenter, - ShopContext $shopContext - ) { - $this->orderPayPalDataProvider = $orderPayPalDataProvider; - $this->orderDataProvider = $orderDataProvider; - $this->checkoutDataProvider = $checkoutDataProvider; - $this->router = $router; - $this->orderPayPalPresenter = $orderPayPalPresenter; - $this->shopContext = $shopContext; - } + private PaypalOrderDataProvider $orderPayPalDataProvider, + private OrderDataProvider $orderDataProvider, + private PsCheckoutDataProvider $checkoutDataProvider, + private Router $router, + private PayPalOrderPresenter $orderPayPalPresenter + ) {} /** * Returns an array of template variables for smarty - * - * @return array */ - public function getTemplateVars() + public function getTemplateVars(): array { $orderStatus = $this->orderPayPalDataProvider->getOrderStatus() ? $this->orderPayPalDataProvider->getOrderStatus() : $this->checkoutDataProvider->getPaypalOrderStatus(); $orderTransactionStatus = $this->orderPayPalDataProvider->getTransactionStatus(); @@ -106,7 +57,6 @@ public function getTemplateVars() 'approvalLink' => $this->orderPayPalDataProvider->getApprovalLink(), 'payerActionLink' => $this->orderPayPalDataProvider->getPayActionLink(), 'contactUsLink' => $this->router->getContactLink($this->orderDataProvider->getOrderId()), - 'isShop17' => $this->shopContext->isShop17(), 'translations' => $this->orderPayPalPresenter->getSummaryTranslations(), 'vault' => $this->orderPayPalDataProvider->isIntentToVault(), 'tokenIdentifier' => $this->orderPayPalDataProvider->getPaymentTokenIdentifier(), diff --git a/src/PayPal/Order/PayPalOrderSummaryViewBuilder.php b/src/PayPal/Order/PayPalOrderSummaryViewBuilder.php index 96fe7229b..3b696069e 100644 --- a/src/PayPal/Order/PayPalOrderSummaryViewBuilder.php +++ b/src/PayPal/Order/PayPalOrderSummaryViewBuilder.php @@ -34,57 +34,13 @@ class PayPalOrderSummaryViewBuilder { - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; - - /** - * @var PayPalOrderProvider - */ - private $orderPayPalProvider; - - /** - * @var Router - */ - private $router; - - /** - * @var PayPalOrderTranslationProvider - */ - private $orderPayPalTranslationProvider; - - /** - * @var ShopContext - */ - private $shopContext; - /** - * @var PayPalOrderRepository - */ - private $payPalOrderRepository; - - /** - * @param PsCheckoutCartRepository $psCheckoutCartRepository - * @param PayPalOrderProvider $orderPayPalProvider - * @param Router $router - * @param PayPalOrderTranslationProvider $orderPayPalTranslationProvider - * @param ShopContext $shopContext - */ public function __construct( - PsCheckoutCartRepository $psCheckoutCartRepository, - PayPalOrderProvider $orderPayPalProvider, - Router $router, - PayPalOrderTranslationProvider $orderPayPalTranslationProvider, - ShopContext $shopContext, - PayPalOrderRepository $payPalOrderRepository - ) { - $this->psCheckoutCartRepository = $psCheckoutCartRepository; - $this->orderPayPalProvider = $orderPayPalProvider; - $this->router = $router; - $this->orderPayPalTranslationProvider = $orderPayPalTranslationProvider; - $this->shopContext = $shopContext; - $this->payPalOrderRepository = $payPalOrderRepository; - } + private PsCheckoutCartRepository $psCheckoutCartRepository, + private PayPalOrderProvider $orderPayPalProvider, + private Router $router, + private PayPalOrderTranslationProvider $orderPayPalTranslationProvider, + private PayPalOrderRepository $payPalOrderRepository + ) {} /** * @param Order $order @@ -129,8 +85,7 @@ public function build(Order $order) new OrderDataProvider($order), $checkoutDataProvider, $this->router, - new PayPalOrderPresenter($orderPayPalDataProvider, $checkoutDataProvider, $this->orderPayPalTranslationProvider), - $this->shopContext + new PayPalOrderPresenter($orderPayPalDataProvider, $this->orderPayPalTranslationProvider) ); } } diff --git a/src/PayPal/Order/PayPalOrderTranslationProvider.php b/src/PayPal/Order/PayPalOrderTranslationProvider.php index 27a9e2393..1689761dd 100644 --- a/src/PayPal/Order/PayPalOrderTranslationProvider.php +++ b/src/PayPal/Order/PayPalOrderTranslationProvider.php @@ -25,26 +25,13 @@ class PayPalOrderTranslationProvider { - /** - * @var array - */ - private $translations; + private array $translations; - /** - * @var FundingSourceTranslationProvider - */ - private $fundingSourceTranslationProvider; - - /** - * @param Translations $translations - * @param FundingSourceTranslationProvider $fundingSourceTranslationProvider - */ public function __construct( Translations $translations, - FundingSourceTranslationProvider $fundingSourceTranslationProvider + private FundingSourceTranslationProvider $fundingSourceTranslationProvider ) { $this->translations = current($translations->getTranslations()); - $this->fundingSourceTranslationProvider = $fundingSourceTranslationProvider; } /** @@ -54,9 +41,7 @@ public function __construct( */ public function getTransactionStatusTranslated($transactionStatus) { - return isset($this->translations['paypal']['capture']['status'][$transactionStatus]) - ? $this->translations['paypal']['capture']['status'][$transactionStatus] - : ''; + return $this->translations['paypal']['capture']['status'][$transactionStatus] ?? ''; } /** @@ -66,9 +51,7 @@ public function getTransactionStatusTranslated($transactionStatus) */ public function getOrderStatusTranslated($orderStatus) { - return isset($this->translations['paypal']['order']['status'][$orderStatus]) - ? $this->translations['paypal']['order']['status'][$orderStatus] - : ''; + return $this->translations['paypal']['order']['status'][$orderStatus] ?? ''; } /** diff --git a/src/PayPal/Order/PaypalOrderDataProvider.php b/src/PayPal/Order/PaypalOrderDataProvider.php index ed5c296ef..b2c0fc1aa 100644 --- a/src/PayPal/Order/PaypalOrderDataProvider.php +++ b/src/PayPal/Order/PaypalOrderDataProvider.php @@ -159,12 +159,15 @@ public function isTokenSaved() public function getPaymentTokenIdentifier() { if ($this->payPalOrder) { - $paymentSource = $this->payPalOrder->getPaymentSource()[$this->payPalOrder->getFundingSource()]; - - if ($this->payPalOrder->getFundingSource() === 'card') { - return (isset($paymentSource['brand']) ? $paymentSource['brand'] : '') . (isset($paymentSource['last_digits']) ? ' *' . $paymentSource['last_digits'] : ''); - } else { - return isset($paymentSource['email_address']) ? $paymentSource['email_address'] : ''; + $fundingSource = $this->payPalOrder->getFundingSource(); + if (isset($this->payPalOrder->getPaymentSource()[$fundingSource])) { + $paymentSource = $this->payPalOrder->getPaymentSource()[$fundingSource]; + + if ($fundingSource === 'card') { + return (isset($paymentSource['brand']) ? $paymentSource['brand'] : '') . (isset($paymentSource['last_digits']) ? ' *' . $paymentSource['last_digits'] : ''); + } else { + return isset($paymentSource['email_address']) ? $paymentSource['email_address'] : ''; + } } } diff --git a/src/PayPal/Order/QueryHandler/GetCurrentPayPalOrderStatusQueryHandler.php b/src/PayPal/Order/QueryHandler/GetCurrentPayPalOrderStatusQueryHandler.php index bcea288d6..048459ecd 100644 --- a/src/PayPal/Order/QueryHandler/GetCurrentPayPalOrderStatusQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetCurrentPayPalOrderStatusQueryHandler.php @@ -29,17 +29,10 @@ class GetCurrentPayPalOrderStatusQueryHandler { - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; + public function __construct(private PsCheckoutCartRepository $psCheckoutCartRepository) + {} - public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) - { - $this->psCheckoutCartRepository = $psCheckoutCartRepository; - } - - public function handle(GetCurrentPayPalOrderStatusQuery $getPayPalOrderQuery) + public function __invoke(GetCurrentPayPalOrderStatusQuery $getPayPalOrderQuery) { try { $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($getPayPalOrderQuery->getOrderPayPalId()->getValue()); diff --git a/src/PayPal/Order/QueryHandler/GetPayPalOrderForAdminViewQueryHandler.php b/src/PayPal/Order/QueryHandler/GetPayPalOrderForAdminViewQueryHandler.php index c41d2f7a4..8fd679c7d 100644 --- a/src/PayPal/Order/QueryHandler/GetPayPalOrderForAdminViewQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetPayPalOrderForAdminViewQueryHandler.php @@ -25,7 +25,7 @@ class GetPayPalOrderForAdminViewQueryHandler { - public function handle(GetPayPalOrderForAdminViewQuery $query) + public function __invoke(GetPayPalOrderForAdminViewQuery $query) { return new GetPayPalOrderForAdminViewQueryResult(); } diff --git a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php index 256e36a68..8c95ad635 100644 --- a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php @@ -24,24 +24,12 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCartIdQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCartIdQueryResult; use PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository; -use Psr\SimpleCache\CacheInterface; +use Symfony\Component\Cache\Adapter\ChainAdapter; class GetPayPalOrderForCartIdQueryHandler { - /** - * @var CacheInterface - */ - private $orderPayPalCache; - /** - * @var PsCheckoutCartRepository - */ - private $checkoutCartRepository; - - public function __construct(CacheInterface $orderPayPalCache, PsCheckoutCartRepository $checkoutCartRepository) - { - $this->orderPayPalCache = $orderPayPalCache; - $this->checkoutCartRepository = $checkoutCartRepository; - } + public function __construct(private ChainAdapter $orderPayPalCache, private PsCheckoutCartRepository $checkoutCartRepository) + {} /** * @param GetPayPalOrderForCartIdQuery $getPayPalOrderQuery @@ -50,12 +38,12 @@ public function __construct(CacheInterface $orderPayPalCache, PsCheckoutCartRepo * * @throws PayPalOrderException */ - public function handle(GetPayPalOrderForCartIdQuery $getPayPalOrderQuery) + public function __invoke(GetPayPalOrderForCartIdQuery $getPayPalOrderQuery) { $psCheckoutCart = $this->checkoutCartRepository->findOneByCartId($getPayPalOrderQuery->getCartId()->getValue()); /** @var array $order */ - $order = $this->orderPayPalCache->get($psCheckoutCart->getPaypalOrderId()); + $order = $this->orderPayPalCache->getItem($psCheckoutCart->getPaypalOrderId())->get(); if (empty($order)) { throw new PayPalOrderException('PayPal order not found', PayPalOrderException::CANNOT_RETRIEVE_ORDER); diff --git a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php index 6c4a439cc..05dbf3f6c 100644 --- a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php @@ -27,43 +27,41 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQueryResult; use PrestaShop\Module\PrestashopCheckout\PaypalOrder; -use Psr\SimpleCache\CacheInterface; +use Symfony\Component\Cache\Adapter\ChainAdapter; /** * We need to know if the Order Status is APPROVED and in case of Card payment if 3D Secure allow to capture */ class GetPayPalOrderForCheckoutCompletedQueryHandler { - /** - * @var CacheInterface - */ - private $orderPayPalCache; + public function __construct(private ChainAdapter $orderPayPalCache) + {} - public function __construct(CacheInterface $orderPayPalCache) + public function __invoke(GetPayPalOrderForCheckoutCompletedQuery $getPayPalOrderQuery) { - $this->orderPayPalCache = $orderPayPalCache; - } + $payPalOrderId = $getPayPalOrderQuery->getOrderPayPalId()->getValue(); - public function handle(GetPayPalOrderForCheckoutCompletedQuery $getPayPalOrderQuery) - { - /** @var array{id: string, status: string} $order */ - $order = $this->orderPayPalCache->get($getPayPalOrderQuery->getOrderPayPalId()->getValue()); + /** @var array{id: string, status: string}|array $order */ + $order = $this->orderPayPalCache->getItem($payPalOrderId)->get(); - if (!empty($order) && $order['status'] === 'APPROVED') { + if (!empty($order) && in_array($order['status'], ['COMPLETED', 'CANCELED'])) { return new GetPayPalOrderForCheckoutCompletedQueryResult($order); } try { - $orderPayPal = new PaypalOrder($getPayPalOrderQuery->getOrderPayPalId()->getValue()); - $this->orderPayPalCache->set($getPayPalOrderQuery->getOrderPayPalId()->getValue(), $orderPayPal->getOrder()); + $orderPayPal = new PaypalOrder($payPalOrderId); + $orderToStoreInCache = !empty($order) ? array_replace_recursive($order, $orderPayPal->getOrder()) : $orderPayPal->getOrder(); + $cacheItem = $this->orderPayPalCache->getItem($payPalOrderId); + $cacheItem->set($orderToStoreInCache); + $this->orderPayPalCache->save($cacheItem); } catch (HttpTimeoutException $exception) { throw $exception; } catch (Exception $exception) { - throw new PayPalOrderException(sprintf('Unable to retrieve PayPal Order %s', $getPayPalOrderQuery->getOrderPayPalId()->getValue()), PayPalOrderException::CANNOT_RETRIEVE_ORDER, $exception); + throw new PayPalOrderException(sprintf('Unable to retrieve PayPal Order %s', $payPalOrderId), PayPalOrderException::CANNOT_RETRIEVE_ORDER, $exception); } if (!$orderPayPal->isLoaded()) { - throw new PayPalOrderException(sprintf('No data for PayPal Order %s', $getPayPalOrderQuery->getOrderPayPalId()->getValue()), PayPalOrderException::EMPTY_ORDER_DATA); + throw new PayPalOrderException(sprintf('No data for PayPal Order %s', $payPalOrderId), PayPalOrderException::EMPTY_ORDER_DATA); } return new GetPayPalOrderForCheckoutCompletedQueryResult($orderPayPal->getOrder()); diff --git a/src/PayPal/Order/QueryHandler/GetPayPalOrderForOrderConfirmationQueryHandler.php b/src/PayPal/Order/QueryHandler/GetPayPalOrderForOrderConfirmationQueryHandler.php index 9e536a942..7f746cdbc 100644 --- a/src/PayPal/Order/QueryHandler/GetPayPalOrderForOrderConfirmationQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetPayPalOrderForOrderConfirmationQueryHandler.php @@ -25,26 +25,21 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForOrderConfirmationQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForOrderConfirmationQueryResult; use PrestaShop\Module\PrestashopCheckout\PaypalOrder; -use Psr\SimpleCache\CacheInterface; +use Symfony\Component\Cache\Adapter\ChainAdapter; class GetPayPalOrderForOrderConfirmationQueryHandler { - /** - * @var CacheInterface - */ - private $orderPayPalCache; + public function __construct(private ChainAdapter $orderPayPalCache) + {} - public function __construct(CacheInterface $orderPayPalCache) - { - $this->orderPayPalCache = $orderPayPalCache; - } - - public function handle(GetPayPalOrderForOrderConfirmationQuery $query) + public function __invoke(GetPayPalOrderForOrderConfirmationQuery $query) { /** @var array{id: string, status: string} $order */ - $order = $this->orderPayPalCache->get($query->getOrderPayPalId()->getValue()); + $order = $this->orderPayPalCache->get($query->getOrderPayPalId()->getValue(), function () use ($query) { + return (new PaypalOrder($query->getOrderPayPalId()->getValue()))->getOrder(); + }); - if (!empty($order) && ($order['status'] === 'PENDING' || $order['status'] === 'COMPLETED')) { + if ($order['status'] === 'PENDING' || $order['status'] === 'COMPLETED') { return new GetPayPalOrderForOrderConfirmationQueryResult($order); } diff --git a/src/PayPal/Order/QueryHandler/GetPayPalOrderQueryHandler.php b/src/PayPal/Order/QueryHandler/GetPayPalOrderQueryHandler.php index 2b1df02a4..6485ee4bf 100644 --- a/src/PayPal/Order/QueryHandler/GetPayPalOrderQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetPayPalOrderQueryHandler.php @@ -24,24 +24,12 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderQueryResult; use PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository; -use Psr\SimpleCache\CacheInterface; +use Symfony\Component\Cache\Adapter\ChainAdapter; class GetPayPalOrderQueryHandler { - /** - * @var CacheInterface - */ - private $orderCache; - /** - * @var PsCheckoutCartRepository - */ - private $checkoutCartRepository; - - public function __construct(CacheInterface $orderCache, PsCheckoutCartRepository $checkoutCartRepository) - { - $this->orderCache = $orderCache; - $this->checkoutCartRepository = $checkoutCartRepository; - } + public function __construct(private ChainAdapter $orderPayPalCache, private PsCheckoutCartRepository $checkoutCartRepository) + {} /** * @param GetPayPalOrderQuery $query @@ -50,7 +38,7 @@ public function __construct(CacheInterface $orderCache, PsCheckoutCartRepository * * @throws \PrestaShopException */ - public function handle(GetPayPalOrderQuery $query) + public function __invoke(GetPayPalOrderQuery $query) { $orderId = !$query->getOrderId()->getValue() ? null : $query->getOrderId()->getValue(); @@ -59,6 +47,6 @@ public function handle(GetPayPalOrderQuery $query) $orderId = $psCheckoutCart->paypal_order; } - return new GetPayPalOrderQueryResult($this->orderCache->get($orderId)); + return new GetPayPalOrderQueryResult($this->orderPayPalCache->getItem($orderId)->get()); } } diff --git a/src/PayPal/Order/ValueObject/PayPalOrderId.php b/src/PayPal/Order/ValueObject/PayPalOrderId.php index 1cd17f971..6fc46af2b 100644 --- a/src/PayPal/Order/ValueObject/PayPalOrderId.php +++ b/src/PayPal/Order/ValueObject/PayPalOrderId.php @@ -50,7 +50,7 @@ public function getValue() } /** - * @param string $value + * @param string|mixed $value * * @throws PayPalOrderException */ diff --git a/src/PayPal/PayPalConfiguration.php b/src/PayPal/PayPalConfiguration.php index efd1c6511..a0ee1cab2 100644 --- a/src/PayPal/PayPalConfiguration.php +++ b/src/PayPal/PayPalConfiguration.php @@ -55,21 +55,10 @@ class PayPalConfiguration const PS_CHECKOUT_DOMAIN_REGISTERED_SANDBOX = 'PS_CHECKOUT_DOMAIN_REGISTERED_SANDBOX'; const PS_CHECKOUT_DOMAIN_REGISTERED_LIVE = 'PS_CHECKOUT_DOMAIN_REGISTERED_LIVE'; - /** - * @var PrestaShopConfiguration - */ - private $configuration; - - /** - * @var PayPalCodeRepository - */ - private $codeRepository; - - public function __construct(PrestaShopConfiguration $configuration, PayPalCodeRepository $codeRepository) - { - $this->configuration = $configuration; - $this->codeRepository = $codeRepository; - } + public function __construct( + private PrestaShopConfiguration $configuration, + private PayPalCodeRepository $codeRepository + ) {} /** * Used to return the PS_CHECKOUT_INTENT from the Configuration diff --git a/src/PayPal/PayPalOrderProvider.php b/src/PayPal/PayPalOrderProvider.php index d6a189ee5..657661e99 100644 --- a/src/PayPal/PayPalOrderProvider.php +++ b/src/PayPal/PayPalOrderProvider.php @@ -20,23 +20,15 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Cache\PayPalOrderCache; use PrestaShop\Module\PrestashopCheckout\PaypalOrder; -use Psr\SimpleCache\CacheInterface; +use Symfony\Component\Cache\Adapter\ChainAdapter; +use Symfony\Contracts\Cache\ItemInterface; class PayPalOrderProvider { - /** - * @var CacheInterface - */ - private $orderPayPalCache; - - /** - * @param CacheInterface $orderPayPalCache - */ - public function __construct(CacheInterface $orderPayPalCache) - { - $this->orderPayPalCache = $orderPayPalCache; - } + public function __construct(private ChainAdapter $orderPayPalCache) + {} /** * @param string $id PayPal Order Id @@ -49,20 +41,17 @@ public function getById($id) return false; } - if ($this->orderPayPalCache->has($id)) { - return $this->orderPayPalCache->get($id); - } - - $orderPayPal = new PaypalOrder($id); - - if (!$orderPayPal->isLoaded()) { - return false; - } + return $this->orderPayPalCache->get($id, function (ItemInterface $cacheItem) use ($id) { + $orderPayPal = new PaypalOrder($id); - $data = $orderPayPal->getOrder(); + if (!$orderPayPal->isLoaded()) { + return false; + } + $order = $orderPayPal->getOrder(); - $this->orderPayPalCache->set($id, $data); + $cacheItem->expiresAfter(PayPalOrderCache::CACHE_TTL[$order['status']]); - return $data; + return $order; + }); } } diff --git a/src/PayPal/PayPalPayLaterConfiguration.php b/src/PayPal/PayPalPayLaterConfiguration.php index a71527242..49929f538 100644 --- a/src/PayPal/PayPalPayLaterConfiguration.php +++ b/src/PayPal/PayPalPayLaterConfiguration.php @@ -37,18 +37,11 @@ class PayPalPayLaterConfiguration const PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BUTTON = 'PS_CHECKOUT_PAY_IN_4X_ORDER_PAGE_BUTTON'; const PS_CHECKOUT_PAY_LATER_CART_PAGE_BUTTON = 'PS_CHECKOUT_PAY_IN_4X_CART_PAGE_BUTTON'; - /** - * @var PrestaShopConfiguration - */ - private $configuration; - /** * @param PrestaShopConfiguration $configuration */ - public function __construct(PrestaShopConfiguration $configuration) - { - $this->configuration = $configuration; - } + public function __construct(private PrestaShopConfiguration $configuration) + {} public function isOrderPageMessageActive() { diff --git a/src/PayPal/Payment/Authorization/CheckTransitionPayPalAuthorizationStatusService.php b/src/PayPal/Payment/Authorization/CheckTransitionPayPalAuthorizationStatusService.php index a60cc2ebf..b54a58a50 100644 --- a/src/PayPal/Payment/Authorization/CheckTransitionPayPalAuthorizationStatusService.php +++ b/src/PayPal/Payment/Authorization/CheckTransitionPayPalAuthorizationStatusService.php @@ -25,8 +25,8 @@ class CheckTransitionPayPalAuthorizationStatusService { /** - * @param string $oldStatus - * @param string $newStatus + * @param string|mixed $oldStatus + * @param string|mixed $newStatus * * @return bool * diff --git a/src/PayPal/Payment/Capture/CheckTransitionPayPalCaptureStatusService.php b/src/PayPal/Payment/Capture/CheckTransitionPayPalCaptureStatusService.php index 523d2ee92..8c8b36be7 100644 --- a/src/PayPal/Payment/Capture/CheckTransitionPayPalCaptureStatusService.php +++ b/src/PayPal/Payment/Capture/CheckTransitionPayPalCaptureStatusService.php @@ -25,8 +25,8 @@ class CheckTransitionPayPalCaptureStatusService { /** - * @param string $oldStatus - * @param string $newStatus + * @param string|mixed $oldStatus + * @param string|mixed $newStatus * * @return bool * diff --git a/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php b/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php index 99ce495cf..0e0d05dc3 100644 --- a/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php +++ b/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php @@ -20,10 +20,13 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\EventSubscriber; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Order\Command\AddOrderPaymentCommand; use PrestaShop\Module\PrestashopCheckout\Order\Command\CreateOrderCommand; use PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand; +use PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\AddOrderPaymentCommandHandler; +use PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\CreateOrderCommandHandler; +use PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler; use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderNotFoundException; use PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentCompletedQuery; use PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentCompletedQueryResult; @@ -41,50 +44,22 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\Event\PayPalCaptureEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\Event\PayPalCapturePendingEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\Event\PayPalCaptureReversedEvent; -use Ps_checkout; -use Psr\SimpleCache\CacheInterface; +use Symfony\Component\Cache\Adapter\AdapterInterface; +use Symfony\Component\Cache\Adapter\ChainAdapter; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class PayPalCaptureEventSubscriber implements EventSubscriberInterface { - /** - * @var CheckOrderAmount - */ - private $checkOrderAmount; - - /** - * @var CommandBusInterface - */ - private $commandBus; - - /** - * @var CacheInterface - */ - private $capturePayPalCache; - - /** - * @var CacheInterface - */ - private $orderPayPalCache; - - /** - * @var OrderStateMapper - */ - private $orderStateMapper; - public function __construct( - Ps_checkout $module, - CheckOrderAmount $checkOrderAmount, - CacheInterface $capturePayPalCache, - CacheInterface $orderPayPalCache, - OrderStateMapper $orderStateMapper - ) { - $this->checkOrderAmount = $checkOrderAmount; - $this->capturePayPalCache = $capturePayPalCache; - $this->orderPayPalCache = $orderPayPalCache; - $this->orderStateMapper = $orderStateMapper; - $this->commandBus = $module->getService('ps_checkout.bus.command'); - } + private CheckOrderAmount $checkOrderAmount, + private ChainAdapter $capturePayPalCache, + private ChainAdapter $orderPayPalCache, + private OrderStateMapper $orderStateMapper, + private QueryBusInterface $queryBus, + private CreateOrderCommandHandler $createOrderCommandHandler, + private AddOrderPaymentCommandHandler $addOrderPaymentCommandHandler, + private UpdateOrderStatusCommandHandler $updateOrderStatusCommandHandler + ) {} /** * {@inheritdoc} @@ -116,7 +91,7 @@ public static function getSubscribedEvents() public function createOrder(PayPalCaptureEvent $event) { - $this->commandBus->handle(new CreateOrderCommand( + $this->createOrderCommandHandler->handle(new CreateOrderCommand( $event->getPayPalOrderId()->getValue(), $event->getCapture() )); @@ -126,7 +101,7 @@ public function createOrderPayment(PayPalCaptureCompletedEvent $event) { try { /** @var GetOrderForPaymentCompletedQueryResult $order */ - $order = $this->commandBus->handle(new GetOrderForPaymentCompletedQuery($event->getPayPalOrderId()->getValue(), $event->getPayPalCaptureId()->getValue())); + $order = $this->queryBus->handle(new GetOrderForPaymentCompletedQuery($event->getPayPalOrderId()->getValue(), $event->getPayPalCaptureId()->getValue())); } catch (OrderNotFoundException $exception) { return; } @@ -137,7 +112,7 @@ public function createOrderPayment(PayPalCaptureCompletedEvent $event) $capture = $event->getCapture(); - $this->commandBus->handle(new AddOrderPaymentCommand( + $this->addOrderPaymentCommandHandler->handle(new AddOrderPaymentCommand( $order->getOrderId()->getValue(), $capture['create_time'], $order->getPaymentMethod(), @@ -151,7 +126,7 @@ public function setPaymentCompletedOrderStatus(PayPalCaptureCompletedEvent $even { try { /** @var GetOrderForPaymentCompletedQueryResult $order */ - $order = $this->commandBus->handle(new GetOrderForPaymentCompletedQuery($event->getPayPalOrderId()->getValue(), $event->getPayPalCaptureId()->getValue())); + $order = $this->queryBus->handle(new GetOrderForPaymentCompletedQuery($event->getPayPalOrderId()->getValue(), $event->getPayPalCaptureId()->getValue())); } catch (OrderNotFoundException $exception) { return; } @@ -163,10 +138,10 @@ public function setPaymentCompletedOrderStatus(PayPalCaptureCompletedEvent $even switch ($this->checkOrderAmount->checkAmount((string) $order->getTotalAmount(), (string) $event->getCapture()['amount']['value'])) { case CheckOrderAmount::ORDER_FULL_PAID: case CheckOrderAmount::ORDER_TO_MUCH_PAID: - $this->commandBus->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_COMPLETED))); + $this->updateOrderStatusCommandHandler->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_COMPLETED))); break; case CheckOrderAmount::ORDER_NOT_FULL_PAID: - $this->commandBus->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_PARTIALLY_PAID))); + $this->updateOrderStatusCommandHandler->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_PARTIALLY_PAID))); break; } } @@ -175,7 +150,7 @@ public function setPaymentPendingOrderStatus(PayPalCapturePendingEvent $event) { try { /** @var GetOrderForPaymentPendingQueryResult $order */ - $order = $this->commandBus->handle(new GetOrderForPaymentPendingQuery($event->getPayPalOrderId()->getValue())); + $order = $this->queryBus->handle(new GetOrderForPaymentPendingQuery($event->getPayPalOrderId()->getValue())); } catch (OrderNotFoundException $exception) { return; } @@ -184,14 +159,14 @@ public function setPaymentPendingOrderStatus(PayPalCapturePendingEvent $event) return; } - $this->commandBus->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_PENDING))); + $this->updateOrderStatusCommandHandler->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_PENDING))); } public function setPaymentDeclinedOrderStatus(PayPalCaptureDeclinedEvent $event) { try { /** @var GetOrderForPaymentDeniedQueryResult $order */ - $order = $this->commandBus->handle(new GetOrderForPaymentDeniedQuery($event->getPayPalOrderId()->getValue())); + $order = $this->queryBus->handle(new GetOrderForPaymentDeniedQuery($event->getPayPalOrderId()->getValue())); } catch (OrderNotFoundException $exception) { return; } @@ -200,14 +175,14 @@ public function setPaymentDeclinedOrderStatus(PayPalCaptureDeclinedEvent $event) return; } - $this->commandBus->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_ERROR))); + $this->updateOrderStatusCommandHandler->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_ERROR))); } public function setPaymentReversedOrderStatus(PayPalCaptureReversedEvent $event) { try { /** @var GetOrderForPaymentReversedQueryResult $order */ - $order = $this->commandBus->handle(new GetOrderForPaymentReversedQuery($event->getPayPalOrderId()->getValue())); + $order = $this->queryBus->handle(new GetOrderForPaymentReversedQuery($event->getPayPalOrderId()->getValue())); } catch (OrderNotFoundException $exception) { return; } @@ -216,22 +191,26 @@ public function setPaymentReversedOrderStatus(PayPalCaptureReversedEvent $event) return; } - $this->commandBus->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_REFUNDED))); + $this->updateOrderStatusCommandHandler->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_REFUNDED))); } public function updateCache(PayPalCaptureEvent $event) { - $this->capturePayPalCache->set($event->getPayPalCaptureId()->getValue(), $event->getCapture()); + $this->capturePayPalCache->get($event->getPayPalCaptureId()->getValue(), function () use ($event) { + return $event->getCapture(); + }); $needToClearOrderPayPalCache = true; - $orderPayPalCache = $this->orderPayPalCache->get($event->getPayPalOrderId()->getValue()); + $orderPayPalCache = $this->orderPayPalCache->getItem($event->getPayPalOrderId()->getValue())->get(); if ($orderPayPalCache && isset($orderPayPalCache['purchase_units'][0]['payments']['captures'])) { foreach ($orderPayPalCache['purchase_units'][0]['payments']['captures'] as $key => $capture) { if ($capture['id'] === $event->getPayPalCaptureId()->getValue()) { $needToClearOrderPayPalCache = false; $orderPayPalCache['purchase_units'][0]['payments']['captures'][$key] = $event->getCapture(); - $this->orderPayPalCache->set($event->getPayPalOrderId()->getValue(), $orderPayPalCache); + $this->capturePayPalCache->get($event->getPayPalCaptureId()->getValue(), function () use ($orderPayPalCache) { + return $orderPayPalCache; + }); } } } diff --git a/src/PayPal/Payment/Capture/ValueObject/PayPalCaptureId.php b/src/PayPal/Payment/Capture/ValueObject/PayPalCaptureId.php index 511ab07d0..12424a243 100644 --- a/src/PayPal/Payment/Capture/ValueObject/PayPalCaptureId.php +++ b/src/PayPal/Payment/Capture/ValueObject/PayPalCaptureId.php @@ -30,7 +30,7 @@ class PayPalCaptureId private $value; /** - * @param string $value + * @param string|mixed $value * * @throws PayPalCaptureException */ @@ -50,7 +50,7 @@ public function getValue() } /** - * @param string $value + * @param string|mixed $value * * @throws PayPalCaptureException */ diff --git a/src/PayPal/Payment/Refund/CheckTransitionPayPalRefundStatusService.php b/src/PayPal/Payment/Refund/CheckTransitionPayPalRefundStatusService.php index 245e7a07a..e808dda9a 100644 --- a/src/PayPal/Payment/Refund/CheckTransitionPayPalRefundStatusService.php +++ b/src/PayPal/Payment/Refund/CheckTransitionPayPalRefundStatusService.php @@ -25,8 +25,8 @@ class CheckTransitionPayPalRefundStatusService { /** - * @param string $oldStatus - * @param string $newStatus + * @param string|mixed $oldStatus + * @param string|mixed $newStatus * * @return bool * diff --git a/src/PayPal/Payment/Refund/CommandHandler/RefundPayPalCaptureCommandHandler.php b/src/PayPal/Payment/Refund/CommandHandler/RefundPayPalCaptureCommandHandler.php index 7705bcf80..35c5d3d58 100644 --- a/src/PayPal/Payment/Refund/CommandHandler/RefundPayPalCaptureCommandHandler.php +++ b/src/PayPal/Payment/Refund/CommandHandler/RefundPayPalCaptureCommandHandler.php @@ -22,50 +22,29 @@ use PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration; use PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext; -use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; use PrestaShop\Module\PrestashopCheckout\Exception\PayPalException; use PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Exception\PayPalOrderException; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Command\RefundPayPalCaptureCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Event\PayPalCaptureRefundedEvent; +use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\EventSubscriber\PayPalRefundEventSubscriber; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Exception\PayPalRefundFailedException; use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration; class RefundPayPalCaptureCommandHandler { - /** - * @var MaaslandHttpClient - */ - private $checkoutHttpClient; - /** - * @var PayPalConfiguration - */ - private $payPalConfiguration; - /** - * @var PrestaShopConfiguration - */ - private $prestaShopConfiguration; - /** - * @var PrestaShopContext - */ - private $prestaShopContext; - /** - * @var EventDispatcherInterface - */ - private $eventDispatcher; - public function __construct( - MaaslandHttpClient $checkoutHttpClient, - PayPalConfiguration $payPalConfiguration, - PrestaShopConfiguration $prestaShopConfiguration, - PrestaShopContext $prestaShopContext, - EventDispatcherInterface $eventDispatcher - ) { - $this->checkoutHttpClient = $checkoutHttpClient; - $this->payPalConfiguration = $payPalConfiguration; - $this->prestaShopConfiguration = $prestaShopConfiguration; - $this->prestaShopContext = $prestaShopContext; - $this->eventDispatcher = $eventDispatcher; + private MaaslandHttpClient $checkoutHttpClient, + private PayPalConfiguration $payPalConfiguration, + private PrestaShopConfiguration $prestaShopConfiguration, + private PrestaShopContext $prestaShopContext, + private PayPalRefundEventSubscriber $payPalRefundEventSubscriber + ) {} + + + public function __invoke(RefundPayPalCaptureCommand $command) + { + $this->handle($command); } /** @@ -95,12 +74,14 @@ public function handle(RefundPayPalCaptureCommand $command) ]); $refund = json_decode($response->getBody(), true); - $this->eventDispatcher->dispatch( - new PayPalCaptureRefundedEvent( - $refund['id'], - $command->getOrderPayPalId(), - $refund - ) + + $event = new PayPalCaptureRefundedEvent( + $refund['id'], + $command->getOrderPayPalId(), + $refund ); + + $this->payPalRefundEventSubscriber->setPaymentRefundedOrderStatus($event); + $this->payPalRefundEventSubscriber->updateCache($event); } } diff --git a/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php b/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php index cfe2df3f2..b3129aac2 100644 --- a/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php +++ b/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php @@ -20,8 +20,9 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\EventSubscriber; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand; +use PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler; use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderNotFoundException; use PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentRefundedQuery; use PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentRefundedQueryResult; @@ -30,48 +31,18 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Event\PayPalCaptureRefundedEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Event\PayPalRefundEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalOrderProvider; -use Ps_checkout; -use Psr\SimpleCache\CacheInterface; +use Symfony\Component\Cache\Adapter\ChainAdapter; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class PayPalRefundEventSubscriber implements EventSubscriberInterface { - /** - * @var Ps_checkout - */ - private $module; - - /** - * @var CommandBusInterface - */ - private $commandBus; - - /** - * @var CacheInterface - */ - private $orderPayPalCache; - - /** - * @var OrderStateMapper - */ - private $orderStateMapper; - /** - * @var PayPalOrderProvider - */ - private $orderProvider; - public function __construct( - Ps_checkout $module, - CacheInterface $orderPayPalCache, - OrderStateMapper $orderStateMapper, - PayPalOrderProvider $orderProvider - ) { - $this->module = $module; - $this->commandBus = $this->module->getService('ps_checkout.bus.command'); - $this->orderPayPalCache = $orderPayPalCache; - $this->orderStateMapper = $orderStateMapper; - $this->orderProvider = $orderProvider; - } + private ChainAdapter $orderPayPalCache, + private OrderStateMapper $orderStateMapper, + private PayPalOrderProvider $orderProvider, + private QueryBusInterface $queryBus, + private UpdateOrderStatusCommandHandler $updateOrderStatusCommandHandler + ) {} /** * {@inheritdoc} @@ -90,12 +61,12 @@ public function setPaymentRefundedOrderStatus(PayPalCaptureRefundedEvent $event) { try { /** @var GetOrderForPaymentRefundedQueryResult $order */ - $order = $this->commandBus->handle(new GetOrderForPaymentRefundedQuery($event->getPayPalOrderId()->getValue())); + $order = $this->queryBus->handle(new GetOrderForPaymentRefundedQuery($event->getPayPalOrderId()->getValue())); } catch (OrderNotFoundException $exception) { return; } - if ($this->orderPayPalCache->has($event->getPayPalOrderId()->getValue())) { + if ($this->orderPayPalCache->hasItem($event->getPayPalOrderId()->getValue())) { $this->orderPayPalCache->delete($event->getPayPalOrderId()->getValue()); } @@ -126,7 +97,7 @@ public function setPaymentRefundedOrderStatus(PayPalCaptureRefundedEvent $event) return; } - $this->commandBus->handle( + $this->updateOrderStatusCommandHandler->handle( new UpdateOrderStatusCommand( $order->getOrderId()->getValue(), $newOrderState @@ -136,7 +107,7 @@ public function setPaymentRefundedOrderStatus(PayPalCaptureRefundedEvent $event) public function updateCache(PayPalRefundEvent $event) { - if ($this->orderPayPalCache->has($event->getPayPalOrderId()->getValue())) { + if ($this->orderPayPalCache->hasItem($event->getPayPalOrderId()->getValue())) { $this->orderPayPalCache->delete($event->getPayPalOrderId()->getValue()); } } diff --git a/src/PayPal/PaymentToken/CommandHandler/DeletePaymentTokenCommandHandler.php b/src/PayPal/PaymentToken/CommandHandler/DeletePaymentTokenCommandHandler.php index 4635b7c35..703e5a42b 100644 --- a/src/PayPal/PaymentToken/CommandHandler/DeletePaymentTokenCommandHandler.php +++ b/src/PayPal/PaymentToken/CommandHandler/DeletePaymentTokenCommandHandler.php @@ -27,23 +27,15 @@ class DeletePaymentTokenCommandHandler { - /** @var PaymentTokenRepository */ - private $paymentTokenRepository; - /** - * @var PaymentMethodTokenService - */ - private $paymentMethodTokenService; - - public function __construct(PaymentMethodTokenService $paymentMethodTokenService, PaymentTokenRepository $paymentTokenRepository) - { - $this->paymentTokenRepository = $paymentTokenRepository; - $this->paymentMethodTokenService = $paymentMethodTokenService; - } + public function __construct( + private PaymentMethodTokenService $paymentMethodTokenService, + private PaymentTokenRepository $paymentTokenRepository + ) {} /** * @throws Exception */ - public function handle(DeletePaymentTokenCommand $command) + public function __invoke(DeletePaymentTokenCommand $command) { $tokenBelongsToCustomer = false; $tokens = $this->paymentTokenRepository->findByPrestaShopCustomerId($command->getCustomerId()->getValue()); diff --git a/src/PayPal/PaymentToken/CommandHandler/SavePaymentTokenCommandHandler.php b/src/PayPal/PaymentToken/CommandHandler/SavePaymentTokenCommandHandler.php index 89724dcf4..03b20d163 100644 --- a/src/PayPal/PaymentToken/CommandHandler/SavePaymentTokenCommandHandler.php +++ b/src/PayPal/PaymentToken/CommandHandler/SavePaymentTokenCommandHandler.php @@ -27,18 +27,13 @@ class SavePaymentTokenCommandHandler { - /** @var PaymentTokenRepository */ - private $paymentTokenRepository; - - public function __construct(PaymentTokenRepository $paymentTokenRepository) - { - $this->paymentTokenRepository = $paymentTokenRepository; - } + public function __construct(private PaymentTokenRepository $paymentTokenRepository) + {} /** * @throws Exception */ - public function handle(SavePaymentTokenCommand $command) + public function __invoke(SavePaymentTokenCommand $command) { $token = new PaymentToken( $command->getPaymentTokenId()->getValue(), diff --git a/src/PayPal/PaymentToken/EventSubscriber/PaymentMethodTokenEventSubscriber.php b/src/PayPal/PaymentToken/EventSubscriber/PaymentMethodTokenEventSubscriber.php index 6c165e039..978168f58 100644 --- a/src/PayPal/PaymentToken/EventSubscriber/PaymentMethodTokenEventSubscriber.php +++ b/src/PayPal/PaymentToken/EventSubscriber/PaymentMethodTokenEventSubscriber.php @@ -20,43 +20,24 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\EventSubscriber; +use Exception; use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; -use PrestaShop\Module\PrestashopCheckout\PayPal\Customer\ValueObject\PayPalCustomerId; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Entity\PayPalOrder; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\ValueObject\PayPalOrderId; -use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Command\SavePaymentTokenCommand; +use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Entity\PaymentToken; use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Event\PaymentTokenCreatedEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Event\PaymentTokenDeletedEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Event\PaymentTokenDeletionInitiatedEvent; -use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\ValueObject\PaymentTokenId; use PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository; use PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository; -use Ps_checkout; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class PaymentMethodTokenEventSubscriber implements EventSubscriberInterface { - /** @var Ps_checkout */ - private $module; - - /** @var CommandBusInterface */ - private $commandBus; - /** - * @var PayPalOrderRepository - */ - private $payPalOrderRepository; - /** - * @var PaymentTokenRepository - */ - private $paymentTokenRepository; - - public function __construct(Ps_checkout $module, PayPalOrderRepository $payPalOrderRepository, PaymentTokenRepository $paymentTokenRepository) - { - $this->module = $module; - $this->commandBus = $this->module->getService('ps_checkout.bus.command'); - $this->payPalOrderRepository = $payPalOrderRepository; - $this->paymentTokenRepository = $paymentTokenRepository; - } + public function __construct( + private PayPalOrderRepository $payPalOrderRepository, + private PaymentTokenRepository $paymentTokenRepository + ) {} /** * {@inheritdoc} @@ -86,19 +67,24 @@ public function saveCreatedPaymentMethodToken(PaymentTokenCreatedEvent $event) try { $order = $this->payPalOrderRepository->getPayPalOrderById(new PayPalOrderId($orderId)); $setFavorite = $order->checkCustomerIntent(PayPalOrder::CUSTOMER_INTENT_FAVORITE); - } catch (\Exception $exception) { + } catch (Exception $exception) { } } - $this->commandBus->handle(new SavePaymentTokenCommand( - new PaymentTokenId($resource['id']), - new PayPalCustomerId($resource['customer']['id']), - $resource['payment_source'][array_keys($resource['payment_source'])[0]]['verification_status'], + $token = new PaymentToken( + $resource['id'], + $resource['customer']['id'], array_keys($resource['payment_source'])[0], $resource, $event->getMerchantId(), + $resource['payment_source'][array_keys($resource['payment_source'])[0]]['verification_status'], $setFavorite - )); + ); + $this->paymentTokenRepository->save($token); + + if ($setFavorite) { + $this->paymentTokenRepository->setTokenFavorite($resource['id']); + } } public function deletePaymentMethodToken(PaymentTokenDeletedEvent $event) diff --git a/src/PayPal/PaymentToken/Query/GetCustomerPaymentTokensQueryHandler.php b/src/PayPal/PaymentToken/Query/GetCustomerPaymentTokensQueryHandler.php index 4d5077d38..4063cac33 100644 --- a/src/PayPal/PaymentToken/Query/GetCustomerPaymentTokensQueryHandler.php +++ b/src/PayPal/PaymentToken/Query/GetCustomerPaymentTokensQueryHandler.php @@ -25,18 +25,8 @@ class GetCustomerPaymentTokensQueryHandler { - /** - * @var PaymentTokenRepository - */ - private $paymentTokenRepository; - - /** - * @param PaymentTokenRepository $paymentTokenRepository - */ - public function __construct(PaymentTokenRepository $paymentTokenRepository) - { - $this->paymentTokenRepository = $paymentTokenRepository; - } + public function __construct(private PaymentTokenRepository $paymentTokenRepository) + {} /** * @param GetCustomerPaymentTokensQuery $query @@ -45,9 +35,8 @@ public function __construct(PaymentTokenRepository $paymentTokenRepository) * * @throws Exception */ - public function handle(GetCustomerPaymentTokensQuery $query) + public function __invoke(GetCustomerPaymentTokensQuery $query) { -// $paymentTokens = $this->paymentTokenRepository->findByPrestaShopCustomerId($query->getCustomerId()->getValue(), $query->getPageSize(), $query->getPageNumber()); $paymentTokens = $this->paymentTokenRepository->findByPrestaShopCustomerId($query->getCustomerId()->getValue()); if ($query->isTotalCountRequired()) { diff --git a/src/PayPal/PaymentToken/ValueObject/PaymentTokenId.php b/src/PayPal/PaymentToken/ValueObject/PaymentTokenId.php index 3e64fc6c3..4269aeba8 100644 --- a/src/PayPal/PaymentToken/ValueObject/PaymentTokenId.php +++ b/src/PayPal/PaymentToken/ValueObject/PaymentTokenId.php @@ -49,7 +49,7 @@ public function getValue() } /** - * @param string $id + * @param string|mixed $id * * @return void * diff --git a/src/PayPal/Sdk/PayPalSdkConfigurationBuilder.php b/src/PayPal/Sdk/PayPalSdkConfigurationBuilder.php index 703d87c3f..453aa0823 100644 --- a/src/PayPal/Sdk/PayPalSdkConfigurationBuilder.php +++ b/src/PayPal/Sdk/PayPalSdkConfigurationBuilder.php @@ -21,13 +21,14 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal\Sdk; use Exception; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext; use PrestaShop\Module\PrestashopCheckout\Customer\ValueObject\CustomerId; use PrestaShop\Module\PrestashopCheckout\Environment\Env; use PrestaShop\Module\PrestashopCheckout\ExpressCheckout\ExpressCheckoutConfiguration; use PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceConfigurationRepository; use PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceEligibilityConstraint; +use PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\PayPalCustomerIdProvider; use PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQueryResult; use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration; @@ -46,85 +47,18 @@ class PayPalSdkConfigurationBuilder */ const NOT_FUNDING_SOURCES = ['google_pay', 'apple_pay']; - /** - * @var PayPalConfiguration - */ - private $configuration; - - /** - * @var PayPalPayLaterConfiguration - */ - private $payLaterConfiguration; - - /** - * @var FundingSourceConfigurationRepository - */ - private $fundingSourceConfigurationRepository; - - /** @var ExpressCheckoutConfiguration */ - private $expressCheckoutConfiguration; - - /** @var ShopContext */ - private $shopContext; - - /** @var array */ - private static $cache = []; - /** - * @var CommandBusInterface - */ - private $commandBus; - /** - * @var PrestaShopContext - */ - private $prestaShopContext; - /** - * @var LoggerInterface - */ - private $logger; - /** - * @var Env - */ - private $env; - /** - * @var FundingSourceEligibilityConstraint - */ - private $fundingSourceEligibilityConstraint; - - /** - * @param \Ps_checkout $module - * @param Env $env - * @param PayPalConfiguration $configuration - * @param PayPalPayLaterConfiguration $payLaterConfiguration - * @param FundingSourceConfigurationRepository $fundingSourceConfigurationRepository - * @param ExpressCheckoutConfiguration $expressCheckoutConfiguration - * @param ShopContext $shopContext - * @param PrestaShopContext $prestaShopContext - * @param LoggerInterface $logger - * @param FundingSourceEligibilityConstraint $fundingSourceEligibilityConstraint - */ public function __construct( - \Ps_checkout $module, - Env $env, - PayPalConfiguration $configuration, - PayPalPayLaterConfiguration $payLaterConfiguration, - FundingSourceConfigurationRepository $fundingSourceConfigurationRepository, - ExpressCheckoutConfiguration $expressCheckoutConfiguration, - ShopContext $shopContext, - PrestaShopContext $prestaShopContext, - LoggerInterface $logger, - FundingSourceEligibilityConstraint $fundingSourceEligibilityConstraint - ) { - $this->configuration = $configuration; - $this->payLaterConfiguration = $payLaterConfiguration; - $this->fundingSourceConfigurationRepository = $fundingSourceConfigurationRepository; - $this->expressCheckoutConfiguration = $expressCheckoutConfiguration; - $this->shopContext = $shopContext; - $this->commandBus = $module->getService('ps_checkout.bus.command'); - $this->prestaShopContext = $prestaShopContext; - $this->logger = $logger; - $this->env = $env; - $this->fundingSourceEligibilityConstraint = $fundingSourceEligibilityConstraint; - } + private Env $env, + private PayPalConfiguration $configuration, + private PayPalPayLaterConfiguration $payLaterConfiguration, + private FundingSourceConfigurationRepository $fundingSourceConfigurationRepository, + private ExpressCheckoutConfiguration $expressCheckoutConfiguration, + private ShopContext $shopContext, + private PrestaShopContext $prestaShopContext, + private LoggerInterface $psCheckoutLogger, + private FundingSourceEligibilityConstraint $fundingSourceEligibilityConstraint, + private QueryBusInterface $queryBus + ) {} /** * @return array @@ -171,10 +105,10 @@ public function buildConfiguration() if ($this->configuration->isVaultingEnabled() && $this->prestaShopContext->customerIsLogged() && $this->prestaShopContext->getCustomerId() && 'order' === $this->getPageName()) { try { /** @var GetPayPalGetUserIdTokenQueryResult $queryResult */ - $queryResult = $this->commandBus->handle(new GetPayPalGetUserIdTokenQuery(new CustomerId($this->prestaShopContext->getCustomerId()))); + $queryResult = $this->queryBus->handle(new GetPayPalGetUserIdTokenQuery(new CustomerId($this->prestaShopContext->getCustomerId()))); $params['dataUserIdToken'] = $queryResult->getUserIdToken(); } catch (Exception $exception) { - $this->logger->error('Failed to get PayPal User ID token.', ['exception' => $exception]); + $this->psCheckoutLogger->error('Failed to get PayPal User ID token.', ['exception' => $exception]); } } diff --git a/src/PaypalCountryCodeMatrice.php b/src/PaypalCountryCodeMatrice.php index 97c46a26a..077a58673 100644 --- a/src/PaypalCountryCodeMatrice.php +++ b/src/PaypalCountryCodeMatrice.php @@ -34,7 +34,7 @@ class PaypalCountryCodeMatrice /** * Get the PayPal ISO code from PrestaShop ISO Code * - * @param string $isoCode + * @param string|mixed $isoCode * * @return string|false */ @@ -54,7 +54,7 @@ public function getPaypalIsoCode($isoCode) /** * Get the PrestaShop ISO code from PayPal ISO Code * - * @param string $isoCode + * @param string|mixed $isoCode * * @return string|false */ @@ -64,7 +64,7 @@ public function getPrestashopIsoCode($isoCode) return false; } - if (false === array_search($isoCode, self::MATCH_ISO_CODE)) { + if (!in_array($isoCode, self::MATCH_ISO_CODE)) { return $isoCode; } diff --git a/src/Presenter/Order/OrderPresenter.php b/src/Presenter/Order/OrderPresenter.php index 9e1a9a076..66804105f 100644 --- a/src/Presenter/Order/OrderPresenter.php +++ b/src/Presenter/Order/OrderPresenter.php @@ -258,63 +258,6 @@ private function getTransactionType($type) ]; } - private function getTotal() - { - if (empty($this->orderPayPal['purchase_units'])) { - return '0'; - } - - $total = 0.0; - $currency = ''; - - foreach ($this->orderPayPal['purchase_units'] as $purchase) { - if (empty($purchase['payments'])) { - continue; - } - - $total += (float) $purchase['amount']['value']; - $currency = $purchase['amount']['currency_code']; - } - - return number_format($total, 2) . " $currency"; - } - - private function getBalance() - { - if (empty($this->orderPayPal['purchase_units'])) { - return '0'; - } - - $balance = 0.0; - $totalRefunded = 0.0; - $currency = ''; - - foreach ($this->orderPayPal['purchase_units'] as $purchase) { - if (empty($purchase['payments'])) { - continue; - } - - $currency = $purchase['amount']['currency_code']; - - if (!empty($purchase['payments']['refunds'])) { - foreach ($purchase['payments']['refunds'] as $refund) { - $totalRefunded += $refund['amount']['value']; - } - } - - if (!empty($purchase['payments']['captures'])) { - foreach ($purchase['payments']['captures'] as $payment) { - $balance += $payment['amount']['value']; - if (isset($payment['seller_receivable_breakdown']['paypal_fee']['value'])) { - $balance -= $payment['seller_receivable_breakdown']['paypal_fee']['value']; - } - } - } - } - - return number_format($balance - $totalRefunded, 2) . " $currency"; - } - /** * returns order total, balance and fees. * Added into one function because they all require same foreach diff --git a/src/Presenter/Store/Modules/ConfigurationModule.php b/src/Presenter/Store/Modules/ConfigurationModule.php index 8b8dc9284..26f349540 100644 --- a/src/Presenter/Store/Modules/ConfigurationModule.php +++ b/src/Presenter/Store/Modules/ConfigurationModule.php @@ -34,49 +34,13 @@ */ class ConfigurationModule implements PresenterInterface { - /** - * @var PayPalPayLaterConfiguration - */ - private $payLaterConfiguration; - - /** - * @var ExpressCheckoutConfiguration - */ - private $ecConfiguration; - - /** - * @var PayPalConfiguration - */ - private $paypalConfiguration; - - /** - * @var FundingSourceProvider - */ - private $fundingSourceProvider; - /** - * @var Ps_checkout - */ - private $module; - - /** - * @param PayPalPayLaterConfiguration $payLaterConfiguration - * @param ExpressCheckoutConfiguration $ecConfiguration - * @param PayPalConfiguration $paypalConfiguration - * @param FundingSourceProvider $fundingSourceProvider - */ public function __construct( - PayPalPayLaterConfiguration $payLaterConfiguration, - ExpressCheckoutConfiguration $ecConfiguration, - PayPalConfiguration $paypalConfiguration, - FundingSourceProvider $fundingSourceProvider, - Ps_checkout $module - ) { - $this->payLaterConfiguration = $payLaterConfiguration; - $this->ecConfiguration = $ecConfiguration; - $this->paypalConfiguration = $paypalConfiguration; - $this->fundingSourceProvider = $fundingSourceProvider; - $this->module = $module; - } + private PayPalPayLaterConfiguration $payLaterConfiguration, + private ExpressCheckoutConfiguration $ecConfiguration, + private PayPalConfiguration $paypalConfiguration, + private FundingSourceProvider $fundingSourceProvider, + private Ps_checkout $psCheckout + ) {} /** * Present the paypal module (vuex) @@ -183,7 +147,7 @@ private function checkNonDecimalCurrencies() $nonDecimalCurrencies = ['HUF', 'JPY', 'TWD']; // Enabled currencies for PrestaShop Checkout - $enabledCurrencies = \Currency::getPaymentCurrencies($this->module->id); + $enabledCurrencies = \Currency::getPaymentCurrencies($this->psCheckout->id); $misConfiguredCurrencies = []; @@ -200,18 +164,4 @@ private function checkNonDecimalCurrencies() 'currencies' => $implodedMisconfiguredCurrencies, ]; } - - /** - * @param array $currency - * - * @return bool - */ - private function checkCurrencyPrecision($currency) - { - if (isset($currency['precision'])) { - return (int) $currency['precision'] !== 0; - } - - return (int) $currency['decimals'] !== 0; - } } diff --git a/src/Presenter/Store/Modules/ContextModule.php b/src/Presenter/Store/Modules/ContextModule.php index 0d1bb4119..0addf3fc7 100644 --- a/src/Presenter/Store/Modules/ContextModule.php +++ b/src/Presenter/Store/Modules/ContextModule.php @@ -20,6 +20,7 @@ namespace PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules; +use Context; use PrestaShop\Module\PrestashopCheckout\Adapter\LinkAdapter; use PrestaShop\Module\PrestashopCheckout\Builder\ModuleLink\ModuleLinkBuilder; use PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext; @@ -33,101 +34,32 @@ use PrestaShop\Module\PrestashopCheckout\Shop\ShopProvider; use PrestaShop\Module\PrestashopCheckout\ShopContext; use PrestaShop\Module\PrestashopCheckout\Translations\Translations; +use PrestaShop\PrestaShop\Core\Addon\Module\ModuleManagerBuilder; +use PrestaShop\PrestaShop\Core\Module\ModuleManager; +use Ps_checkout; +use Shop; /** * Construct the context module */ class ContextModule implements PresenterInterface { - /** - * @var string - */ - private $moduleName; - - /** - * @var string - */ - private $moduleKey; - - /** - * @var PrestaShopContext - */ - private $psContext; - - /** - * @var PayPalConfiguration - */ - private $paypalConfiguration; - - /** - * @var LiveStep - */ - private $liveStep; - - /** - * @var ValueBanner - */ - private $valueBanner; - - /** - * @var Translations - */ - private $translations; - - /** - * @var ShopContext - */ - private $shopContext; - - /** - * @var ShopProvider - */ - private $shopProvider; + private ModuleManager $moduleManager; - /** - * @var ModuleLinkBuilder - */ - private $moduleLinkBuilder; - /** - * @var PsAccountRepository - */ - private $psAccountRepository; - - /** - * @param string $moduleName - * @param string $moduleKey - * @param PrestaShopContext $psContext - * @param PayPalConfiguration $payPalConfiguration - * @param LiveStep $liveStep - * @param ValueBanner $valueBanner - * @param Translations $translations - * @param ShopContext $shopContext - * @param ShopProvider $shopProvider - */ public function __construct( - $moduleName, - $moduleKey, - PrestaShopContext $psContext, - PayPalConfiguration $payPalConfiguration, - LiveStep $liveStep, - ValueBanner $valueBanner, - Translations $translations, - ShopContext $shopContext, - ShopProvider $shopProvider, - ModuleLinkBuilder $moduleLinkBuilder, - PsAccountRepository $psAccountRepository + private $moduleName, + private $moduleKey, + private PrestaShopContext $psContext, + private PayPalConfiguration $payPalConfiguration, + private LiveStep $liveStep, + private ValueBanner $valueBanner, + private Translations $translations, + private ShopContext $shopContext, + private ShopProvider $shopProvider, + private ModuleLinkBuilder $moduleLinkBuilder, + private PsAccountRepository $psAccountRepository ) { - $this->moduleName = $moduleName; - $this->moduleKey = $moduleKey; - $this->psContext = $psContext; - $this->paypalConfiguration = $payPalConfiguration; - $this->liveStep = $liveStep; - $this->valueBanner = $valueBanner; - $this->translations = $translations; - $this->shopContext = $shopContext; - $this->shopProvider = $shopProvider; - $this->moduleLinkBuilder = $moduleLinkBuilder; - $this->psAccountRepository = $psAccountRepository; + $this->moduleManager = ModuleManagerBuilder::getInstance()->build(); } /** @@ -137,15 +69,14 @@ public function __construct( */ public function present() { - $shopId = (int) \Context::getContext()->shop->id; + $shopId = (int) Context::getContext()->shop->id; return [ 'context' => [ - 'moduleVersion' => \Ps_checkout::VERSION, - 'moduleIsEnabled' => (bool) \Module::isEnabled('ps_checkout'), + 'moduleVersion' => Ps_checkout::VERSION, + 'moduleIsEnabled' => $this->moduleManager->isEnabled('ps_checkout'), 'psVersion' => _PS_VERSION_, 'phpVersion' => phpversion(), - 'shopIs17' => $this->shopContext->isShop17(), 'moduleKey' => $this->moduleKey, 'shopId' => $this->psAccountRepository->getShopUuid(), 'shopUri' => $this->shopProvider->getShopUrl($shopId), @@ -160,16 +91,16 @@ public function present() 'cguUrl' => $this->getCgu(), 'privacyPolicyUrl' => $this->getPrivacyPolicyUrl(), 'pricingUrl' => $this->getPricingUrl(), - 'roundingSettingsIsCorrect' => $this->paypalConfiguration->IsRoundingSettingsCorrect(), + 'roundingSettingsIsCorrect' => $this->payPalConfiguration->IsRoundingSettingsCorrect(), 'liveStepConfirmed' => $this->liveStep->isConfirmed(), 'liveStepViewed' => $this->liveStep->isViewed(), 'valueBannerClosed' => $this->valueBanner->isClosed(), 'youtubeInstallerLink' => $this->getYoutubeInstallerLink(), - 'incompatibleCountryCodes' => $this->paypalConfiguration->getIncompatibleCountryCodes(), - 'incompatibleCurrencyCodes' => $this->paypalConfiguration->getIncompatibleCurrencyCodes(), + 'incompatibleCountryCodes' => $this->payPalConfiguration->getIncompatibleCountryCodes(), + 'incompatibleCurrencyCodes' => $this->payPalConfiguration->getIncompatibleCurrencyCodes(), 'countriesLink' => $this->getGeneratedLink('AdminCountries'), 'currenciesLink' => $this->getGeneratedLink('AdminCurrencies'), - 'paymentPreferencesLink' => $this->getGeneratedLink($this->shopContext->isShop17() ? 'AdminPaymentPreferences' : 'AdminPayment'), + 'paymentPreferencesLink' => $this->getGeneratedLink('AdminPaymentPreferences'), 'maintenanceLink' => $this->getGeneratedLink('AdminMaintenance'), 'overridesExist' => $this->overridesExist(), 'submitIdeaLink' => $this->getSubmitIdeaLink(), @@ -177,8 +108,8 @@ public function present() 'isCustomTheme' => $this->shopUsesCustomTheme(), 'callbackUrl' => $this->moduleLinkBuilder->getPaypalOnboardingCallBackUrl(), 'dependencies' => [ - 'ps_eventbus' => \Module::isEnabled('ps_eventbus'), - 'ps_accounts' => \Module::isEnabled('ps_accounts'), + 'ps_eventbus' => $this->moduleManager->isEnabled('ps_eventbus'), + 'ps_accounts' => $this->moduleManager->isEnabled('ps_accounts'), ], ], ]; @@ -189,7 +120,7 @@ public function present() */ private function isShopContext() { - if (\Shop::isFeatureActive() && \Shop::getContext() !== \Shop::CONTEXT_SHOP) { + if (Shop::isFeatureActive() && Shop::getContext() !== Shop::CONTEXT_SHOP) { return false; } @@ -209,7 +140,7 @@ private function getShopsTree() $linkAdapter = new LinkAdapter($this->psContext->getLink()); - foreach (\Shop::getTree() as $groupId => $groupData) { + foreach (Shop::getTree() as $groupId => $groupData) { $shops = []; foreach ($groupData['shops'] as $shopId => $shopData) { @@ -321,18 +252,6 @@ private function getYoutubeInstallerLink() } } - /** - * Get the countries link - * - * @return string - */ - private function getCountriesLink() - { - $linkAdapter = new LinkAdapter($this->psContext->getLink()); - - return $linkAdapter->getAdminLink('AdminCountries'); - } - /** * Get a generated link * diff --git a/src/Presenter/Store/Modules/PaypalModule.php b/src/Presenter/Store/Modules/PaypalModule.php index cc64dcc93..b92ecdf9e 100644 --- a/src/Presenter/Store/Modules/PaypalModule.php +++ b/src/Presenter/Store/Modules/PaypalModule.php @@ -28,18 +28,8 @@ */ class PaypalModule implements PresenterInterface { - /** - * @var PayPalConfiguration - */ - private $configuration; - - /** - * @param PayPalConfiguration $configuration - */ - public function __construct(PayPalConfiguration $configuration) - { - $this->configuration = $configuration; - } + public function __construct(private PayPalConfiguration $configuration) + {} /** * Present the paypal module (vuex) diff --git a/src/Presenter/Store/StorePresenter.php b/src/Presenter/Store/StorePresenter.php index f85e0250d..fde75ec18 100644 --- a/src/Presenter/Store/StorePresenter.php +++ b/src/Presenter/Store/StorePresenter.php @@ -30,21 +30,14 @@ class StorePresenter implements PresenterInterface /** * @var PresenterInterface[] */ - private $presenters; + private array $presenters; - /** - * @var array - */ - private $store; + private array $store = []; - /** - * @param PresenterInterface[] $presenters - * @param array $store - */ - public function __construct($presenters, array $store = []) + public function __construct(array $presenters, array $store = []) { // Allow to set a custom store for tests purpose - if (null !== $store) { + if (!empty($store)) { $this->store = $store; } @@ -58,14 +51,12 @@ public function __construct($presenters, array $store = []) */ public function present() { - if ([] !== $this->store) { + if (!empty($this->store)) { return $this->store; } foreach ($this->presenters as $presenter) { - if ($presenter instanceof PresenterInterface) { - $this->store = array_merge($this->store, $presenter->present()); - } + $this->store = array_merge($this->store, $presenter->present()); } return $this->store; diff --git a/src/Repository/PayPalCustomerRepository.php b/src/Repository/PayPalCustomerRepository.php index 02eb75d8e..9e9f99d28 100644 --- a/src/Repository/PayPalCustomerRepository.php +++ b/src/Repository/PayPalCustomerRepository.php @@ -29,18 +29,8 @@ class PayPalCustomerRepository { - /** - * @var Db - */ - private $db; - - /** - * @param Db $db - */ - public function __construct(Db $db) - { - $this->db = $db; - } + public function __construct(private Db $db) + {} /** * @param CustomerId $customerId diff --git a/src/Repository/PayPalOrderRepository.php b/src/Repository/PayPalOrderRepository.php index 405d43e64..085ed0ff0 100644 --- a/src/Repository/PayPalOrderRepository.php +++ b/src/Repository/PayPalOrderRepository.php @@ -34,15 +34,8 @@ class PayPalOrderRepository { - /** - * @var Db - */ - private $db; - - public function __construct(Db $db) - { - $this->db = $db; - } + public function __construct(private Db $db) + {} /** * @param PayPalOrder $payPalOrder diff --git a/src/Repository/PaymentTokenRepository.php b/src/Repository/PaymentTokenRepository.php index 8aee6367e..0947e56d8 100644 --- a/src/Repository/PaymentTokenRepository.php +++ b/src/Repository/PaymentTokenRepository.php @@ -30,15 +30,8 @@ class PaymentTokenRepository { - /** - * @var Db - */ - private $db; - - public function __construct(Db $db) - { - $this->db = $db; - } + public function __construct(private Db $db) + {} /** * @param PaymentToken $paymentToken diff --git a/src/Repository/PsAccountRepository.php b/src/Repository/PsAccountRepository.php index 1e45463d3..c25ad7dbd 100644 --- a/src/Repository/PsAccountRepository.php +++ b/src/Repository/PsAccountRepository.php @@ -30,18 +30,10 @@ */ class PsAccountRepository { - /** @var PrestaShopConfiguration */ - private $configuration; - private $psAccountsService; - /** - * @param PrestaShopConfiguration $configuration - * @param PsAccounts $psAccountsFacade - */ - public function __construct(PrestaShopConfiguration $configuration, PsAccounts $psAccountsFacade) + public function __construct(PsAccounts $psAccountsFacade) { - $this->configuration = $configuration; try { $this->psAccountsService = $psAccountsFacade->getPsAccountsService(); } catch (Exception $exception) { diff --git a/src/Repository/PsCheckoutCartRepository.php b/src/Repository/PsCheckoutCartRepository.php index f85866f7c..0bc7c3c13 100644 --- a/src/Repository/PsCheckoutCartRepository.php +++ b/src/Repository/PsCheckoutCartRepository.php @@ -22,90 +22,67 @@ use PrestaShop\Module\PrestashopCheckout\Cart\Cache\CacheSettings; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; -use Psr\SimpleCache\CacheInterface; +use PrestaShopCollection; +use PrestaShopDatabaseException; +use PrestaShopException; +use PsCheckoutCart; +use Symfony\Component\Cache\Adapter\ArrayAdapter; +use Symfony\Contracts\Cache\ItemInterface; class PsCheckoutCartRepository { - /** - * @var CacheInterface - */ - private $cartPrestaShopCache; - - /** - * @param CacheInterface $cartPrestaShopCache - */ - public function __construct(CacheInterface $cartPrestaShopCache) - { - $this->cartPrestaShopCache = $cartPrestaShopCache; - } + public function __construct(private ArrayAdapter $cartPrestaShopCache) + {} /** * @param int $cartId * - * @return \PsCheckoutCart|false + * @return PsCheckoutCart|false * - * @throws \PrestaShopException + * @throws PrestaShopException */ public function findOneByCartId($cartId) { - if ($this->cartPrestaShopCache->has(CacheSettings::CART_ID . $cartId)) { - return $this->cartPrestaShopCache->get(CacheSettings::CART_ID . $cartId); - } - - $psCheckoutCartCollection = new \PrestaShopCollection('PsCheckoutCart'); - $psCheckoutCartCollection->where('id_cart', '=', (int) $cartId); - $psCheckoutCartCollection->orderBy('date_upd', 'desc'); - - /** @var \PsCheckoutCart|false $psCheckoutCart */ - $psCheckoutCart = $psCheckoutCartCollection->getFirst(); - - if (false !== $psCheckoutCart) { - $this->cartPrestaShopCache->setMultiple([ - CacheSettings::CART_ID . $cartId => $psCheckoutCart, - CacheSettings::PAYPAL_ORDER_ID . $psCheckoutCart->paypal_order => $psCheckoutCart, - ]); - } - - return $psCheckoutCart; + return $this->cartPrestaShopCache->get(CacheSettings::CART_ID . $cartId, function (ItemInterface $item) use ($cartId) { + $item->expiresAfter(3600); + $psCheckoutCartCollection = new PrestaShopCollection('PsCheckoutCart'); + $psCheckoutCartCollection->where('id_cart', '=', (int) $cartId); + $psCheckoutCartCollection->orderBy('date_upd', 'desc'); + + /** @var PsCheckoutCart|false $psCheckoutCart */ + $psCheckoutCart = $psCheckoutCartCollection->getFirst(); + return $psCheckoutCart; + }); } /** * @param string $payPalOrderId * - * @return \PsCheckoutCart|false + * @return PsCheckoutCart|false * - * @throws \PrestaShopException + * @throws PrestaShopException */ public function findOneByPayPalOrderId($payPalOrderId) { - if ($this->cartPrestaShopCache->has(CacheSettings::PAYPAL_ORDER_ID . $payPalOrderId)) { - return $this->cartPrestaShopCache->get(CacheSettings::PAYPAL_ORDER_ID . $payPalOrderId); - } - - $psCheckoutCartCollection = new \PrestaShopCollection('PsCheckoutCart'); - $psCheckoutCartCollection->where('paypal_order', '=', $payPalOrderId); - - /** @var \PsCheckoutCart|false $psCheckoutCart */ - $psCheckoutCart = $psCheckoutCartCollection->getFirst(); - - if (false !== $psCheckoutCart) { - $this->cartPrestaShopCache->setMultiple([ - CacheSettings::CART_ID . $psCheckoutCart->id_cart => $psCheckoutCart, - CacheSettings::PAYPAL_ORDER_ID . $payPalOrderId => $psCheckoutCart, - ]); - } - - return $psCheckoutCart; + return $this->cartPrestaShopCache->get(CacheSettings::PAYPAL_ORDER_ID . $payPalOrderId, function (ItemInterface $item) use ($payPalOrderId) { + $item->expiresAfter(3600); + $psCheckoutCartCollection = new PrestaShopCollection('PsCheckoutCart'); + $psCheckoutCartCollection->where('paypal_order', '=', $payPalOrderId); + + /** @var PsCheckoutCart|false $psCheckoutCart */ + $psCheckoutCart = $psCheckoutCartCollection->getFirst(); + return $psCheckoutCart; + }); } /** - * @param \PsCheckoutCart $psCheckoutCart + * @param PsCheckoutCart $psCheckoutCart * * @return bool * - * @throws \PrestaShopDatabaseException + * @throws PrestaShopDatabaseException */ - public function save(\PsCheckoutCart $psCheckoutCart) + public function save(PsCheckoutCart $psCheckoutCart) { if (empty($psCheckoutCart->id_cart)) { throw new PsCheckoutException('No cart found.', PsCheckoutException::PRESTASHOP_CONTEXT_INVALID); @@ -114,23 +91,25 @@ public function save(\PsCheckoutCart $psCheckoutCart) $success = $psCheckoutCart->save(); if ($success) { - $this->cartPrestaShopCache->setMultiple([ - CacheSettings::CART_ID . $psCheckoutCart->id_cart => $psCheckoutCart, - CacheSettings::PAYPAL_ORDER_ID . $psCheckoutCart->paypal_order => $psCheckoutCart, - ]); + $cacheItem = $this->cartPrestaShopCache->getItem(CacheSettings::CART_ID . $psCheckoutCart->id_cart); + $cacheItem->set($psCheckoutCart); + $this->cartPrestaShopCache->save($cacheItem); + $cacheItem = $this->cartPrestaShopCache->getItem(CacheSettings::PAYPAL_ORDER_ID . $psCheckoutCart->paypal_order); + $cacheItem->set($psCheckoutCart); + $this->cartPrestaShopCache->save($cacheItem); } return $success; } /** - * @param \PsCheckoutCart $psCheckoutCart + * @param PsCheckoutCart $psCheckoutCart * * @return bool * - * @throws \PrestaShopDatabaseException + * @throws PrestaShopDatabaseException */ - public function remove(\PsCheckoutCart $psCheckoutCart) + public function remove(PsCheckoutCart $psCheckoutCart) { if (empty($psCheckoutCart->id_cart)) { throw new PsCheckoutException('No cart found.', PsCheckoutException::PRESTASHOP_CONTEXT_INVALID); @@ -139,10 +118,8 @@ public function remove(\PsCheckoutCart $psCheckoutCart) $success = $psCheckoutCart->delete(); if ($success) { - $this->cartPrestaShopCache->deleteMultiple([ - CacheSettings::CART_ID . $psCheckoutCart->id_cart, - CacheSettings::PAYPAL_ORDER_ID . $psCheckoutCart->paypal_order, - ]); + $this->cartPrestaShopCache->delete(CacheSettings::CART_ID . $psCheckoutCart->id_cart); + $this->cartPrestaShopCache->delete(CacheSettings::PAYPAL_ORDER_ID . $psCheckoutCart->paypal_order); } return $success; diff --git a/src/Routing/Router.php b/src/Routing/Router.php index e466284a1..be34ae324 100644 --- a/src/Routing/Router.php +++ b/src/Routing/Router.php @@ -71,17 +71,4 @@ public function getDispatchWebhookLink($idShop) { return $this->context->link->getModuleLink('ps_checkout', 'DispatchWebHook', [], true, (int) Configuration::get('PS_LANG_DEFAULT'), (int) $idShop); } - - /** - * @param int $idShop - * - * @return string - */ - private function getBaseLink($idShop) - { - $shop = new Shop($idShop); - $base = Configuration::get('PS_SSL_ENABLED') ? 'https://' . $shop->domain_ssl : 'http://' . $shop->domain; - - return $base . $shop->physical_uri; - } } diff --git a/src/ShopContext.php b/src/ShopContext.php index a538d30bc..7c6a345e1 100644 --- a/src/ShopContext.php +++ b/src/ShopContext.php @@ -27,15 +27,8 @@ */ class ShopContext { - /** - * @var Env - */ - private $env; - - public function __construct(Env $env) - { - $this->env = $env; - } + public function __construct(private Env $env) + {} /** * Check if the module is installed on ready or download @@ -61,14 +54,4 @@ public function getBnCode() return $this->env->getBnCode(); } - - public function isShop17() - { - return version_compare(_PS_VERSION_, '1.7.0.0', '>='); - } - - public function isShop171() - { - return version_compare(_PS_VERSION_, '1.7.1.0', '>='); - } } diff --git a/src/Translations/Translations.php b/src/Translations/Translations.php index ebd3a2619..818d5dbee 100644 --- a/src/Translations/Translations.php +++ b/src/Translations/Translations.php @@ -20,20 +20,13 @@ namespace PrestaShop\Module\PrestashopCheckout\Translations; +use Context; +use Ps_checkout; + class Translations { - /** - * @var \Module - */ - private $module = null; - - /** - * @param \Module $module - */ - public function __construct(\Module $module) - { - $this->module = $module; - } + public function __construct(private Ps_checkout $psCheckout) + {} /** * Create all translations (backoffice) @@ -42,511 +35,511 @@ public function __construct(\Module $module) */ public function getTranslations() { - $locale = \Context::getContext()->language->iso_code; + $locale = Context::getContext()->language->iso_code; $linkTranslations = new LinksTranslations($locale); $translations[$locale] = [ 'menu' => [ - 'authentication' => $this->module->l('Authentication', 'translations'), - 'customizeCheckout' => $this->module->l('Customize checkout experience', 'translations'), - 'manageActivity' => $this->module->l('Manage Activity', 'translations'), - 'advancedSettings' => $this->module->l('Advanced settings', 'translations'), - 'help' => $this->module->l('Help', 'translations'), + 'authentication' => $this->psCheckout->l('Authentication', 'translations'), + 'customizeCheckout' => $this->psCheckout->l('Customize checkout experience', 'translations'), + 'manageActivity' => $this->psCheckout->l('Manage Activity', 'translations'), + 'advancedSettings' => $this->psCheckout->l('Advanced settings', 'translations'), + 'help' => $this->psCheckout->l('Help', 'translations'), ], 'general' => [ - 'save' => $this->module->l('Save', 'translations'), - 'testModeOn' => $this->module->l('Test mode is turned on', 'translations'), - 'wrongConfiguration' => $this->module->l('An error during configuration was detected. Please reset the PrestaShop Checkout module and configure it again.', 'translations'), + 'save' => $this->psCheckout->l('Save', 'translations'), + 'testModeOn' => $this->psCheckout->l('Test mode is turned on', 'translations'), + 'wrongConfiguration' => $this->psCheckout->l('An error during configuration was detected. Please reset the PrestaShop Checkout module and configure it again.', 'translations'), 'multiShop' => [ - 'title' => $this->module->l('Multistore detected', 'translations'), - 'subtitle' => $this->module->l('Each shop must be configured separately, even if you configure the same account on all of them.', 'translations'), - 'chooseOne' => $this->module->l('Please select the first shop to configure from the list below :', 'translations'), + 'title' => $this->psCheckout->l('Multistore detected', 'translations'), + 'subtitle' => $this->psCheckout->l('Each shop must be configured separately, even if you configure the same account on all of them.', 'translations'), + 'chooseOne' => $this->psCheckout->l('Please select the first shop to configure from the list below :', 'translations'), 'group' => 'Group:', 'configure' => 'Configure', - 'tips' => $this->module->l('Once you are done with the first shop, you can configure the others: select them one by one with the shop selector, in the horizontal menu.', 'translations'), + 'tips' => $this->psCheckout->l('Once you are done with the first shop, you can configure the others: select them one by one with the shop selector, in the horizontal menu.', 'translations'), ], 'errors' => [ - 'cantReceivePayments' => $this->module->l('There are no payment methods available. You can\'t receive payments from PayPal right now and your customers can\'t proceed to payments (anymore) via the payment methods provided by PrestaShop Checkout.', 'translations'), - 'contactPaypalCustomerService' => $this->module->l('Please contact PayPal Customer Service', 'translations'), - 'decimalCurrenciesError' => $this->module->l('Warning : the currencies you have activated : {0} are not currently supported by PrestaShop Checkout. Please deactivate {0} for PrestaShop Checkout in your', 'translations'), - 'paymentPreferences' => $this->module->l('Payment preferences', 'translations'), + 'cantReceivePayments' => $this->psCheckout->l('There are no payment methods available. You can\'t receive payments from PayPal right now and your customers can\'t proceed to payments (anymore) via the payment methods provided by PrestaShop Checkout.', 'translations'), + 'contactPaypalCustomerService' => $this->psCheckout->l('Please contact PayPal Customer Service', 'translations'), + 'decimalCurrenciesError' => $this->psCheckout->l('Warning : the currencies you have activated : {0} are not currently supported by PrestaShop Checkout. Please deactivate {0} for PrestaShop Checkout in your', 'translations'), + 'paymentPreferences' => $this->psCheckout->l('Payment preferences', 'translations'), ], ], 'pages' => [ 'accounts' => [ - 'approved' => $this->module->l('Approved', 'translations'), - 'approvalPending' => $this->module->l('Approval pending', 'translations'), - 'accountLinkingInProgress' => $this->module->l('Account Linking in progress', 'translations'), - 'waitingPaypalLinkingTitle' => $this->module->l('Onboarding almost done!', 'translations'), - 'waitingPaypalLinking' => $this->module->l('Synchronization between your store and your PayPal account is in progress. Please wait.', 'translations'), - 'emailValidationNeeded' => $this->module->l('Email validation needed', 'translations'), - 'waitingEmail' => $this->module->l('A confirmation email has been sent. Check your inbox and click on the link to activate your account.', 'translations'), - 'didntReceiveEmail' => $this->module->l('No confirmation email?', 'translations'), - 'sendEmailAgain' => $this->module->l('Send it again', 'translations'), - 'documentNeeded' => $this->module->l('Information needed', 'translations'), - 'additionalDocumentsNeeded' => $this->module->l('Additional information is required to complete background check. Please go on your www.paypal.com account and check the notification bell on the top right to know which documents are needed. It could be:', 'translations'), - 'photoIds' => $this->module->l('Credit Card information, bank account information and ID card', 'translations'), - 'knowMoreAboutAccount' => $this->module->l('Know more about my account approval', 'translations'), - 'undergoingCheck' => $this->module->l('Background check is currently undergoing', 'translations'), - 'severalDays' => $this->module->l('It can take several days. If further information is needed, you will be notified. Please check your emails or your notification bell on the top right of your www.paypal.com account and follow the instructions.', 'translations'), - 'youCanProcess' => $this->module->l('You can process', 'translations'), - 'upTo' => $this->module->l('up to $500', 'translations'), - 'transactionsUntil' => $this->module->l('in card transactions until your account is fully approved', 'translations'), - 'accountDeclined' => $this->module->l('Account declined', 'translations'), - 'cannotProcessCreditCard' => $this->module->l('Unfortunately, credit card payments cannot be processed for you at the moment. You will be able to reapply after 90 days. In the meantime, you can still receive payments via PayPal', 'translations'), - 'accountDeclinedLink' => $this->module->l('Account declined FAQs', 'translations'), - 'suspendedAlertTitle' => $this->module->l('Credit Card availability suspended', 'translations'), - 'suspendedAlertLabel' => $this->module->l('Unfortunately, credit card payments cannot be processed for you at the moment. In the meantime, you can still receive payments via PayPal. Please proceed to some actions from your PayPal account, where you should have received a notification. If not, please contact PayPal help center.', 'translations'), - 'suspendedButton' => $this->module->l('Manage your account', 'translations'), - 'revokedAlertTitle' => $this->module->l('Credit Card availability revoked', 'translations'), - 'revokedAlertLabel' => $this->module->l('Unfortunately, you have revoked PrestaShop Checkout permissions. Credit card payments cannot be processed for you. You can still receive payments via PayPal. Please, log out your PayPal account just below and link your account giving permission again. You can contact PayPal help center to have more information about your account.', 'translations'), - 'revokedButton' => $this->module->l('Manage your account', 'translations'), + 'approved' => $this->psCheckout->l('Approved', 'translations'), + 'approvalPending' => $this->psCheckout->l('Approval pending', 'translations'), + 'accountLinkingInProgress' => $this->psCheckout->l('Account Linking in progress', 'translations'), + 'waitingPaypalLinkingTitle' => $this->psCheckout->l('Onboarding almost done!', 'translations'), + 'waitingPaypalLinking' => $this->psCheckout->l('Synchronization between your store and your PayPal account is in progress. Please wait.', 'translations'), + 'emailValidationNeeded' => $this->psCheckout->l('Email validation needed', 'translations'), + 'waitingEmail' => $this->psCheckout->l('A confirmation email has been sent. Check your inbox and click on the link to activate your account.', 'translations'), + 'didntReceiveEmail' => $this->psCheckout->l('No confirmation email?', 'translations'), + 'sendEmailAgain' => $this->psCheckout->l('Send it again', 'translations'), + 'documentNeeded' => $this->psCheckout->l('Information needed', 'translations'), + 'additionalDocumentsNeeded' => $this->psCheckout->l('Additional information is required to complete background check. Please go on your www.paypal.com account and check the notification bell on the top right to know which documents are needed. It could be:', 'translations'), + 'photoIds' => $this->psCheckout->l('Credit Card information, bank account information and ID card', 'translations'), + 'knowMoreAboutAccount' => $this->psCheckout->l('Know more about my account approval', 'translations'), + 'undergoingCheck' => $this->psCheckout->l('Background check is currently undergoing', 'translations'), + 'severalDays' => $this->psCheckout->l('It can take several days. If further information is needed, you will be notified. Please check your emails or your notification bell on the top right of your www.paypal.com account and follow the instructions.', 'translations'), + 'youCanProcess' => $this->psCheckout->l('You can process', 'translations'), + 'upTo' => $this->psCheckout->l('up to $500', 'translations'), + 'transactionsUntil' => $this->psCheckout->l('in card transactions until your account is fully approved', 'translations'), + 'accountDeclined' => $this->psCheckout->l('Account declined', 'translations'), + 'cannotProcessCreditCard' => $this->psCheckout->l('Unfortunately, credit card payments cannot be processed for you at the moment. You will be able to reapply after 90 days. In the meantime, you can still receive payments via PayPal', 'translations'), + 'accountDeclinedLink' => $this->psCheckout->l('Account declined FAQs', 'translations'), + 'suspendedAlertTitle' => $this->psCheckout->l('Credit Card availability suspended', 'translations'), + 'suspendedAlertLabel' => $this->psCheckout->l('Unfortunately, credit card payments cannot be processed for you at the moment. In the meantime, you can still receive payments via PayPal. Please proceed to some actions from your PayPal account, where you should have received a notification. If not, please contact PayPal help center.', 'translations'), + 'suspendedButton' => $this->psCheckout->l('Manage your account', 'translations'), + 'revokedAlertTitle' => $this->psCheckout->l('Credit Card availability revoked', 'translations'), + 'revokedAlertLabel' => $this->psCheckout->l('Unfortunately, you have revoked PrestaShop Checkout permissions. Credit card payments cannot be processed for you. You can still receive payments via PayPal. Please, log out your PayPal account just below and link your account giving permission again. You can contact PayPal help center to have more information about your account.', 'translations'), + 'revokedButton' => $this->psCheckout->l('Manage your account', 'translations'), ], 'signin' => [ - 'logInWithYourPsAccount' => $this->module->l('Log in with your PrestaShop Checkout account', 'translations'), - 'email' => $this->module->l('Email', 'translations'), - 'password' => $this->module->l('Password', 'translations'), - 'forgotPassword' => $this->module->l('Forgot password?', 'translations'), - 'back' => $this->module->l('Back', 'translations'), - 'signup' => $this->module->l('Sign up', 'translations'), - 'login' => $this->module->l('Log in', 'translations'), + 'logInWithYourPsAccount' => $this->psCheckout->l('Log in with your PrestaShop Checkout account', 'translations'), + 'email' => $this->psCheckout->l('Email', 'translations'), + 'password' => $this->psCheckout->l('Password', 'translations'), + 'forgotPassword' => $this->psCheckout->l('Forgot password?', 'translations'), + 'back' => $this->psCheckout->l('Back', 'translations'), + 'signup' => $this->psCheckout->l('Sign up', 'translations'), + 'login' => $this->psCheckout->l('Log in', 'translations'), ], 'signup' => [ - 'createYourPsAccount' => $this->module->l('Create your PrestaShop Checkout account', 'translations'), - 'email' => $this->module->l('Email', 'translations'), - 'password' => $this->module->l('Password', 'translations'), - 'termsOfUse' => $this->module->l('I agree to the ', 'translations'), - 'termsOfUseLinkText' => $this->module->l('Terms and Conditions of Use of PrestaShop Checkout', 'translations'), + 'createYourPsAccount' => $this->psCheckout->l('Create your PrestaShop Checkout account', 'translations'), + 'email' => $this->psCheckout->l('Email', 'translations'), + 'password' => $this->psCheckout->l('Password', 'translations'), + 'termsOfUse' => $this->psCheckout->l('I agree to the ', 'translations'), + 'termsOfUseLinkText' => $this->psCheckout->l('Terms and Conditions of Use of PrestaShop Checkout', 'translations'), 'termsOfUseLink' => $linkTranslations->getCheckoutDataPolicyLink(), - 'termsOfUseError' => $this->module->l('I accept the terms of use', 'translations'), - 'mentionsTermsText' => $this->module->l('By submitting this form, I agree that the data provided may be collected by PrestaShop S.A to create your PrestaShop Checkout account. By creating your account, you will receive commercial prospecting from PrestaShop', 'Translations'), - 'mentionsTermsLinkTextPart1' => $this->module->l('except opposition here', 'translations'), - 'mentionsTermsLinkTextPart2' => $this->module->l('Learn more about managing your data and rights.', 'translations'), + 'termsOfUseError' => $this->psCheckout->l('I accept the terms of use', 'translations'), + 'mentionsTermsText' => $this->psCheckout->l('By submitting this form, I agree that the data provided may be collected by PrestaShop S.A to create your PrestaShop Checkout account. By creating your account, you will receive commercial prospecting from PrestaShop', 'Translations'), + 'mentionsTermsLinkTextPart1' => $this->psCheckout->l('except opposition here', 'translations'), + 'mentionsTermsLinkTextPart2' => $this->psCheckout->l('Learn more about managing your data and rights.', 'translations'), 'mentionsTermsLinkPart2' => $linkTranslations->getCheckoutDataPolicyLink(), - 'back' => $this->module->l('Back', 'translations'), - 'signIn' => $this->module->l('Sign in', 'translations'), - 'createAccount' => $this->module->l('Create account', 'translations'), + 'back' => $this->psCheckout->l('Back', 'translations'), + 'signIn' => $this->psCheckout->l('Sign in', 'translations'), + 'createAccount' => $this->psCheckout->l('Create account', 'translations'), ], 'resetPassword' => [ - 'resetPassword' => $this->module->l('Reset password', 'translations'), - 'youGotEmail' => $this->module->l('You’ve got an email.', 'translations'), - 'sendEmail' => $this->module->l('We sent you an email with instructions to reset your password. Please check your inbox.', 'translations'), - 'sendLink' => $this->module->l('We will send you a link to reset your password.', 'translations'), - 'email' => $this->module->l('Email', 'translations'), - 'goBackToLogin' => $this->module->l('Go back to login', 'translations'), - 'reset' => $this->module->l('Reset', 'translations'), + 'resetPassword' => $this->psCheckout->l('Reset password', 'translations'), + 'youGotEmail' => $this->psCheckout->l('You’ve got an email.', 'translations'), + 'sendEmail' => $this->psCheckout->l('We sent you an email with instructions to reset your password. Please check your inbox.', 'translations'), + 'sendLink' => $this->psCheckout->l('We will send you a link to reset your password.', 'translations'), + 'email' => $this->psCheckout->l('Email', 'translations'), + 'goBackToLogin' => $this->psCheckout->l('Go back to login', 'translations'), + 'reset' => $this->psCheckout->l('Reset', 'translations'), ], 'customize' => [ - 'customThemeWarningMessage1' => $this->module->l('All custom themes might not be fully compatible. To avoid potential integration issues on payment page,', 'translations'), - 'customThemeWarningMessage2' => $this->module->l('please check our list of customizable settings', 'translations'), + 'customThemeWarningMessage1' => $this->psCheckout->l('All custom themes might not be fully compatible. To avoid potential integration issues on payment page,', 'translations'), + 'customThemeWarningMessage2' => $this->psCheckout->l('please check our list of customizable settings', 'translations'), 'payLater' => [ - 'title' => $this->module->l('Pay in installments with PayPal Pay Later', 'translations'), - 'eligibilityWarning' => $this->module->l('This feature availability is based on eligibility criteria.', 'translations'), - 'eligibilityLink' => $this->module->l('Read more', 'translations'), - 'adviceContent' => $this->module->l('Displaying this message has shown a better conversion rate and a raise of Average Order Value.', 'translations'), - 'homePage' => $this->module->l('Homepage', 'translations'), - 'categoryPage' => $this->module->l('Category page', 'translations'), + 'title' => $this->psCheckout->l('Pay in installments with PayPal Pay Later', 'translations'), + 'eligibilityWarning' => $this->psCheckout->l('This feature availability is based on eligibility criteria.', 'translations'), + 'eligibilityLink' => $this->psCheckout->l('Read more', 'translations'), + 'adviceContent' => $this->psCheckout->l('Displaying this message has shown a better conversion rate and a raise of Average Order Value.', 'translations'), + 'homePage' => $this->psCheckout->l('Homepage', 'translations'), + 'categoryPage' => $this->psCheckout->l('Category page', 'translations'), 'message' => [ - 'title' => $this->module->l('Choose page location for messages', 'translations'), + 'title' => $this->psCheckout->l('Choose page location for messages', 'translations'), ], 'banner' => [ - 'title' => $this->module->l('Choose page location for banners', 'translations'), + 'title' => $this->psCheckout->l('Choose page location for banners', 'translations'), ], 'button' => [ - 'title' => $this->module->l('Choose page location for buttons', 'translations'), + 'title' => $this->psCheckout->l('Choose page location for buttons', 'translations'), ], ], ], ], 'firebase' => [ 'error' => [ - 'emailExists' => $this->module->l('Email already exist.', 'translations'), - 'missingEmail' => $this->module->l('The email is missing.', 'translations'), - 'missingPassword' => $this->module->l('The password is missing.', 'translations'), - 'invalidEmail' => $this->module->l('The email address is badly formatted.', 'translations'), - 'invalidPassword' => $this->module->l('The password is invalid.', 'translations'), - 'emailNotFound' => $this->module->l('The email is not found.', 'translations'), - 'defaultError' => $this->module->l('Error, try later.', 'translations'), + 'emailExists' => $this->psCheckout->l('Email already exist.', 'translations'), + 'missingEmail' => $this->psCheckout->l('The email is missing.', 'translations'), + 'missingPassword' => $this->psCheckout->l('The password is missing.', 'translations'), + 'invalidEmail' => $this->psCheckout->l('The email address is badly formatted.', 'translations'), + 'invalidPassword' => $this->psCheckout->l('The password is invalid.', 'translations'), + 'emailNotFound' => $this->psCheckout->l('The email is not found.', 'translations'), + 'defaultError' => $this->psCheckout->l('Error, try later.', 'translations'), ], ], 'banner' => [ 'paypalStatus' => [ - 'buttonSuccess' => $this->module->l('Thank you, close this message', 'translations'), - 'buttonLegal' => $this->module->l('Send my legal documents now', 'translations'), - 'allSet' => $this->module->l('You\'re all set !', 'translations'), - 'congrats' => $this->module->l('Congrats ! You can start selling online now.', 'translations'), - 'waitingFinalApprove' => $this->module->l('As soon as PayPal gets all your documents, you\'ll have to wait 48h for final approval.', 'translations'), - 'oneMoreThing' => $this->module->l('One more thing : send documents to be fully approved by PayPal', 'translations'), - 'psAccountConnected' => $this->module->l('Connect your PrestaShop account', 'translations'), - 'paypalAccountConnected' => $this->module->l('Link your PayPal account', 'translations'), - 'legalDocumentsSent' => $this->module->l('Send your legal documents to PayPal : ', 'translations'), - 'upTo' => $this->module->l('in the meantime, you can sell now up to 500$ in card transactions.', 'translations'), - 'onlyCC' => $this->module->l('in the meantime, you will only accept credit cards payments thought the PayPal branded credit card fields', 'translations'), - 'confirmation' => $this->module->l('We have received the confirmation from PayPal. You can now process all card transactions with no limits.', 'translations'), + 'buttonSuccess' => $this->psCheckout->l('Thank you, close this message', 'translations'), + 'buttonLegal' => $this->psCheckout->l('Send my legal documents now', 'translations'), + 'allSet' => $this->psCheckout->l('You\'re all set !', 'translations'), + 'congrats' => $this->psCheckout->l('Congrats ! You can start selling online now.', 'translations'), + 'waitingFinalApprove' => $this->psCheckout->l('As soon as PayPal gets all your documents, you\'ll have to wait 48h for final approval.', 'translations'), + 'oneMoreThing' => $this->psCheckout->l('One more thing : send documents to be fully approved by PayPal', 'translations'), + 'psAccountConnected' => $this->psCheckout->l('Connect your PrestaShop account', 'translations'), + 'paypalAccountConnected' => $this->psCheckout->l('Link your PayPal account', 'translations'), + 'legalDocumentsSent' => $this->psCheckout->l('Send your legal documents to PayPal : ', 'translations'), + 'upTo' => $this->psCheckout->l('in the meantime, you can sell now up to 500$ in card transactions.', 'translations'), + 'onlyCC' => $this->psCheckout->l('in the meantime, you will only accept credit cards payments thought the PayPal branded credit card fields', 'translations'), + 'confirmation' => $this->psCheckout->l('We have received the confirmation from PayPal. You can now process all card transactions with no limits.', 'translations'), ], 'paypalIncompatibleCountry' => [ - 'title' => $this->module->l('PrestaShop Checkout transactions won\'t work in some of your configured countries, but there is a solution !', 'translations'), - 'content' => $this->module->l('Please upgrade your settings for :', 'translations'), - 'changeCodes' => $this->module->l('Change countries ISO Codes', 'translations'), - 'changeActivation' => $this->module->l('Change countries activation for this payment module', 'translations'), - 'more' => $this->module->l('Know more about compliant ISO Codes', 'translations'), + 'title' => $this->psCheckout->l('PrestaShop Checkout transactions won\'t work in some of your configured countries, but there is a solution !', 'translations'), + 'content' => $this->psCheckout->l('Please upgrade your settings for :', 'translations'), + 'changeCodes' => $this->psCheckout->l('Change countries ISO Codes', 'translations'), + 'changeActivation' => $this->psCheckout->l('Change countries activation for this payment module', 'translations'), + 'more' => $this->psCheckout->l('Know more about compliant ISO Codes', 'translations'), ], 'paypalIncompatibleCurrency' => [ - 'title' => $this->module->l('PrestaShop Checkout transactions won\'t work in some of your configured currencies, but there is a solution !', 'translations'), - 'content' => $this->module->l('Please upgrade your settings for :', 'translations'), - 'changeCodes' => $this->module->l('Change currencies ISO Codes', 'translations'), - 'changeActivation' => $this->module->l('Change currencies activation for this payment module', 'translations'), - 'more' => $this->module->l('Know more about compliant ISO Codes', 'translations'), + 'title' => $this->psCheckout->l('PrestaShop Checkout transactions won\'t work in some of your configured currencies, but there is a solution !', 'translations'), + 'content' => $this->psCheckout->l('Please upgrade your settings for :', 'translations'), + 'changeCodes' => $this->psCheckout->l('Change currencies ISO Codes', 'translations'), + 'changeActivation' => $this->psCheckout->l('Change currencies activation for this payment module', 'translations'), + 'more' => $this->psCheckout->l('Know more about compliant ISO Codes', 'translations'), ], 'paypalValueProposition' => [ - 'titleFees' => $this->module->l('Competitive and transparent fees', 'translations'), - 'titlePaymentMethods' => $this->module->l('10 payment methods included all-in-one', 'translations'), - 'titleConversions' => $this->module->l('No redirection when paying by credit card', 'translations'), + 'titleFees' => $this->psCheckout->l('Competitive and transparent fees', 'translations'), + 'titlePaymentMethods' => $this->psCheckout->l('10 payment methods included all-in-one', 'translations'), + 'titleConversions' => $this->psCheckout->l('No redirection when paying by credit card', 'translations'), 'fees' => [ - 'title' => $this->module->l('Starting from', 'translations'), - 'subtitle' => $this->module->l('per transaction depending on your country. ', 'translations'), - 'linkLabel' => $this->module->l('Know more', 'translations'), - 'linkHref' => $this->module->l('https://www.prestashop.com/en/prestashop-checkout', 'translations'), - 'popup' => $this->module->l('For more informations about your fees please visit this page:', 'translations'), - 'popupLinkLabel' => $this->module->l('PrestaShop Checkout 2.0', 'translations'), + 'title' => $this->psCheckout->l('Starting from', 'translations'), + 'subtitle' => $this->psCheckout->l('per transaction depending on your country. ', 'translations'), + 'linkLabel' => $this->psCheckout->l('Know more', 'translations'), + 'linkHref' => $this->psCheckout->l('https://www.prestashop.com/en/prestashop-checkout', 'translations'), + 'popup' => $this->psCheckout->l('For more informations about your fees please visit this page:', 'translations'), + 'popupLinkLabel' => $this->psCheckout->l('PrestaShop Checkout 2.0', 'translations'), ], 'conversions' => [ - 'title' => $this->module->l('Higher conversions', 'translations'), + 'title' => $this->psCheckout->l('Higher conversions', 'translations'), ], ], ], 'panel' => [ 'accounts' => [ - 'activateAllPayment' => $this->module->l('You need to connect to both PrestaShop and PayPal accounts to activate all payment methods', 'translations'), + 'activateAllPayment' => $this->psCheckout->l('You need to connect to both PrestaShop and PayPal accounts to activate all payment methods', 'translations'), 'paypal' => [ - 'title' => $this->module->l('PayPal account', 'translations'), - 'activate' => $this->module->l('Log in or sign up to PayPal', 'translations'), - 'isLinked' => $this->module->l('Your PrestaShop account is linked to your PayPal account', 'translations'), - 'merchantId' => $this->module->l('(merchant ID {0})', 'translations'), - 'useAnotherAccount' => $this->module->l('Use another account', 'translations'), - 'linkToPaypal' => $this->module->l('Link to PayPal account', 'translations'), - 'linkToPsCheckoutFirst' => $this->module->l('Link to PrestaShop Checkout first', 'translations'), - 'loading' => $this->module->l('Loading', 'translations'), - 'onboardingLinkError' => $this->module->l('An error occured, the PayPal sign up or login window can\'t be opened. Please wait a bit and click again.', 'translations'), + 'title' => $this->psCheckout->l('PayPal account', 'translations'), + 'activate' => $this->psCheckout->l('Log in or sign up to PayPal', 'translations'), + 'isLinked' => $this->psCheckout->l('Your PrestaShop account is linked to your PayPal account', 'translations'), + 'merchantId' => $this->psCheckout->l('(merchant ID {0})', 'translations'), + 'useAnotherAccount' => $this->psCheckout->l('Use another account', 'translations'), + 'linkToPaypal' => $this->psCheckout->l('Link to PayPal account', 'translations'), + 'linkToPsCheckoutFirst' => $this->psCheckout->l('Link to PrestaShop Checkout first', 'translations'), + 'loading' => $this->psCheckout->l('Loading', 'translations'), + 'onboardingLinkError' => $this->psCheckout->l('An error occured, the PayPal sign up or login window can\'t be opened. Please wait a bit and click again.', 'translations'), ], 'checkout' => [ - 'title' => $this->module->l('PrestaShop Checkout account', 'translations'), - 'connectedWith' => $this->module->l('You are now logged in with your', 'translations'), - 'account' => $this->module->l('account', 'translations'), - 'createNewAccount' => $this->module->l('Sign in or login to provide every payment method to your customer.', 'translations'), - 'logIn' => $this->module->l('Log in', 'translations'), - 'createAccount' => $this->module->l('Sign up', 'translations'), - 'logOut' => $this->module->l('Log out', 'translations'), - 'titleLogout' => $this->module->l('Are you sure you want to logout ?', 'translations'), - 'descriptionLogout' => $this->module->l('Logging out will deactivate all payment methods. You will no longer be able to receive payments with PrestaShop Checkout.', 'translations'), - 'cancel' => $this->module->l('Cancel', 'translations'), + 'title' => $this->psCheckout->l('PrestaShop Checkout account', 'translations'), + 'connectedWith' => $this->psCheckout->l('You are now logged in with your', 'translations'), + 'account' => $this->psCheckout->l('account', 'translations'), + 'createNewAccount' => $this->psCheckout->l('Sign in or login to provide every payment method to your customer.', 'translations'), + 'logIn' => $this->psCheckout->l('Log in', 'translations'), + 'createAccount' => $this->psCheckout->l('Sign up', 'translations'), + 'logOut' => $this->psCheckout->l('Log out', 'translations'), + 'titleLogout' => $this->psCheckout->l('Are you sure you want to logout ?', 'translations'), + 'descriptionLogout' => $this->psCheckout->l('Logging out will deactivate all payment methods. You will no longer be able to receive payments with PrestaShop Checkout.', 'translations'), + 'cancel' => $this->psCheckout->l('Cancel', 'translations'), ], ], 'psx-form' => [ - 'additionalDetails' => $this->module->l('Additional Details', 'translations'), - 'fillUp' => $this->module->l('Fill out the form to complete registration:', 'translations'), - 'personalInformation' => $this->module->l('Personal information', 'translations'), - 'genderMr' => $this->module->l('Mr', 'translations'), - 'genderMrs' => $this->module->l('Mrs', 'translations'), - 'firstName' => $this->module->l('First name', 'translations'), - 'language' => $this->module->l('Language', 'translations'), - 'lastName' => $this->module->l('Last name', 'translations'), - 'qualification' => $this->module->l('Are you', 'translations'), - 'merchant' => $this->module->l('A merchant', 'translations'), - 'agency' => $this->module->l('An agency', 'translations'), - 'freelancer' => $this->module->l('A freelancer', 'translations'), - 'billingAddress' => $this->module->l('Billing address', 'translations'), - 'storeName' => $this->module->l('Store name', 'translations'), - 'address' => $this->module->l('Address', 'translations'), - 'postCode' => $this->module->l('Postcode', 'translations'), - 'town' => $this->module->l('Town', 'translations'), - 'country' => $this->module->l('Country', 'translations'), - 'state' => $this->module->l('State', 'translations'), - 'businessPhone' => $this->module->l('Business phone', 'translations'), - 'businessType' => $this->module->l('Business type', 'translations'), - 'businessInformation' => $this->module->l('Business information', 'translations'), - 'website' => $this->module->l('Website', 'translations'), - 'companyTurnover' => $this->module->l('Company estimated monthly turnover', 'translations'), - 'businessCategory' => $this->module->l('Business category', 'translations'), - 'businessSubCategory' => $this->module->l('Business subcategory', 'translations'), - 'optional' => $this->module->l('Optional', 'translations'), - 'continue' => $this->module->l('Continue', 'translations'), - 'back' => $this->module->l('Back', 'translations'), - 'errors' => $this->module->l('Errors', 'translations'), - 'privacyTextPart1' => $this->module->l('By submitting this form, I agree that the data provided may be collected by PrestaShop S.A to permit (i) the use of our services (ii) to improve your customer experience. Your data can be transmitted to our partner Paypal if you do not already have an account.', 'translations'), - 'privacyTextPart2' => $this->module->l('Learn more about managing your data and rights.', 'translations'), + 'additionalDetails' => $this->psCheckout->l('Additional Details', 'translations'), + 'fillUp' => $this->psCheckout->l('Fill out the form to complete registration:', 'translations'), + 'personalInformation' => $this->psCheckout->l('Personal information', 'translations'), + 'genderMr' => $this->psCheckout->l('Mr', 'translations'), + 'genderMrs' => $this->psCheckout->l('Mrs', 'translations'), + 'firstName' => $this->psCheckout->l('First name', 'translations'), + 'language' => $this->psCheckout->l('Language', 'translations'), + 'lastName' => $this->psCheckout->l('Last name', 'translations'), + 'qualification' => $this->psCheckout->l('Are you', 'translations'), + 'merchant' => $this->psCheckout->l('A merchant', 'translations'), + 'agency' => $this->psCheckout->l('An agency', 'translations'), + 'freelancer' => $this->psCheckout->l('A freelancer', 'translations'), + 'billingAddress' => $this->psCheckout->l('Billing address', 'translations'), + 'storeName' => $this->psCheckout->l('Store name', 'translations'), + 'address' => $this->psCheckout->l('Address', 'translations'), + 'postCode' => $this->psCheckout->l('Postcode', 'translations'), + 'town' => $this->psCheckout->l('Town', 'translations'), + 'country' => $this->psCheckout->l('Country', 'translations'), + 'state' => $this->psCheckout->l('State', 'translations'), + 'businessPhone' => $this->psCheckout->l('Business phone', 'translations'), + 'businessType' => $this->psCheckout->l('Business type', 'translations'), + 'businessInformation' => $this->psCheckout->l('Business information', 'translations'), + 'website' => $this->psCheckout->l('Website', 'translations'), + 'companyTurnover' => $this->psCheckout->l('Company estimated monthly turnover', 'translations'), + 'businessCategory' => $this->psCheckout->l('Business category', 'translations'), + 'businessSubCategory' => $this->psCheckout->l('Business subcategory', 'translations'), + 'optional' => $this->psCheckout->l('Optional', 'translations'), + 'continue' => $this->psCheckout->l('Continue', 'translations'), + 'back' => $this->psCheckout->l('Back', 'translations'), + 'errors' => $this->psCheckout->l('Errors', 'translations'), + 'privacyTextPart1' => $this->psCheckout->l('By submitting this form, I agree that the data provided may be collected by PrestaShop S.A to permit (i) the use of our services (ii) to improve your customer experience. Your data can be transmitted to our partner Paypal if you do not already have an account.', 'translations'), + 'privacyTextPart2' => $this->psCheckout->l('Learn more about managing your data and rights.', 'translations'), 'privacyLink' => $linkTranslations->getCheckoutDataPolicyLink(), ], 'active-payment' => [ - 'activePaymentMethods' => $this->module->l('Activate payment methods', 'translations'), - 'changeOrder' => $this->module->l('Change payment methods order', 'translations'), - 'enabled' => $this->module->l('Enabled', 'translations'), - 'disabled' => $this->module->l('Disabled', 'translations'), - 'available' => $this->module->l('Available', 'translations'), - 'notAvailable' => $this->module->l('Not available', 'translations'), - 'restricted' => $this->module->l('Restricted', 'translations'), - 'creditCard' => $this->module->l('Credit card', 'translations'), - 'paypal' => $this->module->l('PayPal', 'translations'), - 'availableIn' => $this->module->l('available in :', 'translations'), - 'allCountries' => $this->module->l('All countries', 'translations'), - 'localPaymentMethods' => $this->module->l('Local payment methods', 'translations'), - 'tipsTitle' => $this->module->l('TIPS', 'translations'), - 'tipsContent' => $this->module->l('Boost your conversion rate by displaying PayPal as the first choice in the list of payment methods', 'translations'), + 'activePaymentMethods' => $this->psCheckout->l('Activate payment methods', 'translations'), + 'changeOrder' => $this->psCheckout->l('Change payment methods order', 'translations'), + 'enabled' => $this->psCheckout->l('Enabled', 'translations'), + 'disabled' => $this->psCheckout->l('Disabled', 'translations'), + 'available' => $this->psCheckout->l('Available', 'translations'), + 'notAvailable' => $this->psCheckout->l('Not available', 'translations'), + 'restricted' => $this->psCheckout->l('Restricted', 'translations'), + 'creditCard' => $this->psCheckout->l('Credit card', 'translations'), + 'paypal' => $this->psCheckout->l('PayPal', 'translations'), + 'availableIn' => $this->psCheckout->l('available in :', 'translations'), + 'allCountries' => $this->psCheckout->l('All countries', 'translations'), + 'localPaymentMethods' => $this->psCheckout->l('Local payment methods', 'translations'), + 'tipsTitle' => $this->psCheckout->l('TIPS', 'translations'), + 'tipsContent' => $this->psCheckout->l('Boost your conversion rate by displaying PayPal as the first choice in the list of payment methods', 'translations'), ], 'payment-acceptance' => [ - 'paymentMethod' => $this->module->l('Payment method', 'translations'), - 'availability' => $this->module->l('Availability', 'translations'), - 'activationStatus' => $this->module->l('Activation status', 'translations'), - 'paymentAcceptanceTitle' => $this->module->l('Payment methods acceptance', 'translations'), - 'creditCardsLabel' => $this->module->l('Credit and Debit Cards', 'translations'), - 'tips' => $this->module->l('Tips', 'translations'), - 'alertInfo' => $this->module->l('To test your payment method you can make a real transaction (prefer small amount), and once you have observed the money on your account, make a refund on the corresponding order page. Warning, you will not recover the fees.', 'translations'), + 'paymentMethod' => $this->psCheckout->l('Payment method', 'translations'), + 'availability' => $this->psCheckout->l('Availability', 'translations'), + 'activationStatus' => $this->psCheckout->l('Activation status', 'translations'), + 'paymentAcceptanceTitle' => $this->psCheckout->l('Payment methods acceptance', 'translations'), + 'creditCardsLabel' => $this->psCheckout->l('Credit and Debit Cards', 'translations'), + 'tips' => $this->psCheckout->l('Tips', 'translations'), + 'alertInfo' => $this->psCheckout->l('To test your payment method you can make a real transaction (prefer small amount), and once you have observed the money on your account, make a refund on the corresponding order page. Warning, you will not recover the fees.', 'translations'), ], 'payment-mode' => [ - 'title' => $this->module->l('Payment methods activation', 'translations'), - 'paymentAction' => $this->module->l('Transaction type', 'translations'), - 'capture' => $this->module->l('Direct Sale', 'translations'), - 'authorize' => $this->module->l('Capture at shipping', 'translations'), - 'helpBoxPaymentMode' => $this->module->l('Authorize process holds all payments on customers’ account. Mark the order as « Shipped » or « Payment accepted » to capture payments. Local Payment Methods are not compatible with Authorize process.', 'translations'), - 'infoAlertText' => $this->module->l('We recommend « Capture at shipping » if you are a lean manufacturer or a craft products seller', 'translations'), - 'environment' => $this->module->l('Environment', 'translations'), - 'sandboxMode' => $this->module->l('Test mode', 'translations'), - 'useSandboxMode' => $this->module->l('Switch to test mode?', 'translations'), - 'tipSandboxMode' => $this->module->l('Note that you cannot collect payments with test mode', 'translations'), - 'productionMode' => $this->module->l('Production mode', 'translations'), - 'useProductionMode' => $this->module->l('Use production mode', 'translations'), - 'tipProductionMode' => $this->module->l('Production mode enables you to collect your payments.', 'translations'), + 'title' => $this->psCheckout->l('Payment methods activation', 'translations'), + 'paymentAction' => $this->psCheckout->l('Transaction type', 'translations'), + 'capture' => $this->psCheckout->l('Direct Sale', 'translations'), + 'authorize' => $this->psCheckout->l('Capture at shipping', 'translations'), + 'helpBoxPaymentMode' => $this->psCheckout->l('Authorize process holds all payments on customers’ account. Mark the order as « Shipped » or « Payment accepted » to capture payments. Local Payment Methods are not compatible with Authorize process.', 'translations'), + 'infoAlertText' => $this->psCheckout->l('We recommend « Capture at shipping » if you are a lean manufacturer or a craft products seller', 'translations'), + 'environment' => $this->psCheckout->l('Environment', 'translations'), + 'sandboxMode' => $this->psCheckout->l('Test mode', 'translations'), + 'useSandboxMode' => $this->psCheckout->l('Switch to test mode?', 'translations'), + 'tipSandboxMode' => $this->psCheckout->l('Note that you cannot collect payments with test mode', 'translations'), + 'productionMode' => $this->psCheckout->l('Production mode', 'translations'), + 'useProductionMode' => $this->psCheckout->l('Use production mode', 'translations'), + 'tipProductionMode' => $this->psCheckout->l('Production mode enables you to collect your payments.', 'translations'), ], 'payment-method-activation' => [ - 'title' => $this->module->l('Alternative Credit Card Fields activation', 'translations'), - 'label' => $this->module->l('PayPal Branded Credit Card Fields', 'translations'), - 'disable' => $this->module->l('You can choose the type of credit card fields only if Credit card is activated in « Customize checkout experience » tab.', 'translations'), - 'popover-difference-question' => $this->module->l('What is the difference between Integrated Credit Card fields and PayPal branded Credit Card Fields ?', 'translations'), - 'popover-when-question' => $this->module->l('When to use PayPal branded Credit Card fields ?', 'translations'), - 'popover-difference-answer-begin' => $this->module->l('Integrated Credit Card fields provide the best payment experience you can find in PrestaShop. Well integrated in your checkout process, not branded, with the fewest number of fields, and lowest fee rates (see them on ', 'translations'), - 'popover-difference-answer-end' => $this->module->l(' ) : we highly recommend to use these ones, by default. But you need PayPal full approval for accepting Credit Cards payment with the fields. You can see the status of this approval in the ', 'translations'), - 'popover-when-answer' => $this->module->l('If approval is pending or issues are encountered with the Integrated fields, you can activate these fields as a backup, only if Integrated fields are not available or deactivated. The fees are the same as PayPal payment method.', 'translations'), - 'integrated-credit-card-fields' => $this->module->l('Integrated Credit Card Fields', 'translations'), - 'paypal-branded-credit-card-fields' => $this->module->l('PayPal branded Credit Card Fields', 'translations'), + 'title' => $this->psCheckout->l('Alternative Credit Card Fields activation', 'translations'), + 'label' => $this->psCheckout->l('PayPal Branded Credit Card Fields', 'translations'), + 'disable' => $this->psCheckout->l('You can choose the type of credit card fields only if Credit card is activated in « Customize checkout experience » tab.', 'translations'), + 'popover-difference-question' => $this->psCheckout->l('What is the difference between Integrated Credit Card fields and PayPal branded Credit Card Fields ?', 'translations'), + 'popover-when-question' => $this->psCheckout->l('When to use PayPal branded Credit Card fields ?', 'translations'), + 'popover-difference-answer-begin' => $this->psCheckout->l('Integrated Credit Card fields provide the best payment experience you can find in PrestaShop. Well integrated in your checkout process, not branded, with the fewest number of fields, and lowest fee rates (see them on ', 'translations'), + 'popover-difference-answer-end' => $this->psCheckout->l(' ) : we highly recommend to use these ones, by default. But you need PayPal full approval for accepting Credit Cards payment with the fields. You can see the status of this approval in the ', 'translations'), + 'popover-when-answer' => $this->psCheckout->l('If approval is pending or issues are encountered with the Integrated fields, you can activate these fields as a backup, only if Integrated fields are not available or deactivated. The fees are the same as PayPal payment method.', 'translations'), + 'integrated-credit-card-fields' => $this->psCheckout->l('Integrated Credit Card Fields', 'translations'), + 'paypal-branded-credit-card-fields' => $this->psCheckout->l('PayPal branded Credit Card Fields', 'translations'), ], 'express-checkout' => [ - 'title' => $this->module->l('Define PayPal express checkout flow', 'translations'), - 'pageLocation' => $this->module->l('Choose page location', 'translations'), - 'orderPage' => $this->module->l('Order summary page', 'translations'), - 'checkoutPage' => $this->module->l('Sign up on order page', 'translations'), - 'productPage' => $this->module->l('Product page', 'translations'), - 'recommended' => $this->module->l('Recommended', 'translations'), - 'shippingCost' => $this->module->l('Shipping costs, if any, will be estimated in basket total. Delivery method selected by default will be the one set in first position on Carriers page.', 'translations'), - 'alertTitle' => $this->module->l('TIPS', 'translations'), - 'alertContent' => $this->module->l('Express Checkout Shortcut allows merging account creation and payment, to make your customers purchases effortless.', 'translations'), + 'title' => $this->psCheckout->l('Define PayPal express checkout flow', 'translations'), + 'pageLocation' => $this->psCheckout->l('Choose page location', 'translations'), + 'orderPage' => $this->psCheckout->l('Order summary page', 'translations'), + 'checkoutPage' => $this->psCheckout->l('Sign up on order page', 'translations'), + 'productPage' => $this->psCheckout->l('Product page', 'translations'), + 'recommended' => $this->psCheckout->l('Recommended', 'translations'), + 'shippingCost' => $this->psCheckout->l('Shipping costs, if any, will be estimated in basket total. Delivery method selected by default will be the one set in first position on Carriers page.', 'translations'), + 'alertTitle' => $this->psCheckout->l('TIPS', 'translations'), + 'alertContent' => $this->psCheckout->l('Express Checkout Shortcut allows merging account creation and payment, to make your customers purchases effortless.', 'translations'), ], 'button-customization' => [ - 'title' => $this->module->l('Design smart payment buttons', 'translations'), + 'title' => $this->psCheckout->l('Design smart payment buttons', 'translations'), 'shape' => [ - 'title' => $this->module->l('Adjust shape for all buttons', 'translations'), - 'select' => $this->module->l('Select the shape', 'translations'), - 'pill' => $this->module->l('Pill', 'translations'), - 'rect' => $this->module->l('Rectangle', 'translations'), + 'title' => $this->psCheckout->l('Adjust shape for all buttons', 'translations'), + 'select' => $this->psCheckout->l('Select the shape', 'translations'), + 'pill' => $this->psCheckout->l('Pill', 'translations'), + 'rect' => $this->psCheckout->l('Rectangle', 'translations'), ], 'customize' => [ - 'title' => $this->module->l('Customize PayPal button', 'translations'), + 'title' => $this->psCheckout->l('Customize PayPal button', 'translations'), 'label' => [ - 'select' => $this->module->l('Choose label', 'translations'), - 'pay' => $this->module->l('Pay with', 'translations'), - 'checkout' => $this->module->l('Checkout', 'translations'), - 'buynow' => $this->module->l('Buy Now', 'translations'), + 'select' => $this->psCheckout->l('Choose label', 'translations'), + 'pay' => $this->psCheckout->l('Pay with', 'translations'), + 'checkout' => $this->psCheckout->l('Checkout', 'translations'), + 'buynow' => $this->psCheckout->l('Buy Now', 'translations'), ], 'color' => [ - 'select' => $this->module->l('Select background color', 'translations'), - 'gold' => $this->module->l('Gold', 'translations'), - 'blue' => $this->module->l('Blue', 'translations'), - 'silver' => $this->module->l('Silver', 'translations'), - 'white' => $this->module->l('White', 'translations'), - 'black' => $this->module->l('Black', 'translations'), + 'select' => $this->psCheckout->l('Select background color', 'translations'), + 'gold' => $this->psCheckout->l('Gold', 'translations'), + 'blue' => $this->psCheckout->l('Blue', 'translations'), + 'silver' => $this->psCheckout->l('Silver', 'translations'), + 'white' => $this->psCheckout->l('White', 'translations'), + 'black' => $this->psCheckout->l('Black', 'translations'), ], 'tips' => [ - 'title' => $this->module->l('TIPS', 'translations'), - 'content' => $this->module->l('Gold version shows better results on conversion rate', 'translations'), + 'title' => $this->psCheckout->l('TIPS', 'translations'), + 'content' => $this->psCheckout->l('Gold version shows better results on conversion rate', 'translations'), ], - 'save' => $this->module->l('Save', 'translations'), - 'savedConfiguration' => $this->module->l('Button configuration saved with success !', 'translations'), + 'save' => $this->psCheckout->l('Save', 'translations'), + 'savedConfiguration' => $this->psCheckout->l('Button configuration saved with success !', 'translations'), ], 'preview' => [ - 'title' => $this->module->l('Preview', 'translations'), - 'paypal-button' => $this->module->l('PayPal button', 'translations'), - 'local-payment-buttons' => $this->module->l('Local payment buttons', 'translations'), - 'notice' => $this->module->l('As for local payment methods, buttons will be displayed according to the purchase context: country, amount, device, etc.', 'translations'), + 'title' => $this->psCheckout->l('Preview', 'translations'), + 'paypal-button' => $this->psCheckout->l('PayPal button', 'translations'), + 'local-payment-buttons' => $this->psCheckout->l('Local payment buttons', 'translations'), + 'notice' => $this->psCheckout->l('As for local payment methods, buttons will be displayed according to the purchase context: country, amount, device, etc.', 'translations'), ], ], 'help' => [ - 'faq' => $this->module->l('FAQ', 'translations'), - 'title' => $this->module->l('Help for PrestaShop Checkout', 'translations'), - 'allowsYou' => $this->module->l('This module allows you to:', 'translations'), - 'tip1' => $this->module->l('Connect your PrestaShop Checkout account and link your PayPal Account or create one if needed', 'translations'), - 'tip2' => $this->module->l('Offer the widest range of payment methods: cards, PayPal, etc...', 'translations'), - 'tip3' => $this->module->l('Benefit from all PayPal expertise and advantages', 'translations'), - 'tip4' => $this->module->l('Give access to relevant local payment methods for customers around the globe', 'translations'), - 'couldntFindAnswer' => $this->module->l('Couldn\'t find any answer to your question?', 'translations'), - 'contactUs' => $this->module->l('Contact us', 'translations'), - 'needHelp' => $this->module->l('Need help? Find here the documentation of this module', 'translations'), - 'downloadDoc' => $this->module->l('Download PDF', 'translations'), - 'noFaqAvailable' => $this->module->l('No faq available. Try later.', 'translations'), + 'faq' => $this->psCheckout->l('FAQ', 'translations'), + 'title' => $this->psCheckout->l('Help for PrestaShop Checkout', 'translations'), + 'allowsYou' => $this->psCheckout->l('This module allows you to:', 'translations'), + 'tip1' => $this->psCheckout->l('Connect your PrestaShop Checkout account and link your PayPal Account or create one if needed', 'translations'), + 'tip2' => $this->psCheckout->l('Offer the widest range of payment methods: cards, PayPal, etc...', 'translations'), + 'tip3' => $this->psCheckout->l('Benefit from all PayPal expertise and advantages', 'translations'), + 'tip4' => $this->psCheckout->l('Give access to relevant local payment methods for customers around the globe', 'translations'), + 'couldntFindAnswer' => $this->psCheckout->l('Couldn\'t find any answer to your question?', 'translations'), + 'contactUs' => $this->psCheckout->l('Contact us', 'translations'), + 'needHelp' => $this->psCheckout->l('Need help? Find here the documentation of this module', 'translations'), + 'downloadDoc' => $this->psCheckout->l('Download PDF', 'translations'), + 'noFaqAvailable' => $this->psCheckout->l('No faq available. Try later.', 'translations'), ], ], 'account-settings-deeplink' => [ 'fraud-tool' => [ - 'title' => $this->module->l('Limit your fraud rate', 'translations'), - 'description' => $this->module->l('PayPal algorithms automatically limit your fraud rate. There is a complete tool on PayPal to set specific rules and drive your performance concerning fraud and chargeback costs.', 'translations'), - 'link-title' => $this->module->l('Setup fraud tool', 'translations'), - 'icon-title' => $this->module->l('Fraud tool', 'translations'), + 'title' => $this->psCheckout->l('Limit your fraud rate', 'translations'), + 'description' => $this->psCheckout->l('PayPal algorithms automatically limit your fraud rate. There is a complete tool on PayPal to set specific rules and drive your performance concerning fraud and chargeback costs.', 'translations'), + 'link-title' => $this->psCheckout->l('Setup fraud tool', 'translations'), + 'icon-title' => $this->psCheckout->l('Fraud tool', 'translations'), ], 'bank-account' => [ - 'title' => $this->module->l('Adjust your bank account', 'translations'), - 'description' => $this->module->l('Within your PayPal account, you can add a bank account to be beneficiary of your money transfer.', 'translations'), - 'link-title' => $this->module->l('Manage bank account', 'translations'), - 'icon-title' => $this->module->l('Bank account', 'translations'), + 'title' => $this->psCheckout->l('Adjust your bank account', 'translations'), + 'description' => $this->psCheckout->l('Within your PayPal account, you can add a bank account to be beneficiary of your money transfer.', 'translations'), + 'link-title' => $this->psCheckout->l('Manage bank account', 'translations'), + 'icon-title' => $this->psCheckout->l('Bank account', 'translations'), ], 'currencies' => [ - 'title' => $this->module->l('Match currencies', 'translations'), - 'description' => $this->module->l('You can manage the currencies of your PayPal account. Ideally, make them match with the available currencies of your store.', 'translations'), - 'link-title' => $this->module->l('Manage currencies', 'translations'), - 'icon-title' => $this->module->l('Currencies', 'translations'), + 'title' => $this->psCheckout->l('Match currencies', 'translations'), + 'description' => $this->psCheckout->l('You can manage the currencies of your PayPal account. Ideally, make them match with the available currencies of your store.', 'translations'), + 'link-title' => $this->psCheckout->l('Manage currencies', 'translations'), + 'icon-title' => $this->psCheckout->l('Currencies', 'translations'), ], 'conversion-rules' => [ - 'title' => $this->module->l('Define the currency conversion rules', 'translations'), - 'description' => $this->module->l('Let\'s choose the conversion rules for any transaction in a currency other than those activated on your account, should they be automatically converted or request your validation.', 'translations'), - 'link-title' => $this->module->l('Manage conversion rules', 'translations'), - 'icon-title' => $this->module->l('Conversion rules', 'translations'), + 'title' => $this->psCheckout->l('Define the currency conversion rules', 'translations'), + 'description' => $this->psCheckout->l('Let\'s choose the conversion rules for any transaction in a currency other than those activated on your account, should they be automatically converted or request your validation.', 'translations'), + 'link-title' => $this->psCheckout->l('Manage conversion rules', 'translations'), + 'icon-title' => $this->psCheckout->l('Conversion rules', 'translations'), ], 'soft-descriptor' => [ - 'title' => $this->module->l('Configure your bank statements description', 'translations'), - 'description' => $this->module->l('You can choose the short or long description that appears on your customer\'s bank statements. Let\'s make them sure to understand their transaction!', 'translations'), - 'link-title' => $this->module->l('Set up description', 'translations'), - 'icon-title' => $this->module->l('Details for Bank statements', 'translations'), + 'title' => $this->psCheckout->l('Configure your bank statements description', 'translations'), + 'description' => $this->psCheckout->l('You can choose the short or long description that appears on your customer\'s bank statements. Let\'s make them sure to understand their transaction!', 'translations'), + 'link-title' => $this->psCheckout->l('Set up description', 'translations'), + 'icon-title' => $this->psCheckout->l('Details for Bank statements', 'translations'), ], ], 'block' => [ 'reassurance' => [ - 'title' => $this->module->l('One module, all payments methods.', 'translations'), - 'label1' => $this->module->l('Offer the widest range of payment methods: cards, PayPal, etc.', 'translations'), - 'label2' => $this->module->l('Benefit from all PayPal expertise and advantages', 'translations'), - 'label3' => $this->module->l('Give access to relevant local payment methods for customers around the globe', 'translations'), - 'learnMore' => $this->module->l('Learn more', 'translations'), + 'title' => $this->psCheckout->l('One module, all payments methods.', 'translations'), + 'label1' => $this->psCheckout->l('Offer the widest range of payment methods: cards, PayPal, etc.', 'translations'), + 'label2' => $this->psCheckout->l('Benefit from all PayPal expertise and advantages', 'translations'), + 'label3' => $this->psCheckout->l('Give access to relevant local payment methods for customers around the globe', 'translations'), + 'learnMore' => $this->psCheckout->l('Learn more', 'translations'), ], 'feature-incoming' => [ - 'text' => $this->module->l('Pay in 4x, save credit cards, authorize mode, send payments direct link... and more to come! Let us know what you would love to be added to this module: any new feature or behavior improvement!', 'translations'), - 'submitIdea' => $this->module->l('Submit idea', 'translations'), + 'text' => $this->psCheckout->l('Pay in 4x, save credit cards, authorize mode, send payments direct link... and more to come! Let us know what you would love to be added to this module: any new feature or behavior improvement!', 'translations'), + 'submitIdea' => $this->psCheckout->l('Submit idea', 'translations'), ], 'dispute' => [ - 'pendingDispute' => '{disputeCount}' . ' ' . $this->module->l('pending dispute(s)', 'translations'), - 'goToDispute' => $this->module->l('Go to the dispute management platform', 'translations'), + 'pendingDispute' => '{disputeCount}' . ' ' . $this->psCheckout->l('pending dispute(s)', 'translations'), + 'goToDispute' => $this->psCheckout->l('Go to the dispute management platform', 'translations'), ], 'payment-status' => [ - 'live' => $this->module->l('Live', 'translations'), - 'approvalPending' => $this->module->l('Approval pending', 'translations'), - 'limited' => $this->module->l('Limited to $500', 'translations'), - 'denied' => $this->module->l('Account declined', 'translations'), - 'disabled' => $this->module->l('Disabled', 'translations'), - 'revoked' => $this->module->l('Revoked', 'translations'), - 'suspended' => $this->module->l('Suspended', 'translations'), - 'paypalLabel' => $this->module->l('Accept payments through PayPal buttons on your checkout page.', 'translations'), - 'paypalLabelEmailNotValid' => $this->module->l('Your account needs to be validated to accept PayPal payments. Please check your inbox for any email confirmation.', 'translations'), - 'creditCardLabelLimited' => $this->module->l('You can process a limited amount in card transactions.', 'translations'), - 'creditCardLabelSuspended' => $this->module->l('The capability can no longer be used, but there are remediation steps to regain access to the corresponding functionality.', 'translations'), - 'creditCardLabelRevoked' => $this->module->l('The capability can no longer be used and there are no remediation steps available to regain the functionality.', 'translations'), - 'creditCardLabelDenied' => $this->module->l('We cannot process credit card payments for you at the moment.', 'translations'), - 'creditCardLabelLive' => $this->module->l('Process unlimited card payments. You can accept either credit or debit card.', 'translations'), - 'creditCardLabelPending' => $this->module->l('Your account needs further checks to accept Credit and Debit Cards payment.', 'translations'), + 'live' => $this->psCheckout->l('Live', 'translations'), + 'approvalPending' => $this->psCheckout->l('Approval pending', 'translations'), + 'limited' => $this->psCheckout->l('Limited to $500', 'translations'), + 'denied' => $this->psCheckout->l('Account declined', 'translations'), + 'disabled' => $this->psCheckout->l('Disabled', 'translations'), + 'revoked' => $this->psCheckout->l('Revoked', 'translations'), + 'suspended' => $this->psCheckout->l('Suspended', 'translations'), + 'paypalLabel' => $this->psCheckout->l('Accept payments through PayPal buttons on your checkout page.', 'translations'), + 'paypalLabelEmailNotValid' => $this->psCheckout->l('Your account needs to be validated to accept PayPal payments. Please check your inbox for any email confirmation.', 'translations'), + 'creditCardLabelLimited' => $this->psCheckout->l('You can process a limited amount in card transactions.', 'translations'), + 'creditCardLabelSuspended' => $this->psCheckout->l('The capability can no longer be used, but there are remediation steps to regain access to the corresponding functionality.', 'translations'), + 'creditCardLabelRevoked' => $this->psCheckout->l('The capability can no longer be used and there are no remediation steps available to regain the functionality.', 'translations'), + 'creditCardLabelDenied' => $this->psCheckout->l('We cannot process credit card payments for you at the moment.', 'translations'), + 'creditCardLabelLive' => $this->psCheckout->l('Process unlimited card payments. You can accept either credit or debit card.', 'translations'), + 'creditCardLabelPending' => $this->psCheckout->l('Your account needs further checks to accept Credit and Debit Cards payment.', 'translations'), ], 'rounding-banner' => [ - 'title' => $this->module->l('Roundings settings to change', 'translations'), - 'content' => $this->module->l('Be careful, your roundings settings are not fully compatible with PrestaShop Checkout transaction processing. Some of the transactions could fail. But it is easy, your setting Round mode and Round type should be set on « Round up away from zero, when it is half way there » and « Round on each item » or click on the button bellow to make it automatically !', 'translations'), - 'button' => $this->module->l('Change rounding settings', 'translations'), - 'confirmationTitle' => $this->module->l('Settings updated !', 'translations'), - 'confirmationLabel' => $this->module->l('Your rounding settings are now fully compatible', 'translations'), + 'title' => $this->psCheckout->l('Roundings settings to change', 'translations'), + 'content' => $this->psCheckout->l('Be careful, your roundings settings are not fully compatible with PrestaShop Checkout transaction processing. Some of the transactions could fail. But it is easy, your setting Round mode and Round type should be set on « Round up away from zero, when it is half way there » and « Round on each item » or click on the button bellow to make it automatically !', 'translations'), + 'button' => $this->psCheckout->l('Change rounding settings', 'translations'), + 'confirmationTitle' => $this->psCheckout->l('Settings updated !', 'translations'), + 'confirmationLabel' => $this->psCheckout->l('Your rounding settings are now fully compatible', 'translations'), ], 'reporting' => [ - 'pending' => $this->module->l('pending', 'translations'), - 'title' => $this->module->l('All transactions', 'translations'), - 'subTitle1' => $this->module->l('pending transaction(s)', 'translations'), - 'subTitle2' => $this->module->l('transaction(s)', 'translations'), - 'label' => $this->module->l('See below the transactions processed with PrestaShop Checkout, limited to the last 1000 to load them faster.', 'translations'), - 'subtitleLinkLabel' => $this->module->l('See the full list of transactions on your PayPal account', 'translations'), - 'goToPaypal' => $this->module->l('Go to PayPal', 'translations'), - 'goToTransaction' => $this->module->l('Go to PayPal', 'translations'), - 'orderPendingTableTitle' => $this->module->l('Pending transaction', 'translations'), - 'transactionTableTitle' => $this->module->l('All transactions', 'translations'), + 'pending' => $this->psCheckout->l('pending', 'translations'), + 'title' => $this->psCheckout->l('All transactions', 'translations'), + 'subTitle1' => $this->psCheckout->l('pending transaction(s)', 'translations'), + 'subTitle2' => $this->psCheckout->l('transaction(s)', 'translations'), + 'label' => $this->psCheckout->l('See below the transactions processed with PrestaShop Checkout, limited to the last 1000 to load them faster.', 'translations'), + 'subtitleLinkLabel' => $this->psCheckout->l('See the full list of transactions on your PayPal account', 'translations'), + 'goToPaypal' => $this->psCheckout->l('Go to PayPal', 'translations'), + 'goToTransaction' => $this->psCheckout->l('Go to PayPal', 'translations'), + 'orderPendingTableTitle' => $this->psCheckout->l('Pending transaction', 'translations'), + 'transactionTableTitle' => $this->psCheckout->l('All transactions', 'translations'), 'type' => [ - 'payment' => $this->module->l('Payment', 'translations'), - 'refund' => $this->module->l('Refund', 'translations'), + 'payment' => $this->psCheckout->l('Payment', 'translations'), + 'refund' => $this->psCheckout->l('Refund', 'translations'), ], 'column' => [ - 'date' => $this->module->l('Date', 'translations'), - 'orderId' => $this->module->l('Order Id', 'translations'), - 'customer' => $this->module->l('Customer', 'translations'), - 'type' => $this->module->l('Type', 'translations'), - 'beforeCommission' => $this->module->l('Before commission', 'translations'), - 'commission' => $this->module->l('Commission', 'translations'), - 'total' => $this->module->l('Total', 'translations'), - 'actions' => $this->module->l('Actions', 'translations'), + 'date' => $this->psCheckout->l('Date', 'translations'), + 'orderId' => $this->psCheckout->l('Order Id', 'translations'), + 'customer' => $this->psCheckout->l('Customer', 'translations'), + 'type' => $this->psCheckout->l('Type', 'translations'), + 'beforeCommission' => $this->psCheckout->l('Before commission', 'translations'), + 'commission' => $this->psCheckout->l('Commission', 'translations'), + 'total' => $this->psCheckout->l('Total', 'translations'), + 'actions' => $this->psCheckout->l('Actions', 'translations'), ], ], ], 'paypal' => [ 'order' => [ 'status' => [ - 'CREATED' => $this->module->l('Created', 'translations'), - 'SAVED' => $this->module->l('Saved', 'translations'), - 'APPROVED' => $this->module->l('Approved', 'translations'), - 'PENDING_APPROVAL' => $this->module->l('Pending approval', 'translations'), - 'VOIDED' => $this->module->l('Voided', 'translations'), - 'COMPLETED' => $this->module->l('Completed', 'translations'), - 'PAYER_ACTION_REQUIRED' => $this->module->l('Payer action required', 'translations'), - 'PARTIALLY_COMPLETED' => $this->module->l('Partially completed', 'translations'), + 'CREATED' => $this->psCheckout->l('Created', 'translations'), + 'SAVED' => $this->psCheckout->l('Saved', 'translations'), + 'APPROVED' => $this->psCheckout->l('Approved', 'translations'), + 'PENDING_APPROVAL' => $this->psCheckout->l('Pending approval', 'translations'), + 'VOIDED' => $this->psCheckout->l('Voided', 'translations'), + 'COMPLETED' => $this->psCheckout->l('Completed', 'translations'), + 'PAYER_ACTION_REQUIRED' => $this->psCheckout->l('Payer action required', 'translations'), + 'PARTIALLY_COMPLETED' => $this->psCheckout->l('Partially completed', 'translations'), ], ], 'capture' => [ 'status' => [ - 'COMPLETED' => $this->module->l('Completed', 'translations'), - 'DECLINED' => $this->module->l('Declined', 'translations'), - 'PARTIALLY_REFUNDED' => $this->module->l('Partially refunded', 'translations'), - 'PENDING' => $this->module->l('Pending', 'translations'), - 'REFUNDED' => $this->module->l('Refunded', 'translations'), - 'FAILED' => $this->module->l('Failed', 'translations'), + 'COMPLETED' => $this->psCheckout->l('Completed', 'translations'), + 'DECLINED' => $this->psCheckout->l('Declined', 'translations'), + 'PARTIALLY_REFUNDED' => $this->psCheckout->l('Partially refunded', 'translations'), + 'PENDING' => $this->psCheckout->l('Pending', 'translations'), + 'REFUNDED' => $this->psCheckout->l('Refunded', 'translations'), + 'FAILED' => $this->psCheckout->l('Failed', 'translations'), ], ], ], 'order' => [ 'summary' => [ - 'blockTitle' => $this->module->l('Payment gateway information', 'translations'), - 'notificationFailed' => $this->module->l('Your payment has been declined by our payment gateway, please contact us via the link below.', 'translations'), - 'notificationPendingApproval' => $this->module->l('Your payment needs to be approved, please click the button below.', 'translations'), - 'notificationPayerActionRequired' => $this->module->l('Your payment needs to be authenticated, please click the button below.', 'translations'), - 'fundingSource' => $this->module->l('Funding source', 'translations'), - 'orderIdentifier' => $this->module->l('Order identifier', 'translations'), - 'orderStatus' => $this->module->l('Order status', 'translations'), - 'transactionIdentifier' => $this->module->l('Transaction identifier', 'translations'), - 'transactionStatus' => $this->module->l('Transaction status', 'translations'), - 'amountPaid' => $this->module->l('Amount paid', 'translations'), - 'buttonApprove' => $this->module->l('Approve payment', 'translations'), - 'buttonPayerAction' => $this->module->l('Authenticate payment', 'translations'), - 'externalRedirection' => $this->module->l('You will be redirected to an external secured page of our payment gateway.', 'translations'), - 'contactLink' => $this->module->l('If you have any question, please contact us.', 'translations'), - 'paymentMethodStatus' => $this->module->l('Payment method status', 'translations'), - 'paymentTokenSaved' => $this->module->l('was saved for future purchases', 'translations'), - 'paymentTokenNotSaved' => $this->module->l('was not saved for future purchases', 'translations'), + 'blockTitle' => $this->psCheckout->l('Payment gateway information', 'translations'), + 'notificationFailed' => $this->psCheckout->l('Your payment has been declined by our payment gateway, please contact us via the link below.', 'translations'), + 'notificationPendingApproval' => $this->psCheckout->l('Your payment needs to be approved, please click the button below.', 'translations'), + 'notificationPayerActionRequired' => $this->psCheckout->l('Your payment needs to be authenticated, please click the button below.', 'translations'), + 'fundingSource' => $this->psCheckout->l('Funding source', 'translations'), + 'orderIdentifier' => $this->psCheckout->l('Order identifier', 'translations'), + 'orderStatus' => $this->psCheckout->l('Order status', 'translations'), + 'transactionIdentifier' => $this->psCheckout->l('Transaction identifier', 'translations'), + 'transactionStatus' => $this->psCheckout->l('Transaction status', 'translations'), + 'amountPaid' => $this->psCheckout->l('Amount paid', 'translations'), + 'buttonApprove' => $this->psCheckout->l('Approve payment', 'translations'), + 'buttonPayerAction' => $this->psCheckout->l('Authenticate payment', 'translations'), + 'externalRedirection' => $this->psCheckout->l('You will be redirected to an external secured page of our payment gateway.', 'translations'), + 'contactLink' => $this->psCheckout->l('If you have any question, please contact us.', 'translations'), + 'paymentMethodStatus' => $this->psCheckout->l('Payment method status', 'translations'), + 'paymentTokenSaved' => $this->psCheckout->l('was saved for future purchases', 'translations'), + 'paymentTokenNotSaved' => $this->psCheckout->l('was not saved for future purchases', 'translations'), ], ], 'google_pay' => [ - 'shipping' => $this->module->l('Shipping', 'translations'), - 'tax' => $this->module->l('Tax', 'translations'), - 'total' => $this->module->l('Total', 'translations'), - 'subtotal' => $this->module->l('Subtotal', 'translations'), - 'handling' => $this->module->l('Handling', 'translations'), - 'discount' => $this->module->l('Discount', 'translations'), + 'shipping' => $this->psCheckout->l('Shipping', 'translations'), + 'tax' => $this->psCheckout->l('Tax', 'translations'), + 'total' => $this->psCheckout->l('Total', 'translations'), + 'subtotal' => $this->psCheckout->l('Subtotal', 'translations'), + 'handling' => $this->psCheckout->l('Handling', 'translations'), + 'discount' => $this->psCheckout->l('Discount', 'translations'), ], 'apple_pay' => [ - 'total' => $this->module->l('Total', 'translations'), + 'total' => $this->psCheckout->l('Total', 'translations'), ], ]; diff --git a/src/Updater/CustomerUpdater.php b/src/Updater/CustomerUpdater.php deleted file mode 100644 index 90c2290a0..000000000 --- a/src/Updater/CustomerUpdater.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 - */ - -namespace PrestaShop\Module\PrestashopCheckout\Updater; - -/** - * This is used only on PrestaShop 1.6 - */ -class CustomerUpdater -{ - public static function updateContextCustomer(\Context $context, \Customer $customer) - { - $context->customer = $customer; - $context->cookie->__set('id_customer', (int) $customer->id); - $context->cookie->__set('customer_lastname', $customer->lastname); - $context->cookie->__set('customer_firstname', $customer->firstname); - $context->cookie->__set('passwd', $customer->passwd); - $context->cookie->__set('logged', 1); - $context->cookie->__set('id_customer', (int) $customer->id); - $customer->logged = true; - $context->cookie->__set('email', $customer->email); - $context->cookie->__set('is_guest', $customer->isGuest()); - - if (\Configuration::get('PS_CART_FOLLOWING') && (empty($context->cookie->id_cart) || \Cart::getNbProducts((int) $context->cookie->__get('id_cart')) == 0) && $idCart = (int) \Cart::lastNoneOrderedCart((int) $context->customer->id)) { - $context->cart = new \Cart($idCart); - $context->cart->secure_key = $customer->secure_key; - } else { - $idCarrier = (int) $context->cart->id_carrier; - $context->cart->secure_key = $customer->secure_key; - $context->cart->id_carrier = 0; - $context->cart->setDeliveryOption(null); - $context->cart->updateAddressId($context->cart->id_address_delivery, (int) \Address::getFirstCustomerAddressId((int) $customer->id)); - $context->cart->id_address_delivery = (int) \Address::getFirstCustomerAddressId((int) $customer->id); - $context->cart->id_address_invoice = (int) \Address::getFirstCustomerAddressId((int) $customer->id); - } - $context->cart->id_customer = (int) $customer->id; - - if (isset($idCarrier) && $idCarrier) { - $deliveryOption = [$context->cart->id_address_delivery => $idCarrier . ',']; - $context->cart->setDeliveryOption($deliveryOption); - } - - $context->cart->save(); - $context->cookie->__set('id_cart', (int) $context->cart->id); - $context->cookie->write(); - $context->cart->autosetProductAddress(); - } -} diff --git a/src/Validator/BatchConfigurationValidator.php b/src/Validator/BatchConfigurationValidator.php index 1cc375643..6321af862 100644 --- a/src/Validator/BatchConfigurationValidator.php +++ b/src/Validator/BatchConfigurationValidator.php @@ -39,7 +39,7 @@ class BatchConfigurationValidator */ public function validateAjaxBatchConfiguration($configuration) { - if (empty($configuration) || !is_array($configuration)) { + if (empty($configuration)) { throw new Exception("Config can't be empty"); } diff --git a/src/Validator/MerchantValidator.php b/src/Validator/MerchantValidator.php index 4bc63a45e..8aa20e92b 100644 --- a/src/Validator/MerchantValidator.php +++ b/src/Validator/MerchantValidator.php @@ -26,28 +26,10 @@ class MerchantValidator { - /** - * @var PayPalConfiguration - */ - private $configuration; - /** - * @var PsAccountRepository - */ - private $psAccountRepository; - /** - * @var PrestaShopContext - */ - private $prestaShopContext; - public function __construct( - PayPalConfiguration $configuration, - PsAccountRepository $psAccountRepository, - PrestaShopContext $prestaShopContext - ) { - $this->configuration = $configuration; - $this->psAccountRepository = $psAccountRepository; - $this->prestaShopContext = $prestaShopContext; - } + private PayPalConfiguration $configuration, + private PsAccountRepository $psAccountRepository, + ) {} public function merchantIsValid() { diff --git a/src/WebHookValidation.php b/src/WebHookValidation.php index 72c1a8e45..16ecf71be 100644 --- a/src/WebHookValidation.php +++ b/src/WebHookValidation.php @@ -100,7 +100,7 @@ public function validateRefundResourceValues(array $resource) throw new PsCheckoutException('Resource can\'t be empty', PsCheckoutException::PSCHECKOUT_WEBHOOK_RESOURCE_EMPTY); } - if (empty($resource['amount']['value'])) { + if (!isset($resource['amount']['value'])) { throw new PsCheckoutException('Amount value can\'t be empty', PsCheckoutException::PSCHECKOUT_WEBHOOK_AMOUNT_EMPTY); } diff --git a/tests/OrderStatesTranslationsTest.php b/tests/OrderStatesTranslationsTest.php deleted file mode 100755 index de6756a84..000000000 --- a/tests/OrderStatesTranslationsTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) - */ -use PHPUnit\Framework\TestCase; -use PrestaShop\Module\PrestashopCheckout\Translations\OrderStatesTranslations; - -class OrderStatesTranslationsTest extends TestCase -{ - /** - * @dataProvider getLanguageText - */ - public function testOrderStatesGetLanguageText($resultExpect, $dataToValidate) - { - $this->assertSame( - $resultExpect, - (new OrderStatesTranslations())->getTranslations($dataToValidate) - ); - } - - public function getLanguageText() - { - return [ - [ - [ - 'PS_CHECKOUT_STATE_WAITING_PAYPAL_PAYMENT' => OrderStatesTranslations::PS_CHECKOUT_STATE_WAITING_PAYPAL_PAYMENT['en'], - 'PS_CHECKOUT_STATE_WAITING_CREDIT_CARD_PAYMENT' => OrderStatesTranslations::PS_CHECKOUT_STATE_WAITING_CREDIT_CARD_PAYMENT['en'], - 'PS_CHECKOUT_STATE_WAITING_LOCAL_PAYMENT' => OrderStatesTranslations::PS_CHECKOUT_STATE_WAITING_LOCAL_PAYMENT['en'], - 'PS_CHECKOUT_STATE_AUTHORIZED' => OrderStatesTranslations::PS_CHECKOUT_STATE_AUTHORIZED['en'], - 'PS_CHECKOUT_STATE_PARTIAL_REFUND' => OrderStatesTranslations::PS_CHECKOUT_STATE_PARTIAL_REFUND['en'], - 'PS_CHECKOUT_STATE_WAITING_CAPTURE' => OrderStatesTranslations::PS_CHECKOUT_STATE_WAITING_CAPTURE['en'], - ], - 'en', - ], - [ - [ - 'PS_CHECKOUT_STATE_WAITING_PAYPAL_PAYMENT' => OrderStatesTranslations::PS_CHECKOUT_STATE_WAITING_PAYPAL_PAYMENT['en'], - 'PS_CHECKOUT_STATE_WAITING_CREDIT_CARD_PAYMENT' => OrderStatesTranslations::PS_CHECKOUT_STATE_WAITING_CREDIT_CARD_PAYMENT['en'], - 'PS_CHECKOUT_STATE_WAITING_LOCAL_PAYMENT' => OrderStatesTranslations::PS_CHECKOUT_STATE_WAITING_LOCAL_PAYMENT['en'], - 'PS_CHECKOUT_STATE_AUTHORIZED' => OrderStatesTranslations::PS_CHECKOUT_STATE_AUTHORIZED['en'], - 'PS_CHECKOUT_STATE_PARTIAL_REFUND' => OrderStatesTranslations::PS_CHECKOUT_STATE_PARTIAL_REFUND['en'], - 'PS_CHECKOUT_STATE_WAITING_CAPTURE' => OrderStatesTranslations::PS_CHECKOUT_STATE_WAITING_CAPTURE['en'], - ], - 'notIsoCode', - ], - ]; - } -} diff --git a/tests/PaymentCreateOrderTest.php b/tests/PaymentCreateOrderTest.php deleted file mode 100755 index b9004dff4..000000000 --- a/tests/PaymentCreateOrderTest.php +++ /dev/null @@ -1,147 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) - */ -use GuzzleHttp\Client; -use GuzzleHttp\Message\Response; -use GuzzleHttp\Stream\Stream; -use GuzzleHttp\Subscriber\Mock; -use PHPUnit\Framework\TestCase; -use PrestaShop\Module\PrestashopCheckout\Api\Payment\Order; - -class Link -{ - public function getAdminLink() - { - return 'adminLink'; - } - - public function getModuleLink() - { - return 'moduleLink'; - } -} - -class Module -{ - /** @var \Psr\Log\LoggerInterface */ - private $logger; - - public static function getInstanceByName($name) - { - return new self(); - } - - /** - * @return \Psr\Log\LoggerInterface - */ - public function getLogger() - { - return $this->logger; - } -} - -class Configuration -{ - public static function get($key, $idLang = null, $idShopGroup = null, $idShop = null, $default = false) - { - return $key; - } -} - -class Shop -{ - public $id; -} - -class Context -{ - public $shop; - - public function __construct() - { - $this->shop = new Shop(); - } - - public static function getContext() - { - return new self(); - } -} - -class PaymentCreateOrderTest extends TestCase -{ - public function testCreateOrderDefaultScenario() - { - // TODO: Display a dummy but valid payload - $result = [ - 'data-key' => 'data-value', - ]; - $client = new Client(); - - // Create a mock subscriber and queue two responses. - $mock = new Mock([ - new Response(200, [], Stream::factory(json_encode($result))), - ]); - // Add the mock subscriber to the client. - $client->getEmitter()->attach($mock); - - $order = new Order(new Link(), $client); - - $response = $order->create([]); - - $this->assertSame($result, $response['body']); - } - - public function testCreateOrderUnauthorized() - { - $client = new Client([ - 'defaults' => [ - 'exceptions' => false, - ], - ]); - - $mock = new Mock([ - new Response(401, [], Stream::factory('')), - ]); - $client->getEmitter()->attach($mock); - - $order = new Order(new Link(), $client); - - $response = $order->create([]); - - $this->assertSame(false, $response['status']); - } - - public function testCreateOrderInvalidResponse() - { - $result = 'I\'m not valid json'; - $client = new Client(); - - $mock = new Mock([ - new Response(200, [], Stream::factory($result)), - ]); - $client->getEmitter()->attach($mock); - - $order = new Order(new Link(), $client); - - $response = $order->create([]); - - $this->assertSame(false, $response['status']); - } -} diff --git a/tests/PsxDataValidationTest.php b/tests/PsxDataValidationTest.php deleted file mode 100755 index 0cac95dc7..000000000 --- a/tests/PsxDataValidationTest.php +++ /dev/null @@ -1,681 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) - */ -use PHPUnit\Framework\TestCase; -use PrestaShop\Module\PrestashopCheckout\PsxData\PsxDataValidation; - -class PsxDataValidationTest extends TestCase -{ - /** - * @dataProvider dataProvider - */ - public function testData($resultExpect, $dataToValidate) - { - $this->assertSame( - $resultExpect, - (new PsxDataValidation())->validateData($dataToValidate) - ); - } - - public function dataProvider() - { - return [ - [ - [ - PsxDataValidation::DATA_ERROR, - ], - [], - ], - [ - [ - PsxDataValidation::FIRST_NAME, - PsxDataValidation::LAST_NAME, - PsxDataValidation::LANGUAGE, - PsxDataValidation::STREET, - PsxDataValidation::CITY, - PsxDataValidation::COUNTRY, - PsxDataValidation::ZIPCODE, - PsxDataValidation::PHONE_COUNTRY, - PsxDataValidation::PHONE, - PsxDataValidation::WEBSITE, - PsxDataValidation::GENDER, - PsxDataValidation::SHOP_NAME, - PsxDataValidation::COMPANY_EMR, - PsxDataValidation::CATEGORY, - PsxDataValidation::SUB_CATEGORY, - ], - [ - 'business_contact_first_name' => '', - 'business_contact_last_name' => '', - 'business_contact_language' => '', - 'business_address_street' => '', - 'business_address_city' => '', - 'business_address_country' => '', - 'business_address_state' => '', - 'business_address_zip' => '', - 'business_phone_country' => '', - 'business_phone_state' => '', - 'business_phone' => '', - 'business_website' => ' ', - 'business_contact_gender' => '', - 'shop_name' => '', - 'business_company_emr' => ' ', - 'business_category' => '', - 'business_sub_category' => ' ', - ], - ], - [ - [ - PsxDataValidation::FIRST_NAME, - ], - [ - 'business_contact_first_name' => '2ckKzzAH5F68FWWKQ9wieF1dW85bgTCQuer6OEpMtrJCTOLOnDk8gOESC7TjximRhZkOTPTWLL6Va0AwX3eTOSL8HJduJtsuH3qnxuq9Kedbl8xBt9rxm87v5x63GD6f', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::LAST_NAME, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => '2ckKzzAH5F68FWWKQ9wieF1dW85bgTCQuer6OEpMtrJCTOLOnDk8gOESC7TjximRhZkOTPTWLL6Va0AwX3eTOSL8HJduJtsuH3qnxuq9Kedbl8xBt9rxm87v5x63GD6f', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::LANGUAGE, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'FR FROM FR', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::QUALIFICATION, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'qualification' => '11Mz8IjBZFNUvqNHTBfBbq4Y1VXjOQS0O8kZ02yK6oeDLXQ47fXanLiTm9V6WANBXtCi6L7zgvrcPB8jHyZ8bp5CA197vMHccBFnFYeDpKVTrstv3X2XNwMCPZaTH1z0M4Euv3VC1eNVNIoyzWCFbbcQESvxQag32l4MjfqCSbSQ34N3PaxwxTeSAaSmuENiMHhHxdIPWFkONi0k8oWZSHDqAvwHNQi9D2G4IfXYRcXPBS4zZqwfl0Ft1G6oSukN', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::STREET, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '11Mz8IjBZFNUvqNHTBfBbq4Y1VXjOQS0O8kZ02yK6oeDLXQ47fXanLiTm9V6WANBXtCi6L7zgvrcPB8jHyZ8bp5CA197vMHccBFnFYeDpKVTrstv3X2XNwMCPZaTH1z0M4Euv3VC1eNVNIoyzWCFbbcQESvxQag32l4MjfqCSbSQ34N3PaxwxTeSAaSmuENiMHhHxdIPWFkONi0k8oWZSHDqAvwHNQi9D2G4IfXYRcXPBS4zZqwfl0Ft1G6oSukN', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::CITY, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => '2ckKzzAH5F68FWWKQ9wieF1dW85bgTCQuer6OEpMtrJCTOLOnDk8gOESC7TjximRhZkOTPTWLL6Va0AwX3eTOSL8HJduJtsuH3qnxuq9Kedbl8xBt9rxm87v5x63GD6f', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::COUNTRY, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'frfrr', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::STATE, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'IT', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::ZIPCODE, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => 'iuId2fV7IByE6z5rLDYRewV9nSWTVWxw', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::PHONE_COUNTRY, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '1000', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::PHONE, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '7784 5479 1234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::PHONE, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '7784-5479-2234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::WEBSITE, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'www:// @testshop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::WEBSITE, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => '172.172.172.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::WEBSITE, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'http://localhost', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::WEBSITE, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'http://www.site.com:8008', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::WEBSITE, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'http://www.example.com/products?id=1&page=2', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::WEBSITE, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'http://sqdff.fr/index.php@', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::WEBSITE, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'www.test.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::GENDER, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'a gender', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::SHOP_NAME, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'LsH9e29RMyNOgQXK87eO3o0fShaP3TPbk85yqqD7gVJPaNedsXiPebZVWPmwVSz9G8JEq5hLZYRGoDADW0fPEu07LfxXy33kWSk97SjwbczKWRZlXm6yWKY39P7gKx6VdywuEXXoGSxgRLkFIImDYtdLW2XJ9z5eslORE7zvVK1nO4IuH33JENUvCP3kdtA4jb0gWZNCKqHZpoYri3920NStnfKr7viDo4jUOcTjeTJJ5jLN6gYuAlqMh0yNlnos', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::WEBSITE, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'john@doe.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::COMPANY_EMR, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt50000000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::CATEGORY, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '999', - 'business_sub_category' => '2001', - ], - ], - [ - [ - PsxDataValidation::SUB_CATEGORY, - ], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '1999', - ], - ], - [ - [], - [ - 'business_contact_first_name' => 'Sue', - 'business_contact_last_name' => 'Pachooz', - 'business_contact_language' => 'US', - 'business_address_street' => '42 rue des petits souliers', - 'business_address_city' => 'Lutece', - 'business_address_country' => 'FR', - 'business_address_state' => '', - 'business_address_zip' => '123456', - 'business_phone_country' => '33', - 'business_phone' => '778454791234', - 'business_website' => 'https://shop.my-shoes.com', - 'business_contact_gender' => 'Ms', - 'shop_name' => 'My shoe shop', - 'business_company_emr' => 'lt5000', - 'business_category' => '1001', - 'business_sub_category' => '2001', - ], - ], - ]; - } -} diff --git a/tests/Unit/PayPal/AdvancedCheckoutEligibilityTest.php b/tests/Unit/PayPal/AdvancedCheckoutEligibilityTest.php index 86d03bac2..ed0a6e769 100644 --- a/tests/Unit/PayPal/AdvancedCheckoutEligibilityTest.php +++ b/tests/Unit/PayPal/AdvancedCheckoutEligibilityTest.php @@ -27,7 +27,7 @@ class AdvancedCheckoutEligibilityTest extends TestCase { private $advancedCheckoutEligibility; - public function setUp() + public function setUp(): void { $this->advancedCheckoutEligibility = new AdvancedCheckoutEligibility(); } diff --git a/tests/IsoCodeDispatcherTest.php b/tests/Unit/PaypalCountryCodeMatriceTest.php old mode 100755 new mode 100644 similarity index 96% rename from tests/IsoCodeDispatcherTest.php rename to tests/Unit/PaypalCountryCodeMatriceTest.php index 547dfd673..e90efdd58 --- a/tests/IsoCodeDispatcherTest.php +++ b/tests/Unit/PaypalCountryCodeMatriceTest.php @@ -17,6 +17,9 @@ * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) */ + +namespace Tests\Unit; + use PHPUnit\Framework\TestCase; use PrestaShop\Module\PrestashopCheckout\PaypalCountryCodeMatrice; @@ -25,7 +28,7 @@ class PaypalCountryCodeMatriceTest extends TestCase /** * @dataProvider isoCodeDataProviderPaypal */ - public function testgetPaypalIsoCode($resultExpect, $dataToValidate) + public function testGetPaypalIsoCode($resultExpect, $dataToValidate) { $this->assertSame( $resultExpect, diff --git a/tests/Unit/Version/VersionTest.php b/tests/Unit/Version/VersionTest.php index 100168b50..91e839747 100644 --- a/tests/Unit/Version/VersionTest.php +++ b/tests/Unit/Version/VersionTest.php @@ -48,7 +48,7 @@ class VersionTest extends TestCase const ANOTHER_MINOR_VERSION = 1; const ANOTHER_RELEASE_VERSION = 0; - protected function setUp() + protected function setUp(): void { $this->version = new Version( self::VERSION, diff --git a/tests/WebHookValidationTest.php b/tests/Unit/Webhook/WebHookValidationTest.php old mode 100755 new mode 100644 similarity index 96% rename from tests/WebHookValidationTest.php rename to tests/Unit/Webhook/WebHookValidationTest.php index 9f2051f23..097f69f2a --- a/tests/WebHookValidationTest.php +++ b/tests/Unit/Webhook/WebHookValidationTest.php @@ -17,6 +17,9 @@ * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) */ + +namespace Tests\Unit\Webhook; + use PHPUnit\Framework\TestCase; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; use PrestaShop\Module\PrestashopCheckout\WebHookValidation; @@ -205,6 +208,14 @@ public function resourceDataProvider() ], [ PsCheckoutException::PSCHECKOUT_WEBHOOK_AMOUNT_EMPTY, + [ + 'amount' => [ + 'currency_code' => 'EUR', + ], + ], + ], + [ + PsCheckoutException::PSCHECKOUT_WEBHOOK_AMOUNT_INVALID, [ 'amount' => [ 'value' => '', diff --git a/tests/phpstan/phpstan-PS-1.6.neon b/tests/phpstan/phpstan-PS-1.6.neon deleted file mode 100644 index baccbf818..000000000 --- a/tests/phpstan/phpstan-PS-1.6.neon +++ /dev/null @@ -1,35 +0,0 @@ -includes: - - %currentWorkingDirectory%/vendor/prestashop/php-dev-tools/phpstan/ps-module-extension.neon - -parameters: - paths: - # From PHPStan 0.12, paths to check are relative to the neon file - - ../../classes - - ../../controllers - - ../../src - - ../../ps_checkout.php - reportUnmatchedIgnoredErrors: false - ignoreErrors: - - '#Cannot assign offset "merchant…" to string\|true.#' - - '#Property ModuleCore::\$version \(float\) does not accept string.#' - - '#Strict comparison using === between false and string will always evaluate to false.#' - - '#Call to function is_array\(\) with Currency will always evaluate to false.#' - - '#Parameter \#1 \$id of class Customer constructor expects null, int given.#' - - '#Parameter \#1 \$hook_name of method ModuleCore::registerHook\(\) expects string, array given.#' - - '#Parameter \#6 \$idShop of method LinkCore::getModuleLink\(\) expects null, int given.#' - - '#Call to an undefined method\(\) AdminController|FrontController::getCheckoutProcess\(\).#' - - '#Parameter \#1 \$id_hook of method ModuleCore::updatePosition\(\) expects bool, int given.#' - - '#Property TabCore::\$name \(string\) does not accept array.#' - - '#Access to an undefined property PaymentModule::\$currentOrderReference.#' - - '#Property CustomerCore::\$passwd \(int\) does not accept bool\|string.#' - - '#Parameter \#4 \$ssl of method LinkCore::getModuleLink\(\) expects null, true given.#' - - # Ignore errors with classes from PS 1.7 - - '#CheckoutPaymentStep#' - - '#PrestaShop\\PrestaShop\\Adapter\\Cart\\CartPresenter#' - - '#PrestaShop\\PrestaShop\\Core\\Payment\\PaymentOption#' - - '#Call to an undefined method AdminController\|FrontController::registerStylesheet\(\)#' - - '#Method LinkCore::getAdminLink\(\) invoked with 4 parameters, 1-2 required.#' - - '#Static method ConfigurationCore::get\(\) invoked with 5 parameters, 1-4 required.#' - - level: 2 diff --git a/tests/phpstan/phpstan-PS-1.7.neon b/tests/phpstan/phpstan-PS-1.7.neon deleted file mode 100644 index 93269d39c..000000000 --- a/tests/phpstan/phpstan-PS-1.7.neon +++ /dev/null @@ -1,39 +0,0 @@ -includes: - - %currentWorkingDirectory%/vendor/prestashop/php-dev-tools/phpstan/ps-module-extension.neon - -parameters: - paths: - # From PHPStan 0.12, paths to check are relative to the neon file - - ../../classes - - ../../controllers - - ../../src - - ../../ps_checkout.php - reportUnmatchedIgnoredErrors: false - ignoreErrors: - - '#Cannot assign offset "merchant…" to string\|true.#' - - '#Property ModuleCore::\$version \(float\) does not accept string.#' - - '#Strict comparison using === between false and string will always evaluate to false.#' - - '#Call to function is_array\(\) with Currency will always evaluate to false.#' - - '#Parameter \#1 \$id of class Customer constructor expects null, bool\|int<1, max>\|int given.#' - - '#Parameter \#1 \$id of class Customer constructor expects null, int\|int<1, max> given.#' - - '#Parameter \#1 \$id of class Customer constructor expects null, int given.#' - - '#Parameter \#1 \$hook_name of method ModuleCore::registerHook\(\) expects string, array given.#' - - '#Parameter \#6 \$idShop of method LinkCore::getModuleLink\(\) expects null, int given.#' - - '#Call to an undefined method\(\) AdminController|FrontController::getCheckoutProcess\(\).#' - - '#Parameter \#1 \$id_hook of method ModuleCore::updatePosition\(\) expects bool, int given.#' - - '#Property TabCore::\$name \(string\) does not accept array.#' - - '#Access to an undefined property PaymentModule::\$currentOrderReference.#' - - '#Property CustomerCore::\$passwd \(int\) does not accept bool\|string.#' - - '#Property CustomerCore::\$passwd \(int\) does not accept string.#' - - '#Parameter \#4 \$ssl of method LinkCore::getModuleLink\(\) expects null, true given.#' - - '#Parameter \#1 \$id of class Customer constructor expects null, int<1, max>\|int given.#' - - '#Property CustomerMessageCore::\$ip_address \(string\) does not accept int.#' - - '#Left side of \&\& is always true.#' - - '#Parameter \#7 \$currency_special of method PaymentModuleCore::validateOrder\(\) expects null, int given.#' - - '#Parameter \#9 \$secure_key of method PaymentModuleCore::validateOrder\(\) expects bool, string given.#' - - '#Property CustomerMessageCore::\$private \(int\) does not accept true.#' - - '#Parameter \#1 \$id of class Currency constructor expects null, int given.#' - - '#Parameter \#1 \$amount_paid of method OrderCore::addOrderPayment\(\) expects float, string given.#' - - '#Parameter \#3 \$amount_paid of method PaymentModuleCore::validateOrder\(\) expects float, string given.#' - - level: 5 diff --git a/tests/phpstan/phpstan-PS-8.neon b/tests/phpstan/phpstan.neon similarity index 99% rename from tests/phpstan/phpstan-PS-8.neon rename to tests/phpstan/phpstan.neon index bb2f93ac4..e57f36873 100644 --- a/tests/phpstan/phpstan-PS-8.neon +++ b/tests/phpstan/phpstan.neon @@ -1,6 +1,5 @@ includes: - %currentWorkingDirectory%/vendor/prestashop/php-dev-tools/phpstan/ps-module-extension.neon - parameters: paths: # From PHPStan 0.12, paths to check are relative to the neon file diff --git a/views/templates/hook/adminAfterHeader/incompatibleCodes.tpl b/views/templates/hook/adminAfterHeader/incompatibleCodes.tpl index 26a7df5c7..5bacf186a 100644 --- a/views/templates/hook/adminAfterHeader/incompatibleCodes.tpl +++ b/views/templates/hook/adminAfterHeader/incompatibleCodes.tpl @@ -19,14 +19,10 @@ {if $incompatibleCodes}
- {if $isShop17} - -{/if} -{if $is17} -{/if}