From 1570f1473b17e386a6551876fa5aba6897fb5206 Mon Sep 17 00:00:00 2001 From: maxperei Date: Tue, 15 Apr 2025 11:35:37 +0200 Subject: [PATCH 001/112] chore(sf): [dir] move configs/templates/assets/migrations to new file structure --- CONTRIBUTING.md | 4 +- Makefile | 34 ++++++------ README.md | 10 ++-- {src/Resources/dev => assets}/.eslintignore | 0 {src/Resources/dev => assets}/.eslintrc | 0 {src/Resources/dev => assets}/.gitignore | 0 .../admin/payment_method/index.scss | 0 .../images/integrated/account.svg | 0 .../images/integrated/calendar.svg | 0 .../dev => assets}/images/integrated/card.svg | 0 .../images/integrated/cb-dark.svg | 0 .../dev => assets}/images/integrated/cb.svg | 0 .../dev => assets}/images/integrated/lock.svg | 0 .../images/integrated/logo-payplug.png | Bin .../images/integrated/mastercard-dark.svg | 0 .../images/integrated/mastercard.svg | 0 .../images/integrated/visa-dark.svg | 0 .../dev => assets}/images/integrated/visa.svg | 0 {src/Resources/dev => assets}/package.json | 0 .../dev => assets}/settings/constants.scss | 0 .../dev => assets}/shop/account/index.scss | 0 .../dev => assets}/shop/oney_cart/index.js | 0 .../dev => assets}/shop/oney_common/index.js | 0 .../shop/oney_common/index.scss | 0 .../dev => assets}/shop/oney_popin/index.js | 0 .../dev => assets}/shop/oney_popin/index.scss | 0 .../dev => assets}/shop/payment/index.js | 0 .../dev => assets}/shop/payment/index.scss | 0 .../dev => assets}/shop/payment/integrated.js | 0 .../shop/payment/integrated.scss | 0 {src/Resources/dev => assets}/yarn.lock | 0 {src/Resources/config => config}/config.yml | 0 .../config => config}/resources.yaml | 0 {src/Resources/config => config}/routing.yaml | 0 {src/Resources/config => config}/services.xml | 4 +- .../config => config}/services/action.xml | 0 .../config => config}/services/client.xml | 0 .../config => config}/services/gateway.xml | 0 .../services/no_defaults.xml | 0 .../config => config}/state_machine.yml | 0 .../state_machine/sylius_order_payment.yaml | 0 .../state_machine/sylius_payment.yml | 0 {src/Resources/config => config}/ui.yaml | 0 doc/development.md | 14 ++--- .../config/packages/sylius_payplug.yaml | 4 +- .../config/packages/sylius_refund.yaml | 2 +- .../Application/config/routes/payplug.yaml | 2 +- .../config/routes/sylius_refund.yaml | 2 +- install/app-114/.gitignore | 3 ++ install/app-114/config/packages/payplug.yaml | 30 +++++++++++ .../config/packages/sylius_payplug.yaml | 3 ++ .../config/packages/sylius_refund.yaml | 2 + install/app-114/config/routes/payplug.yaml | 2 + .../app-114/config/routes/sylius_refund.yaml | 2 + install/app-114/config/services_payplug.yaml | 37 +++++++++++++ .../app-114/src/Entity/Customer/Customer.php | 27 ++++++++++ .../app-114/src/Entity/Payment/Payment.php | 27 ++++++++++ .../src/Entity/Payment/PaymentMethod.php | 33 ++++++++++++ .../Version20210410143918.php | 0 .../Version20210823123914.php | 0 .../assets/admin/payment_method/index.css | 0 .../assets/american-express/logo.svg | 50 +++++++++--------- .../assets/apple-pay/logo.svg | 0 .../assets/bancontact/logo.svg | 0 .../public => public}/assets/oney/3x.svg | 0 .../assets/oney/3x4x-alt.svg | 0 .../assets/oney/3x4x-without-fees-alt.svg | 0 .../assets/oney/3x4x-without-fees.svg | 0 .../public => public}/assets/oney/3x4x.svg | 0 .../public => public}/assets/oney/4x.svg | 0 .../public => public}/assets/oney/logo.svg | 0 .../assets/oney/oney_x3_with_fees.svg | 0 .../assets/oney/oney_x3_without_fees.svg | 0 .../assets/oney/oney_x4_with_fees.svg | 0 .../assets/oney/oney_x4_without_fees.svg | 0 .../assets/shop/account.039342ad.svg | 0 .../assets/shop/account/index.css | 0 .../assets/shop/calendar.3c23bb16.svg | 0 .../assets/shop/card.0d2bd9bc.svg | 0 .../assets/shop/cb-dark.888aec45.svg | 0 .../assets/shop/cb.ccd964e9.svg | 0 .../assets/shop/images/integrated/lock.svg | 0 .../shop/images/integrated/logo-payplug.png | Bin .../assets/shop/lock.fe8a73cd.svg | 0 .../assets/shop/mastercard-dark.8977e440.svg | 0 .../assets/shop/mastercard.7dd4ce0b.svg | 0 .../assets/shop/oney_cart/index.js | 0 .../assets/shop/oney_common/index.css | 0 .../assets/shop/oney_common/index.js | 0 .../assets/shop/oney_popin/index.css | 0 .../assets/shop/oney_popin/index.js | 0 .../assets/shop/payment/index.css | 0 .../assets/shop/payment/index.js | 0 .../assets/shop/payment/integrated.css | 0 .../assets/shop/payment/integrated.js | 0 .../assets/shop/visa-dark.87c34e0f.svg | 0 .../assets/shop/visa.d11a46f6.svg | 0 .../PayPlugSyliusPayPlugExtension.php | 23 ++++---- src/PayPlugSyliusPayPlugPlugin.php | 5 ++ .../Order/Show/_payment.html.twig | 0 .../SavedCards/Index/_header.html.twig | 0 .../SavedCards/Index/_subcontent.html.twig | 0 .../Checkout/SelectPayment/_choice.html.twig | 0 .../SelectPayment/_navigation.html.twig | 0 .../SyliusShopBundle/Order/show.html.twig | 0 .../Modal/_confirmation.html.twig | 0 .../views => templates}/card/index.html.twig | 0 .../views => templates}/card/layout.html.twig | 0 .../form/complete_info_popin.html.twig | 0 .../form/form_gateway_config_row.html.twig | 0 .../form/integrated.html.twig | 0 .../javascripts/oney_common.html.twig | 0 .../javascripts/select_payment_js.html.twig | 0 .../javascripts/webfont_loader.html.twig | 0 .../oney/cart/pay_with_oney.html.twig | 0 .../views => templates}/oney/popin.html.twig | 0 .../oney/product/pay_with_oney.html.twig | 0 .../views => templates}/shop/1click.html.twig | 0 .../stylesheets/oney_common.html.twig | 0 .../stylesheets/payment_method_css.html.twig | 0 .../stylesheets/saved_cards.html.twig | 0 .../stylesheets/select_payment_css.html.twig | 0 .../flashes.en.yml | 0 .../flashes.fr.yml | 0 .../flashes.it.yml | 0 .../messages.en.yml | 0 .../messages.fr.yml | 0 .../messages.it.yml | 0 .../validators.en.yml | 0 .../validators.fr.yml | 0 .../validators.it.yml | 0 131 files changed, 246 insertions(+), 74 deletions(-) rename {src/Resources/dev => assets}/.eslintignore (100%) rename {src/Resources/dev => assets}/.eslintrc (100%) rename {src/Resources/dev => assets}/.gitignore (100%) rename {src/Resources/dev => assets}/admin/payment_method/index.scss (100%) rename {src/Resources/dev => assets}/images/integrated/account.svg (100%) rename {src/Resources/dev => assets}/images/integrated/calendar.svg (100%) rename {src/Resources/dev => assets}/images/integrated/card.svg (100%) rename {src/Resources/dev => assets}/images/integrated/cb-dark.svg (100%) rename {src/Resources/dev => assets}/images/integrated/cb.svg (100%) rename {src/Resources/dev => assets}/images/integrated/lock.svg (100%) rename {src/Resources/dev => assets}/images/integrated/logo-payplug.png (100%) rename {src/Resources/dev => assets}/images/integrated/mastercard-dark.svg (100%) rename {src/Resources/dev => assets}/images/integrated/mastercard.svg (100%) rename {src/Resources/dev => assets}/images/integrated/visa-dark.svg (100%) rename {src/Resources/dev => assets}/images/integrated/visa.svg (100%) rename {src/Resources/dev => assets}/package.json (100%) rename {src/Resources/dev => assets}/settings/constants.scss (100%) rename {src/Resources/dev => assets}/shop/account/index.scss (100%) rename {src/Resources/dev => assets}/shop/oney_cart/index.js (100%) rename {src/Resources/dev => assets}/shop/oney_common/index.js (100%) rename {src/Resources/dev => assets}/shop/oney_common/index.scss (100%) rename {src/Resources/dev => assets}/shop/oney_popin/index.js (100%) rename {src/Resources/dev => assets}/shop/oney_popin/index.scss (100%) rename {src/Resources/dev => assets}/shop/payment/index.js (100%) rename {src/Resources/dev => assets}/shop/payment/index.scss (100%) rename {src/Resources/dev => assets}/shop/payment/integrated.js (100%) rename {src/Resources/dev => assets}/shop/payment/integrated.scss (100%) rename {src/Resources/dev => assets}/yarn.lock (100%) rename {src/Resources/config => config}/config.yml (100%) rename {src/Resources/config => config}/resources.yaml (100%) rename {src/Resources/config => config}/routing.yaml (100%) rename {src/Resources/config => config}/services.xml (99%) rename {src/Resources/config => config}/services/action.xml (100%) rename {src/Resources/config => config}/services/client.xml (100%) rename {src/Resources/config => config}/services/gateway.xml (100%) rename {src/Resources/config => config}/services/no_defaults.xml (100%) rename {src/Resources/config => config}/state_machine.yml (100%) rename {src/Resources/config => config}/state_machine/sylius_order_payment.yaml (100%) rename {src/Resources/config => config}/state_machine/sylius_payment.yml (100%) rename {src/Resources/config => config}/ui.yaml (100%) create mode 100644 install/app-114/.gitignore create mode 100644 install/app-114/config/packages/payplug.yaml create mode 100644 install/app-114/config/packages/sylius_payplug.yaml create mode 100644 install/app-114/config/packages/sylius_refund.yaml create mode 100644 install/app-114/config/routes/payplug.yaml create mode 100755 install/app-114/config/routes/sylius_refund.yaml create mode 100644 install/app-114/config/services_payplug.yaml create mode 100644 install/app-114/src/Entity/Customer/Customer.php create mode 100644 install/app-114/src/Entity/Payment/Payment.php create mode 100644 install/app-114/src/Entity/Payment/PaymentMethod.php rename {src/Migrations => migrations}/Version20210410143918.php (100%) rename {src/Migrations => migrations}/Version20210823123914.php (100%) rename {src/Resources/public => public}/assets/admin/payment_method/index.css (100%) rename {src/Resources/public => public}/assets/american-express/logo.svg (98%) rename {src/Resources/public => public}/assets/apple-pay/logo.svg (100%) rename {src/Resources/public => public}/assets/bancontact/logo.svg (100%) rename {src/Resources/public => public}/assets/oney/3x.svg (100%) rename {src/Resources/public => public}/assets/oney/3x4x-alt.svg (100%) rename {src/Resources/public => public}/assets/oney/3x4x-without-fees-alt.svg (100%) rename {src/Resources/public => public}/assets/oney/3x4x-without-fees.svg (100%) rename {src/Resources/public => public}/assets/oney/3x4x.svg (100%) rename {src/Resources/public => public}/assets/oney/4x.svg (100%) rename {src/Resources/public => public}/assets/oney/logo.svg (100%) rename {src/Resources/public => public}/assets/oney/oney_x3_with_fees.svg (100%) rename {src/Resources/public => public}/assets/oney/oney_x3_without_fees.svg (100%) rename {src/Resources/public => public}/assets/oney/oney_x4_with_fees.svg (100%) rename {src/Resources/public => public}/assets/oney/oney_x4_without_fees.svg (100%) rename {src/Resources/public => public}/assets/shop/account.039342ad.svg (100%) rename {src/Resources/public => public}/assets/shop/account/index.css (100%) rename {src/Resources/public => public}/assets/shop/calendar.3c23bb16.svg (100%) rename {src/Resources/public => public}/assets/shop/card.0d2bd9bc.svg (100%) rename {src/Resources/public => public}/assets/shop/cb-dark.888aec45.svg (100%) rename {src/Resources/public => public}/assets/shop/cb.ccd964e9.svg (100%) rename {src/Resources/public => public}/assets/shop/images/integrated/lock.svg (100%) rename {src/Resources/public => public}/assets/shop/images/integrated/logo-payplug.png (100%) rename {src/Resources/public => public}/assets/shop/lock.fe8a73cd.svg (100%) rename {src/Resources/public => public}/assets/shop/mastercard-dark.8977e440.svg (100%) rename {src/Resources/public => public}/assets/shop/mastercard.7dd4ce0b.svg (100%) rename {src/Resources/public => public}/assets/shop/oney_cart/index.js (100%) rename {src/Resources/public => public}/assets/shop/oney_common/index.css (100%) rename {src/Resources/public => public}/assets/shop/oney_common/index.js (100%) rename {src/Resources/public => public}/assets/shop/oney_popin/index.css (100%) rename {src/Resources/public => public}/assets/shop/oney_popin/index.js (100%) rename {src/Resources/public => public}/assets/shop/payment/index.css (100%) rename {src/Resources/public => public}/assets/shop/payment/index.js (100%) rename {src/Resources/public => public}/assets/shop/payment/integrated.css (100%) rename {src/Resources/public => public}/assets/shop/payment/integrated.js (100%) rename {src/Resources/public => public}/assets/shop/visa-dark.87c34e0f.svg (100%) rename {src/Resources/public => public}/assets/shop/visa.d11a46f6.svg (100%) rename {src/Resources/views => templates}/SyliusAdminBundle/Order/Show/_payment.html.twig (100%) rename {src/Resources/views => templates}/SyliusShopBundle/Account/SavedCards/Index/_header.html.twig (100%) rename {src/Resources/views => templates}/SyliusShopBundle/Account/SavedCards/Index/_subcontent.html.twig (100%) rename {src/Resources/views => templates}/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig (100%) rename {src/Resources/views => templates}/SyliusShopBundle/Checkout/SelectPayment/_navigation.html.twig (100%) rename {src/Resources/views => templates}/SyliusShopBundle/Order/show.html.twig (100%) rename {src/Resources/views => templates}/SyliusUiBundle/Modal/_confirmation.html.twig (100%) rename {src/Resources/views => templates}/card/index.html.twig (100%) rename {src/Resources/views => templates}/card/layout.html.twig (100%) rename {src/Resources/views => templates}/form/complete_info_popin.html.twig (100%) rename {src/Resources/views => templates}/form/form_gateway_config_row.html.twig (100%) rename {src/Resources/views => templates}/form/integrated.html.twig (100%) rename {src/Resources/views => templates}/javascripts/oney_common.html.twig (100%) rename {src/Resources/views => templates}/javascripts/select_payment_js.html.twig (100%) rename {src/Resources/views => templates}/javascripts/webfont_loader.html.twig (100%) rename {src/Resources/views => templates}/oney/cart/pay_with_oney.html.twig (100%) rename {src/Resources/views => templates}/oney/popin.html.twig (100%) rename {src/Resources/views => templates}/oney/product/pay_with_oney.html.twig (100%) rename {src/Resources/views => templates}/shop/1click.html.twig (100%) rename {src/Resources/views => templates}/stylesheets/oney_common.html.twig (100%) rename {src/Resources/views => templates}/stylesheets/payment_method_css.html.twig (100%) rename {src/Resources/views => templates}/stylesheets/saved_cards.html.twig (100%) rename {src/Resources/views => templates}/stylesheets/select_payment_css.html.twig (100%) rename {src/Resources/translations => translations}/flashes.en.yml (100%) rename {src/Resources/translations => translations}/flashes.fr.yml (100%) rename {src/Resources/translations => translations}/flashes.it.yml (100%) rename {src/Resources/translations => translations}/messages.en.yml (100%) rename {src/Resources/translations => translations}/messages.fr.yml (100%) rename {src/Resources/translations => translations}/messages.it.yml (100%) rename {src/Resources/translations => translations}/validators.en.yml (100%) rename {src/Resources/translations => translations}/validators.fr.yml (100%) rename {src/Resources/translations => translations}/validators.it.yml (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 30982a48..8c9b7307 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ From the plugin root directory, run the following commands: $ make install -e SYLIUS_VERSION=XX SYMFONY_VERSION=YY PHP_VERSION=ZZ ``` -Default values : XX=1.12.0 and YY=6.1 and ZZ=8.1 +Default values : XX=1.14.0 and YY=6.4 and ZZ=8.2 To be able to setup the plugin database, remember to configure you database credentials in `install/Application/.env.local` and `install/Application/.env.test.local`. @@ -22,7 +22,7 @@ $ make reset - GrumPHP (see configuration [grumphp.yml](grumphp.yml).) - GrumPHP is executed by the Git pre-commit hook, but you can launch it manualy with : + GrumPHP is executed by the Git pre-commit hook, but you can launch it manually with : ```bash $ make grumphp diff --git a/Makefile b/Makefile index cc5d2e48..04fe4eb1 100644 --- a/Makefile +++ b/Makefile @@ -2,27 +2,28 @@ SHELL=/bin/bash COMPOSER_ROOT=composer TEST_DIRECTORY=tests/Application -CONSOLE=cd tests/Application && php bin/console -e test -COMPOSER=cd tests/Application && composer -YARN=cd tests/Application && yarn - -SYLIUS_VERSION=1.12.0 -SYMFONY_VERSION=6.1 -PHP_VERSION=8.1 +INSTALL_DIRECTORY=install/Application +CONSOLE=cd ${TEST_DIRECTORY} && php bin/console -e test +COMPOSER=cd ${TEST_DIRECTORY} && composer +YARN=cd ${TEST_DIRECTORY} && yarn + +SYLIUS_VERSION=1.14.0 +SYMFONY_VERSION=6.4 +PHP_VERSION=8.2 PLUGIN_NAME=payplug/sylius-payplug-plugin ### ### DEVELOPMENT ### ¯¯¯¯¯¯¯¯¯¯¯ -install: sylius ## Install Plugin on Sylius [SYLIUS_VERSION=1.12.0] [SYMFONY_VERSION=6.1] [PHP_VERSION=8.1] +install: sylius ## Install Plugin on Sylius [SYLIUS_VERSION=1.14.0] [SYMFONY_VERSION=6.4] [PHP_VERSION=8.2] .PHONY: install reset: ## Remove dependencies -ifneq ("$(wildcard tests/Application/bin/console)","") +ifneq ("$(wildcard ${TEST_DIRECTORY}/bin/console)","") ${CONSOLE} doctrine:database:drop --force --if-exists || true endif - rm -rf tests/Application + rm -rf ${TEST_DIRECTORY} .PHONY: reset phpunit: phpunit-configure phpunit-run ## Run PHPUnit @@ -55,29 +56,28 @@ install-plugin: ${COMPOSER} config prefer-stable true ${COMPOSER} require "${PLUGIN_NAME}:*" --prefer-source --no-scripts - cp -r install/Application tests + cp -r ${INSTALL_DIRECTORY} tests sed -i "4a \ \ \ \ form_themes: ['form/form_gateway_config_row.html.twig']" ${TEST_DIRECTORY}/config/packages/twig.yaml mkdir -p ${TEST_DIRECTORY}/templates/form/ - cp -R src/Resources/views/form/* ${TEST_DIRECTORY}/templates/form/ + cp -R templates/form/* ${TEST_DIRECTORY}/templates/form/ # As of sylius/refund-plugin 1.2 the folder does not exist anymore ifneq ($(PHP_VERSION), 8) mkdir -p ${TEST_DIRECTORY}/templates/bundles/SyliusAdminBundle/ - cp -R src/Resources/views/SyliusAdminBundle/* ${TEST_DIRECTORY}/templates/bundles/SyliusAdminBundle/ + cp -R templates/SyliusAdminBundle/* ${TEST_DIRECTORY}/templates/bundles/SyliusAdminBundle/ endif install-sylius: #${CONSOLE} sylius:install -n -s default - ${CONSOLE} doctrine:database:create -n + ${CONSOLE} doctrine:database:create -n --if-not-exists ${CONSOLE} messenger:setup-transports -n ${CONSOLE} doctrine:migration:migrate -n ${CONSOLE} sylius:fixture:load -n + ${CONSOLE} assets:install --no-ansi ${YARN} install ${YARN} build - ${YARN} gulp ${CONSOLE} translation:extract en PayPlugSyliusPayPlugPlugin --dump-messages ${CONSOLE} translation:extract fr PayPlugSyliusPayPlugPlugin --dump-messages - ${CONSOLE} cache:clear phpunit-configure: @@ -101,7 +101,7 @@ grumphp: vendor/bin/grumphp run help: SHELL=/bin/bash -help: ## Dislay this help +help: ## Display this help @IFS=$$'\n'; for line in `grep -h -E '^[a-zA-Z_#-]+:?.*?##.*$$' $(MAKEFILE_LIST)`; do if [ "$${line:0:2}" = "##" ]; then \ echo $$line | awk 'BEGIN {FS = "## "}; {printf "\033[33m %s\033[0m\n", $$2}'; else \ echo $$line | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m%s\n", $$1, $$2}'; fi; \ diff --git a/README.md b/README.md index 7f1e8df1..4c4623db 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ In local environment, the plugin will not work properly because you will not be ```shell mkdir -p templates/bundles/SyliusAdminBundle/ - cp -R vendor/payplug/sylius-payplug-plugin/src/Resources/views/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/ + cp -R vendor/payplug/sylius-payplug-plugin/templates/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/ ``` 4. Add Payplug to refundable payment method for Sylius Refund Plugin in `config/services.yaml` @@ -70,7 +70,7 @@ In local environment, the plugin will not work properly because you will not be ```yaml sylius_payplug: - resource: "@PayPlugSyliusPayPlugPlugin/Resources/config/routing.yaml" + resource: "@PayPlugSyliusPayPlugPlugin/config/routing.yaml" ``` 8. Add Traits for Customer and PaymentMethod entities @@ -209,9 +209,9 @@ Copy Sylius templates overridden in plugin to your templates directory (e.g temp mkdir -p templates/bundles/SyliusAdminBundle/ mkdir -p templates/bundles/SyliusShopBundle/ mkdir -p templates/bundles/SyliusUiBundle/ -cp -R vendor/payplug/sylius-payplug-plugin/src/Resources/views/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/ -cp -R vendor/payplug/sylius-payplug-plugin/src/Resources/views/SyliusShopBundle/* templates/bundles/SyliusShopBundle/ -cp -R vendor/payplug/sylius-payplug-plugin/src/Resources/views/SyliusUiBundle/* templates/bundles/SyliusUiBundle/ +cp -R vendor/payplug/sylius-payplug-plugin/templates/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/ +cp -R vendor/payplug/sylius-payplug-plugin/templates/SyliusShopBundle/* templates/bundles/SyliusShopBundle/ +cp -R vendor/payplug/sylius-payplug-plugin/templates/SyliusUiBundle/* templates/bundles/SyliusUiBundle/ ``` You also need to edit your twig config to add your path to avoid our configuration to be prepended : diff --git a/src/Resources/dev/.eslintignore b/assets/.eslintignore similarity index 100% rename from src/Resources/dev/.eslintignore rename to assets/.eslintignore diff --git a/src/Resources/dev/.eslintrc b/assets/.eslintrc similarity index 100% rename from src/Resources/dev/.eslintrc rename to assets/.eslintrc diff --git a/src/Resources/dev/.gitignore b/assets/.gitignore similarity index 100% rename from src/Resources/dev/.gitignore rename to assets/.gitignore diff --git a/src/Resources/dev/admin/payment_method/index.scss b/assets/admin/payment_method/index.scss similarity index 100% rename from src/Resources/dev/admin/payment_method/index.scss rename to assets/admin/payment_method/index.scss diff --git a/src/Resources/dev/images/integrated/account.svg b/assets/images/integrated/account.svg similarity index 100% rename from src/Resources/dev/images/integrated/account.svg rename to assets/images/integrated/account.svg diff --git a/src/Resources/dev/images/integrated/calendar.svg b/assets/images/integrated/calendar.svg similarity index 100% rename from src/Resources/dev/images/integrated/calendar.svg rename to assets/images/integrated/calendar.svg diff --git a/src/Resources/dev/images/integrated/card.svg b/assets/images/integrated/card.svg similarity index 100% rename from src/Resources/dev/images/integrated/card.svg rename to assets/images/integrated/card.svg diff --git a/src/Resources/dev/images/integrated/cb-dark.svg b/assets/images/integrated/cb-dark.svg similarity index 100% rename from src/Resources/dev/images/integrated/cb-dark.svg rename to assets/images/integrated/cb-dark.svg diff --git a/src/Resources/dev/images/integrated/cb.svg b/assets/images/integrated/cb.svg similarity index 100% rename from src/Resources/dev/images/integrated/cb.svg rename to assets/images/integrated/cb.svg diff --git a/src/Resources/dev/images/integrated/lock.svg b/assets/images/integrated/lock.svg similarity index 100% rename from src/Resources/dev/images/integrated/lock.svg rename to assets/images/integrated/lock.svg diff --git a/src/Resources/dev/images/integrated/logo-payplug.png b/assets/images/integrated/logo-payplug.png similarity index 100% rename from src/Resources/dev/images/integrated/logo-payplug.png rename to assets/images/integrated/logo-payplug.png diff --git a/src/Resources/dev/images/integrated/mastercard-dark.svg b/assets/images/integrated/mastercard-dark.svg similarity index 100% rename from src/Resources/dev/images/integrated/mastercard-dark.svg rename to assets/images/integrated/mastercard-dark.svg diff --git a/src/Resources/dev/images/integrated/mastercard.svg b/assets/images/integrated/mastercard.svg similarity index 100% rename from src/Resources/dev/images/integrated/mastercard.svg rename to assets/images/integrated/mastercard.svg diff --git a/src/Resources/dev/images/integrated/visa-dark.svg b/assets/images/integrated/visa-dark.svg similarity index 100% rename from src/Resources/dev/images/integrated/visa-dark.svg rename to assets/images/integrated/visa-dark.svg diff --git a/src/Resources/dev/images/integrated/visa.svg b/assets/images/integrated/visa.svg similarity index 100% rename from src/Resources/dev/images/integrated/visa.svg rename to assets/images/integrated/visa.svg diff --git a/src/Resources/dev/package.json b/assets/package.json similarity index 100% rename from src/Resources/dev/package.json rename to assets/package.json diff --git a/src/Resources/dev/settings/constants.scss b/assets/settings/constants.scss similarity index 100% rename from src/Resources/dev/settings/constants.scss rename to assets/settings/constants.scss diff --git a/src/Resources/dev/shop/account/index.scss b/assets/shop/account/index.scss similarity index 100% rename from src/Resources/dev/shop/account/index.scss rename to assets/shop/account/index.scss diff --git a/src/Resources/dev/shop/oney_cart/index.js b/assets/shop/oney_cart/index.js similarity index 100% rename from src/Resources/dev/shop/oney_cart/index.js rename to assets/shop/oney_cart/index.js diff --git a/src/Resources/dev/shop/oney_common/index.js b/assets/shop/oney_common/index.js similarity index 100% rename from src/Resources/dev/shop/oney_common/index.js rename to assets/shop/oney_common/index.js diff --git a/src/Resources/dev/shop/oney_common/index.scss b/assets/shop/oney_common/index.scss similarity index 100% rename from src/Resources/dev/shop/oney_common/index.scss rename to assets/shop/oney_common/index.scss diff --git a/src/Resources/dev/shop/oney_popin/index.js b/assets/shop/oney_popin/index.js similarity index 100% rename from src/Resources/dev/shop/oney_popin/index.js rename to assets/shop/oney_popin/index.js diff --git a/src/Resources/dev/shop/oney_popin/index.scss b/assets/shop/oney_popin/index.scss similarity index 100% rename from src/Resources/dev/shop/oney_popin/index.scss rename to assets/shop/oney_popin/index.scss diff --git a/src/Resources/dev/shop/payment/index.js b/assets/shop/payment/index.js similarity index 100% rename from src/Resources/dev/shop/payment/index.js rename to assets/shop/payment/index.js diff --git a/src/Resources/dev/shop/payment/index.scss b/assets/shop/payment/index.scss similarity index 100% rename from src/Resources/dev/shop/payment/index.scss rename to assets/shop/payment/index.scss diff --git a/src/Resources/dev/shop/payment/integrated.js b/assets/shop/payment/integrated.js similarity index 100% rename from src/Resources/dev/shop/payment/integrated.js rename to assets/shop/payment/integrated.js diff --git a/src/Resources/dev/shop/payment/integrated.scss b/assets/shop/payment/integrated.scss similarity index 100% rename from src/Resources/dev/shop/payment/integrated.scss rename to assets/shop/payment/integrated.scss diff --git a/src/Resources/dev/yarn.lock b/assets/yarn.lock similarity index 100% rename from src/Resources/dev/yarn.lock rename to assets/yarn.lock diff --git a/src/Resources/config/config.yml b/config/config.yml similarity index 100% rename from src/Resources/config/config.yml rename to config/config.yml diff --git a/src/Resources/config/resources.yaml b/config/resources.yaml similarity index 100% rename from src/Resources/config/resources.yaml rename to config/resources.yaml diff --git a/src/Resources/config/routing.yaml b/config/routing.yaml similarity index 100% rename from src/Resources/config/routing.yaml rename to config/routing.yaml diff --git a/src/Resources/config/services.xml b/config/services.xml similarity index 99% rename from src/Resources/config/services.xml rename to config/services.xml index a4a41d4f..9d5873b7 100644 --- a/src/Resources/config/services.xml +++ b/config/services.xml @@ -16,9 +16,9 @@ + resource="../src/{Checker,EventSubscriber,Form,Twig,Validator,Provider/OneySimulation}/*" /> + resource="../src/Controller" > diff --git a/src/Resources/config/services/action.xml b/config/services/action.xml similarity index 100% rename from src/Resources/config/services/action.xml rename to config/services/action.xml diff --git a/src/Resources/config/services/client.xml b/config/services/client.xml similarity index 100% rename from src/Resources/config/services/client.xml rename to config/services/client.xml diff --git a/src/Resources/config/services/gateway.xml b/config/services/gateway.xml similarity index 100% rename from src/Resources/config/services/gateway.xml rename to config/services/gateway.xml diff --git a/src/Resources/config/services/no_defaults.xml b/config/services/no_defaults.xml similarity index 100% rename from src/Resources/config/services/no_defaults.xml rename to config/services/no_defaults.xml diff --git a/src/Resources/config/state_machine.yml b/config/state_machine.yml similarity index 100% rename from src/Resources/config/state_machine.yml rename to config/state_machine.yml diff --git a/src/Resources/config/state_machine/sylius_order_payment.yaml b/config/state_machine/sylius_order_payment.yaml similarity index 100% rename from src/Resources/config/state_machine/sylius_order_payment.yaml rename to config/state_machine/sylius_order_payment.yaml diff --git a/src/Resources/config/state_machine/sylius_payment.yml b/config/state_machine/sylius_payment.yml similarity index 100% rename from src/Resources/config/state_machine/sylius_payment.yml rename to config/state_machine/sylius_payment.yml diff --git a/src/Resources/config/ui.yaml b/config/ui.yaml similarity index 100% rename from src/Resources/config/ui.yaml rename to config/ui.yaml diff --git a/doc/development.md b/doc/development.md index 49ab58b7..ab362af8 100644 --- a/doc/development.md +++ b/doc/development.md @@ -3,13 +3,11 @@ ## Assets For the sake of quickness, the usage of a tool like [Parcel](https://github.com/parcel-bundler/parcel/tree/1.x) shows that its efficiency is indeed undeniable. - -So, if you want to edit assets (js, scss, ...) you'll likely go into `src/Resources/dev` and run `yarn install`. - +So, if you want to edit assets (js, scss, ...) you'll likely go into `assets` and run `yarn install`. Then, you'll find a list of commands inside `package.json` which are : ```bash -$ (cd src/Resources/dev && yarn build) +$ (cd assets && yarn build) ``` Or, if you prefer the dev mode; a `watch` command that compile in real time, then run: @@ -18,9 +16,10 @@ Or, if you prefer the dev mode; a `watch` command that compile in real time, the $ (cd src/Resources/dev && yarn dev) ``` -You can add any resources as far as Parcel can go, but those have to be located in `/pages` otherwize they won't be compiled. +You can add any resources as far as Parcel can go, +but those have to be located in `/pages` otherwise they won't be compiled. -Assets can be found in `src/Resources/public/assets/oney` so you'll have to install them in your application by running: +Assets can be found in `public/assets/oney` so you'll have to install them in your application by running: ```bash $ bin/console assets:install --symlink @@ -28,7 +27,8 @@ $ bin/console assets:install --symlink $ bin/console sylius:theme:assets:install --symlink # e.g if bootstrapTheme is enabled ``` -To make it fully compatible with [Sylius Bootstrap Theme](https://github.com/Sylius/BootstrapTheme), some lines have to be added to ̀the main entrypoint (such as `app.js`) of the theme: +To make it fully compatible with [Sylius Bootstrap Theme](https://github.com/Sylius/BootstrapTheme), +some lines have to be added to the main entrypoint (such as `app.js`) of the theme: ```js const $ = require('jquery'); diff --git a/install/Application/config/packages/sylius_payplug.yaml b/install/Application/config/packages/sylius_payplug.yaml index 82462ec0..348a3599 100644 --- a/install/Application/config/packages/sylius_payplug.yaml +++ b/install/Application/config/packages/sylius_payplug.yaml @@ -1,3 +1,3 @@ imports: - - { resource: "@PayPlugSyliusPayPlugPlugin/Resources/config/config.yml" } - - { resource: "@PayPlugSyliusPayPlugPlugin/Resources/config/services.xml" } + - { resource: "@PayPlugSyliusPayPlugPlugin/config/config.yml" } + - { resource: "@PayPlugSyliusPayPlugPlugin/config/services.xml" } diff --git a/install/Application/config/packages/sylius_refund.yaml b/install/Application/config/packages/sylius_refund.yaml index ce7ff8ae..5107d4fb 100644 --- a/install/Application/config/packages/sylius_refund.yaml +++ b/install/Application/config/packages/sylius_refund.yaml @@ -1,2 +1,2 @@ imports: - - { resource: "@SyliusRefundPlugin/Resources/config/app/config.yml" } + - { resource: "@SyliusRefundPlugin/config/config.yaml" } diff --git a/install/Application/config/routes/payplug.yaml b/install/Application/config/routes/payplug.yaml index 778bf549..d6812b69 100644 --- a/install/Application/config/routes/payplug.yaml +++ b/install/Application/config/routes/payplug.yaml @@ -1,2 +1,2 @@ sylius_payplug: - resource: "@PayPlugSyliusPayPlugPlugin/Resources/config/routing.yaml" + resource: "@PayPlugSyliusPayPlugPlugin/config/routing.yaml" diff --git a/install/Application/config/routes/sylius_refund.yaml b/install/Application/config/routes/sylius_refund.yaml index 46e99b16..9e2f267f 100755 --- a/install/Application/config/routes/sylius_refund.yaml +++ b/install/Application/config/routes/sylius_refund.yaml @@ -1,2 +1,2 @@ sylius_refund: - resource: "@SyliusRefundPlugin/Resources/config/routing.yml" + resource: "@SyliusRefundPlugin/config/routes/*.yaml" diff --git a/install/app-114/.gitignore b/install/app-114/.gitignore new file mode 100644 index 00000000..83c72082 --- /dev/null +++ b/install/app-114/.gitignore @@ -0,0 +1,3 @@ +.env.*.local +.env.local +.env.local.php diff --git a/install/app-114/config/packages/payplug.yaml b/install/app-114/config/packages/payplug.yaml new file mode 100644 index 00000000..1d41d8b4 --- /dev/null +++ b/install/app-114/config/packages/payplug.yaml @@ -0,0 +1,30 @@ +parameters: + sylius_refund.supported_gateways: + - payplug + - payplug_oney + - cash_on_delivery + +services: + payplug_sylius_payplug_plugin.api_client.payplug: + class: Tests\PayPlug\SyliusPayPlugPlugin\Behat\Mocker\PayPlugApiClient + public: true + arguments: + - "@service_container" + - 'payplug_sylius_payplug_plugin.api_client.payplug' + + payplug_sylius_payplug_plugin.api_client.oney: + class: Tests\PayPlug\SyliusPayPlugPlugin\Behat\Mocker\PayPlugApiClient + public: true + arguments: + - "@service_container" + - 'payplug_sylius_payplug_plugin.api_client.oney' + + Tests\Sylius\RefundPlugin\Behat\Services\Generator\FailedCreditMemoGenerator: + decorates: 'Sylius\RefundPlugin\Generator\CreditMemoGeneratorInterface' + arguments: + - '@Tests\Sylius\RefundPlugin\Behat\Services\Generator\FailedCreditMemoGenerator.inner' + + Tests\Sylius\RefundPlugin\Behat\Services\Factory\FailedRefundPaymentFactory: + decorates: 'sylius_refund.factory.refund_payment' + arguments: + - '@Tests\Sylius\RefundPlugin\Behat\Services\Factory\FailedRefundPaymentFactory.inner' diff --git a/install/app-114/config/packages/sylius_payplug.yaml b/install/app-114/config/packages/sylius_payplug.yaml new file mode 100644 index 00000000..348a3599 --- /dev/null +++ b/install/app-114/config/packages/sylius_payplug.yaml @@ -0,0 +1,3 @@ +imports: + - { resource: "@PayPlugSyliusPayPlugPlugin/config/config.yml" } + - { resource: "@PayPlugSyliusPayPlugPlugin/config/services.xml" } diff --git a/install/app-114/config/packages/sylius_refund.yaml b/install/app-114/config/packages/sylius_refund.yaml new file mode 100644 index 00000000..ce7ff8ae --- /dev/null +++ b/install/app-114/config/packages/sylius_refund.yaml @@ -0,0 +1,2 @@ +imports: + - { resource: "@SyliusRefundPlugin/Resources/config/app/config.yml" } diff --git a/install/app-114/config/routes/payplug.yaml b/install/app-114/config/routes/payplug.yaml new file mode 100644 index 00000000..d6812b69 --- /dev/null +++ b/install/app-114/config/routes/payplug.yaml @@ -0,0 +1,2 @@ +sylius_payplug: + resource: "@PayPlugSyliusPayPlugPlugin/config/routing.yaml" diff --git a/install/app-114/config/routes/sylius_refund.yaml b/install/app-114/config/routes/sylius_refund.yaml new file mode 100755 index 00000000..46e99b16 --- /dev/null +++ b/install/app-114/config/routes/sylius_refund.yaml @@ -0,0 +1,2 @@ +sylius_refund: + resource: "@SyliusRefundPlugin/Resources/config/routing.yml" diff --git a/install/app-114/config/services_payplug.yaml b/install/app-114/config/services_payplug.yaml new file mode 100644 index 00000000..e7c39ea2 --- /dev/null +++ b/install/app-114/config/services_payplug.yaml @@ -0,0 +1,37 @@ +parameters: + sylius_refund.supported_gateways: + - payplug + - payplug_oney + - cash_on_delivery + +services: + payplug_sylius_payplug_plugin.api_client.payplug: + class: Tests\PayPlug\SyliusPayPlugPlugin\Behat\Mocker\PayPlugApiClient + public: true + arguments: + - "@service_container" + - 'payplug_sylius_payplug_plugin.api_client.payplug' + + payplug_sylius_payplug_plugin.api_client.oney: + class: Tests\PayPlug\SyliusPayPlugPlugin\Behat\Mocker\PayPlugApiClient + public: true + arguments: + - "@service_container" + - 'payplug_sylius_payplug_plugin.api_client.oney' + + PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientFactoryInterface: + class: Tests\PayPlug\SyliusPayPlugPlugin\Behat\Mocker\PayPlugApiClientFactory + public: true + arguments: + - "@service_container" + - "payplug_sylius_payplug_plugin.api_client.payplug" + + Tests\Sylius\RefundPlugin\Behat\Services\Generator\FailedCreditMemoGenerator: + decorates: 'Sylius\RefundPlugin\Generator\CreditMemoGeneratorInterface' + arguments: + - '@Tests\Sylius\RefundPlugin\Behat\Services\Generator\FailedCreditMemoGenerator.inner' + + Tests\Sylius\RefundPlugin\Behat\Services\Factory\FailedRefundPaymentFactory: + decorates: 'sylius_refund.factory.refund_payment' + arguments: + - '@Tests\Sylius\RefundPlugin\Behat\Services\Factory\FailedRefundPaymentFactory.inner' diff --git a/install/app-114/src/Entity/Customer/Customer.php b/install/app-114/src/Entity/Customer/Customer.php new file mode 100644 index 00000000..6dfffb49 --- /dev/null +++ b/install/app-114/src/Entity/Customer/Customer.php @@ -0,0 +1,27 @@ +cards = new ArrayCollection(); + } +} diff --git a/install/app-114/src/Entity/Payment/Payment.php b/install/app-114/src/Entity/Payment/Payment.php new file mode 100644 index 00000000..7a13282a --- /dev/null +++ b/install/app-114/src/Entity/Payment/Payment.php @@ -0,0 +1,27 @@ +refundHistories = new ArrayCollection(); + } +} diff --git a/install/app-114/src/Entity/Payment/PaymentMethod.php b/install/app-114/src/Entity/Payment/PaymentMethod.php new file mode 100644 index 00000000..70cba7d2 --- /dev/null +++ b/install/app-114/src/Entity/Payment/PaymentMethod.php @@ -0,0 +1,33 @@ +cards = new ArrayCollection(); + } + + protected function createTranslation(): PaymentMethodTranslationInterface + { + return new PaymentMethodTranslation(); + } +} diff --git a/src/Migrations/Version20210410143918.php b/migrations/Version20210410143918.php similarity index 100% rename from src/Migrations/Version20210410143918.php rename to migrations/Version20210410143918.php diff --git a/src/Migrations/Version20210823123914.php b/migrations/Version20210823123914.php similarity index 100% rename from src/Migrations/Version20210823123914.php rename to migrations/Version20210823123914.php diff --git a/src/Resources/public/assets/admin/payment_method/index.css b/public/assets/admin/payment_method/index.css similarity index 100% rename from src/Resources/public/assets/admin/payment_method/index.css rename to public/assets/admin/payment_method/index.css diff --git a/src/Resources/public/assets/american-express/logo.svg b/public/assets/american-express/logo.svg similarity index 98% rename from src/Resources/public/assets/american-express/logo.svg rename to public/assets/american-express/logo.svg index 402f9f52..5a587766 100644 --- a/src/Resources/public/assets/american-express/logo.svg +++ b/public/assets/american-express/logo.svg @@ -1,25 +1,25 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/src/Resources/public/assets/apple-pay/logo.svg b/public/assets/apple-pay/logo.svg similarity index 100% rename from src/Resources/public/assets/apple-pay/logo.svg rename to public/assets/apple-pay/logo.svg diff --git a/src/Resources/public/assets/bancontact/logo.svg b/public/assets/bancontact/logo.svg similarity index 100% rename from src/Resources/public/assets/bancontact/logo.svg rename to public/assets/bancontact/logo.svg diff --git a/src/Resources/public/assets/oney/3x.svg b/public/assets/oney/3x.svg similarity index 100% rename from src/Resources/public/assets/oney/3x.svg rename to public/assets/oney/3x.svg diff --git a/src/Resources/public/assets/oney/3x4x-alt.svg b/public/assets/oney/3x4x-alt.svg similarity index 100% rename from src/Resources/public/assets/oney/3x4x-alt.svg rename to public/assets/oney/3x4x-alt.svg diff --git a/src/Resources/public/assets/oney/3x4x-without-fees-alt.svg b/public/assets/oney/3x4x-without-fees-alt.svg similarity index 100% rename from src/Resources/public/assets/oney/3x4x-without-fees-alt.svg rename to public/assets/oney/3x4x-without-fees-alt.svg diff --git a/src/Resources/public/assets/oney/3x4x-without-fees.svg b/public/assets/oney/3x4x-without-fees.svg similarity index 100% rename from src/Resources/public/assets/oney/3x4x-without-fees.svg rename to public/assets/oney/3x4x-without-fees.svg diff --git a/src/Resources/public/assets/oney/3x4x.svg b/public/assets/oney/3x4x.svg similarity index 100% rename from src/Resources/public/assets/oney/3x4x.svg rename to public/assets/oney/3x4x.svg diff --git a/src/Resources/public/assets/oney/4x.svg b/public/assets/oney/4x.svg similarity index 100% rename from src/Resources/public/assets/oney/4x.svg rename to public/assets/oney/4x.svg diff --git a/src/Resources/public/assets/oney/logo.svg b/public/assets/oney/logo.svg similarity index 100% rename from src/Resources/public/assets/oney/logo.svg rename to public/assets/oney/logo.svg diff --git a/src/Resources/public/assets/oney/oney_x3_with_fees.svg b/public/assets/oney/oney_x3_with_fees.svg similarity index 100% rename from src/Resources/public/assets/oney/oney_x3_with_fees.svg rename to public/assets/oney/oney_x3_with_fees.svg diff --git a/src/Resources/public/assets/oney/oney_x3_without_fees.svg b/public/assets/oney/oney_x3_without_fees.svg similarity index 100% rename from src/Resources/public/assets/oney/oney_x3_without_fees.svg rename to public/assets/oney/oney_x3_without_fees.svg diff --git a/src/Resources/public/assets/oney/oney_x4_with_fees.svg b/public/assets/oney/oney_x4_with_fees.svg similarity index 100% rename from src/Resources/public/assets/oney/oney_x4_with_fees.svg rename to public/assets/oney/oney_x4_with_fees.svg diff --git a/src/Resources/public/assets/oney/oney_x4_without_fees.svg b/public/assets/oney/oney_x4_without_fees.svg similarity index 100% rename from src/Resources/public/assets/oney/oney_x4_without_fees.svg rename to public/assets/oney/oney_x4_without_fees.svg diff --git a/src/Resources/public/assets/shop/account.039342ad.svg b/public/assets/shop/account.039342ad.svg similarity index 100% rename from src/Resources/public/assets/shop/account.039342ad.svg rename to public/assets/shop/account.039342ad.svg diff --git a/src/Resources/public/assets/shop/account/index.css b/public/assets/shop/account/index.css similarity index 100% rename from src/Resources/public/assets/shop/account/index.css rename to public/assets/shop/account/index.css diff --git a/src/Resources/public/assets/shop/calendar.3c23bb16.svg b/public/assets/shop/calendar.3c23bb16.svg similarity index 100% rename from src/Resources/public/assets/shop/calendar.3c23bb16.svg rename to public/assets/shop/calendar.3c23bb16.svg diff --git a/src/Resources/public/assets/shop/card.0d2bd9bc.svg b/public/assets/shop/card.0d2bd9bc.svg similarity index 100% rename from src/Resources/public/assets/shop/card.0d2bd9bc.svg rename to public/assets/shop/card.0d2bd9bc.svg diff --git a/src/Resources/public/assets/shop/cb-dark.888aec45.svg b/public/assets/shop/cb-dark.888aec45.svg similarity index 100% rename from src/Resources/public/assets/shop/cb-dark.888aec45.svg rename to public/assets/shop/cb-dark.888aec45.svg diff --git a/src/Resources/public/assets/shop/cb.ccd964e9.svg b/public/assets/shop/cb.ccd964e9.svg similarity index 100% rename from src/Resources/public/assets/shop/cb.ccd964e9.svg rename to public/assets/shop/cb.ccd964e9.svg diff --git a/src/Resources/public/assets/shop/images/integrated/lock.svg b/public/assets/shop/images/integrated/lock.svg similarity index 100% rename from src/Resources/public/assets/shop/images/integrated/lock.svg rename to public/assets/shop/images/integrated/lock.svg diff --git a/src/Resources/public/assets/shop/images/integrated/logo-payplug.png b/public/assets/shop/images/integrated/logo-payplug.png similarity index 100% rename from src/Resources/public/assets/shop/images/integrated/logo-payplug.png rename to public/assets/shop/images/integrated/logo-payplug.png diff --git a/src/Resources/public/assets/shop/lock.fe8a73cd.svg b/public/assets/shop/lock.fe8a73cd.svg similarity index 100% rename from src/Resources/public/assets/shop/lock.fe8a73cd.svg rename to public/assets/shop/lock.fe8a73cd.svg diff --git a/src/Resources/public/assets/shop/mastercard-dark.8977e440.svg b/public/assets/shop/mastercard-dark.8977e440.svg similarity index 100% rename from src/Resources/public/assets/shop/mastercard-dark.8977e440.svg rename to public/assets/shop/mastercard-dark.8977e440.svg diff --git a/src/Resources/public/assets/shop/mastercard.7dd4ce0b.svg b/public/assets/shop/mastercard.7dd4ce0b.svg similarity index 100% rename from src/Resources/public/assets/shop/mastercard.7dd4ce0b.svg rename to public/assets/shop/mastercard.7dd4ce0b.svg diff --git a/src/Resources/public/assets/shop/oney_cart/index.js b/public/assets/shop/oney_cart/index.js similarity index 100% rename from src/Resources/public/assets/shop/oney_cart/index.js rename to public/assets/shop/oney_cart/index.js diff --git a/src/Resources/public/assets/shop/oney_common/index.css b/public/assets/shop/oney_common/index.css similarity index 100% rename from src/Resources/public/assets/shop/oney_common/index.css rename to public/assets/shop/oney_common/index.css diff --git a/src/Resources/public/assets/shop/oney_common/index.js b/public/assets/shop/oney_common/index.js similarity index 100% rename from src/Resources/public/assets/shop/oney_common/index.js rename to public/assets/shop/oney_common/index.js diff --git a/src/Resources/public/assets/shop/oney_popin/index.css b/public/assets/shop/oney_popin/index.css similarity index 100% rename from src/Resources/public/assets/shop/oney_popin/index.css rename to public/assets/shop/oney_popin/index.css diff --git a/src/Resources/public/assets/shop/oney_popin/index.js b/public/assets/shop/oney_popin/index.js similarity index 100% rename from src/Resources/public/assets/shop/oney_popin/index.js rename to public/assets/shop/oney_popin/index.js diff --git a/src/Resources/public/assets/shop/payment/index.css b/public/assets/shop/payment/index.css similarity index 100% rename from src/Resources/public/assets/shop/payment/index.css rename to public/assets/shop/payment/index.css diff --git a/src/Resources/public/assets/shop/payment/index.js b/public/assets/shop/payment/index.js similarity index 100% rename from src/Resources/public/assets/shop/payment/index.js rename to public/assets/shop/payment/index.js diff --git a/src/Resources/public/assets/shop/payment/integrated.css b/public/assets/shop/payment/integrated.css similarity index 100% rename from src/Resources/public/assets/shop/payment/integrated.css rename to public/assets/shop/payment/integrated.css diff --git a/src/Resources/public/assets/shop/payment/integrated.js b/public/assets/shop/payment/integrated.js similarity index 100% rename from src/Resources/public/assets/shop/payment/integrated.js rename to public/assets/shop/payment/integrated.js diff --git a/src/Resources/public/assets/shop/visa-dark.87c34e0f.svg b/public/assets/shop/visa-dark.87c34e0f.svg similarity index 100% rename from src/Resources/public/assets/shop/visa-dark.87c34e0f.svg rename to public/assets/shop/visa-dark.87c34e0f.svg diff --git a/src/Resources/public/assets/shop/visa.d11a46f6.svg b/public/assets/shop/visa.d11a46f6.svg similarity index 100% rename from src/Resources/public/assets/shop/visa.d11a46f6.svg rename to public/assets/shop/visa.d11a46f6.svg diff --git a/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php b/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php index 66375d89..88e6f156 100644 --- a/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php +++ b/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php @@ -18,9 +18,9 @@ final class PayPlugSyliusPayPlugExtension extends Extension implements PrependEx /** * @inheritdoc */ - public function load(array $config, ContainerBuilder $container): void + public function load(array $configs, ContainerBuilder $container): void { - $loader = new XmlFileLoader($container, new FileLocator(dirname(__DIR__).'/Resources/config')); + $loader = new XmlFileLoader($container, new FileLocator(dirname(__DIR__, 2) . '/config')); $loader->load('services.xml'); } @@ -31,12 +31,13 @@ public function prepend(ContainerBuilder $container): void return; } - $viewsPath = dirname(__DIR__).'/Resources/views/'; - // This add our override in twig paths with correct namespace if there are not already overridden. No need for final user to copy it + $viewsPath = dirname(__DIR__, 2) . '/templates/'; + // This adds our override in twig paths with correct namespace if there are not already overridden + // No need for the final user to copy it $paths = [ - $viewsPath.'SyliusShopBundle' => 'SyliusShop', - $viewsPath.'SyliusAdminBundle' => 'SyliusAdmin', - $viewsPath.'SyliusUiBundle' => 'SyliusUi', + $viewsPath . 'SyliusShopBundle' => 'SyliusShop', + $viewsPath . 'SyliusAdminBundle' => 'SyliusAdmin', + $viewsPath . 'SyliusUiBundle' => 'SyliusUi', ]; $twigConfig = $container->getExtensionConfig('twig'); @@ -59,10 +60,10 @@ public function prepend(ContainerBuilder $container): void } /** - * Verify if a given namespace is alreay extented. + * Verify if a given namespace is already extended * - * @param string $namespace The namespace to verify - * @param array $configurations The given configurations + * @param string $namespace The namespace to verify + * @param array $configurations The given configurations */ protected function isPathAlreadyInConfiguration(string $namespace, array $configurations): bool { @@ -84,7 +85,7 @@ protected function getMigrationsNamespace(): string protected function getMigrationsDirectory(): string { - return '@PayPlugSyliusPayPlugPlugin/Migrations'; + return '@PayPlugSyliusPayPlugPlugin/migrations'; } protected function getNamespacesOfMigrationsExecutedBefore(): array diff --git a/src/PayPlugSyliusPayPlugPlugin.php b/src/PayPlugSyliusPayPlugPlugin.php index b8c40d96..e7dcbfa9 100644 --- a/src/PayPlugSyliusPayPlugPlugin.php +++ b/src/PayPlugSyliusPayPlugPlugin.php @@ -12,4 +12,9 @@ final class PayPlugSyliusPayPlugPlugin extends Bundle public const VERSION = '1.11.0'; use SyliusPluginTrait; + + public function getPath(): string + { + return \dirname(__DIR__); + } } diff --git a/src/Resources/views/SyliusAdminBundle/Order/Show/_payment.html.twig b/templates/SyliusAdminBundle/Order/Show/_payment.html.twig similarity index 100% rename from src/Resources/views/SyliusAdminBundle/Order/Show/_payment.html.twig rename to templates/SyliusAdminBundle/Order/Show/_payment.html.twig diff --git a/src/Resources/views/SyliusShopBundle/Account/SavedCards/Index/_header.html.twig b/templates/SyliusShopBundle/Account/SavedCards/Index/_header.html.twig similarity index 100% rename from src/Resources/views/SyliusShopBundle/Account/SavedCards/Index/_header.html.twig rename to templates/SyliusShopBundle/Account/SavedCards/Index/_header.html.twig diff --git a/src/Resources/views/SyliusShopBundle/Account/SavedCards/Index/_subcontent.html.twig b/templates/SyliusShopBundle/Account/SavedCards/Index/_subcontent.html.twig similarity index 100% rename from src/Resources/views/SyliusShopBundle/Account/SavedCards/Index/_subcontent.html.twig rename to templates/SyliusShopBundle/Account/SavedCards/Index/_subcontent.html.twig diff --git a/src/Resources/views/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig b/templates/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig similarity index 100% rename from src/Resources/views/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig rename to templates/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig diff --git a/src/Resources/views/SyliusShopBundle/Checkout/SelectPayment/_navigation.html.twig b/templates/SyliusShopBundle/Checkout/SelectPayment/_navigation.html.twig similarity index 100% rename from src/Resources/views/SyliusShopBundle/Checkout/SelectPayment/_navigation.html.twig rename to templates/SyliusShopBundle/Checkout/SelectPayment/_navigation.html.twig diff --git a/src/Resources/views/SyliusShopBundle/Order/show.html.twig b/templates/SyliusShopBundle/Order/show.html.twig similarity index 100% rename from src/Resources/views/SyliusShopBundle/Order/show.html.twig rename to templates/SyliusShopBundle/Order/show.html.twig diff --git a/src/Resources/views/SyliusUiBundle/Modal/_confirmation.html.twig b/templates/SyliusUiBundle/Modal/_confirmation.html.twig similarity index 100% rename from src/Resources/views/SyliusUiBundle/Modal/_confirmation.html.twig rename to templates/SyliusUiBundle/Modal/_confirmation.html.twig diff --git a/src/Resources/views/card/index.html.twig b/templates/card/index.html.twig similarity index 100% rename from src/Resources/views/card/index.html.twig rename to templates/card/index.html.twig diff --git a/src/Resources/views/card/layout.html.twig b/templates/card/layout.html.twig similarity index 100% rename from src/Resources/views/card/layout.html.twig rename to templates/card/layout.html.twig diff --git a/src/Resources/views/form/complete_info_popin.html.twig b/templates/form/complete_info_popin.html.twig similarity index 100% rename from src/Resources/views/form/complete_info_popin.html.twig rename to templates/form/complete_info_popin.html.twig diff --git a/src/Resources/views/form/form_gateway_config_row.html.twig b/templates/form/form_gateway_config_row.html.twig similarity index 100% rename from src/Resources/views/form/form_gateway_config_row.html.twig rename to templates/form/form_gateway_config_row.html.twig diff --git a/src/Resources/views/form/integrated.html.twig b/templates/form/integrated.html.twig similarity index 100% rename from src/Resources/views/form/integrated.html.twig rename to templates/form/integrated.html.twig diff --git a/src/Resources/views/javascripts/oney_common.html.twig b/templates/javascripts/oney_common.html.twig similarity index 100% rename from src/Resources/views/javascripts/oney_common.html.twig rename to templates/javascripts/oney_common.html.twig diff --git a/src/Resources/views/javascripts/select_payment_js.html.twig b/templates/javascripts/select_payment_js.html.twig similarity index 100% rename from src/Resources/views/javascripts/select_payment_js.html.twig rename to templates/javascripts/select_payment_js.html.twig diff --git a/src/Resources/views/javascripts/webfont_loader.html.twig b/templates/javascripts/webfont_loader.html.twig similarity index 100% rename from src/Resources/views/javascripts/webfont_loader.html.twig rename to templates/javascripts/webfont_loader.html.twig diff --git a/src/Resources/views/oney/cart/pay_with_oney.html.twig b/templates/oney/cart/pay_with_oney.html.twig similarity index 100% rename from src/Resources/views/oney/cart/pay_with_oney.html.twig rename to templates/oney/cart/pay_with_oney.html.twig diff --git a/src/Resources/views/oney/popin.html.twig b/templates/oney/popin.html.twig similarity index 100% rename from src/Resources/views/oney/popin.html.twig rename to templates/oney/popin.html.twig diff --git a/src/Resources/views/oney/product/pay_with_oney.html.twig b/templates/oney/product/pay_with_oney.html.twig similarity index 100% rename from src/Resources/views/oney/product/pay_with_oney.html.twig rename to templates/oney/product/pay_with_oney.html.twig diff --git a/src/Resources/views/shop/1click.html.twig b/templates/shop/1click.html.twig similarity index 100% rename from src/Resources/views/shop/1click.html.twig rename to templates/shop/1click.html.twig diff --git a/src/Resources/views/stylesheets/oney_common.html.twig b/templates/stylesheets/oney_common.html.twig similarity index 100% rename from src/Resources/views/stylesheets/oney_common.html.twig rename to templates/stylesheets/oney_common.html.twig diff --git a/src/Resources/views/stylesheets/payment_method_css.html.twig b/templates/stylesheets/payment_method_css.html.twig similarity index 100% rename from src/Resources/views/stylesheets/payment_method_css.html.twig rename to templates/stylesheets/payment_method_css.html.twig diff --git a/src/Resources/views/stylesheets/saved_cards.html.twig b/templates/stylesheets/saved_cards.html.twig similarity index 100% rename from src/Resources/views/stylesheets/saved_cards.html.twig rename to templates/stylesheets/saved_cards.html.twig diff --git a/src/Resources/views/stylesheets/select_payment_css.html.twig b/templates/stylesheets/select_payment_css.html.twig similarity index 100% rename from src/Resources/views/stylesheets/select_payment_css.html.twig rename to templates/stylesheets/select_payment_css.html.twig diff --git a/src/Resources/translations/flashes.en.yml b/translations/flashes.en.yml similarity index 100% rename from src/Resources/translations/flashes.en.yml rename to translations/flashes.en.yml diff --git a/src/Resources/translations/flashes.fr.yml b/translations/flashes.fr.yml similarity index 100% rename from src/Resources/translations/flashes.fr.yml rename to translations/flashes.fr.yml diff --git a/src/Resources/translations/flashes.it.yml b/translations/flashes.it.yml similarity index 100% rename from src/Resources/translations/flashes.it.yml rename to translations/flashes.it.yml diff --git a/src/Resources/translations/messages.en.yml b/translations/messages.en.yml similarity index 100% rename from src/Resources/translations/messages.en.yml rename to translations/messages.en.yml diff --git a/src/Resources/translations/messages.fr.yml b/translations/messages.fr.yml similarity index 100% rename from src/Resources/translations/messages.fr.yml rename to translations/messages.fr.yml diff --git a/src/Resources/translations/messages.it.yml b/translations/messages.it.yml similarity index 100% rename from src/Resources/translations/messages.it.yml rename to translations/messages.it.yml diff --git a/src/Resources/translations/validators.en.yml b/translations/validators.en.yml similarity index 100% rename from src/Resources/translations/validators.en.yml rename to translations/validators.en.yml diff --git a/src/Resources/translations/validators.fr.yml b/translations/validators.fr.yml similarity index 100% rename from src/Resources/translations/validators.fr.yml rename to translations/validators.fr.yml diff --git a/src/Resources/translations/validators.it.yml b/translations/validators.it.yml similarity index 100% rename from src/Resources/translations/validators.it.yml rename to translations/validators.it.yml From 774e0cb1b8a8bb3f7a7366ad47beaafc323da045 Mon Sep 17 00:00:00 2001 From: maxperei Date: Thu, 17 Apr 2025 16:49:37 +0200 Subject: [PATCH 002/112] feat(templating): [admin] use twig hooks for payment gateway config --- config/config.yml | 2 +- config/twig_hooks/admin.yaml | 26 +++ .../PayPlugSyliusPayPlugExtension.php | 1 + .../form/deferred_capture.html.twig | 5 + .../payment_method/form/fees_for.html.twig | 5 + .../form/integrated_payment.html.twig | 5 + .../payment_method/form/one_click.html.twig | 5 + .../payment_method/form/secret_key.html.twig | 5 + .../form/form_gateway_config_row.html.twig | 204 ++---------------- ...lius_checkout_select_payment_row.html.twig | 111 ++++++++++ 10 files changed, 183 insertions(+), 186 deletions(-) create mode 100644 config/twig_hooks/admin.yaml create mode 100644 templates/admin/payment_method/form/deferred_capture.html.twig create mode 100644 templates/admin/payment_method/form/fees_for.html.twig create mode 100644 templates/admin/payment_method/form/integrated_payment.html.twig create mode 100644 templates/admin/payment_method/form/one_click.html.twig create mode 100644 templates/admin/payment_method/form/secret_key.html.twig create mode 100644 templates/form/sylius_checkout_select_payment_row.html.twig diff --git a/config/config.yml b/config/config.yml index c476d4c2..fb713c19 100644 --- a/config/config.yml +++ b/config/config.yml @@ -1,4 +1,4 @@ imports: - { resource: "state_machine.yml" } - { resource: "resources.yaml" } - - { resource: "ui.yaml" } + - { resource: "twig_hooks/*.yaml" } diff --git a/config/twig_hooks/admin.yaml b/config/twig_hooks/admin.yaml new file mode 100644 index 00000000..25e2e30e --- /dev/null +++ b/config/twig_hooks/admin.yaml @@ -0,0 +1,26 @@ +sylius_twig_hooks: + hooks: + 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.payplug': + secret_key: &secretKey + template: '@PayPlugSyliusPayPlugPlugin/admin/payment_method/form/secret_key.html.twig' + priority: 0 + one_click: + template: '@PayPlugSyliusPayPlugPlugin/admin/payment_method/form/one_click.html.twig' + priority: 0 + integrated_payment: + template: '@PayPlugSyliusPayPlugPlugin/admin/payment_method/form/integrated_payment.html.twig' + priority: 0 + deferred_capture: + template: '@PayPlugSyliusPayPlugPlugin/admin/payment_method/form/deferred_capture.html.twig' + priority: 0 + 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.payplug_oney': + secret_key: *secretKey + fees_for: + template: '@PayPlugSyliusPayPlugPlugin/admin/payment_method/form/fees_for.html.twig' + priority: 0 + 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.payplug_bancontact': + secret_key: *secretKey + 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.payplug_apple_pay': + secret_key: *secretKey + 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.payplug_american_express': + secret_key: *secretKey diff --git a/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php b/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php index 88e6f156..4277ab5e 100644 --- a/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php +++ b/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php @@ -52,6 +52,7 @@ public function prepend(ContainerBuilder $container): void 'paths' => $paths, 'form_themes' => [ '@PayPlugSyliusPayPlugPlugin/form/form_gateway_config_row.html.twig', + '@PayPlugSyliusPayPlugPlugin/form/sylius_checkout_select_payment_row.html.twig', '@PayPlugSyliusPayPlugPlugin/form/complete_info_popin.html.twig', ], ]); diff --git a/templates/admin/payment_method/form/deferred_capture.html.twig b/templates/admin/payment_method/form/deferred_capture.html.twig new file mode 100644 index 00000000..be0c32d2 --- /dev/null +++ b/templates/admin/payment_method/form/deferred_capture.html.twig @@ -0,0 +1,5 @@ +{% set form = hookable_metadata.context.form.gatewayConfig.config.deferredCapture %} + +
+ {{ form_row(form) }} +
\ No newline at end of file diff --git a/templates/admin/payment_method/form/fees_for.html.twig b/templates/admin/payment_method/form/fees_for.html.twig new file mode 100644 index 00000000..5d1be6ac --- /dev/null +++ b/templates/admin/payment_method/form/fees_for.html.twig @@ -0,0 +1,5 @@ +{% set form = hookable_metadata.context.form.gatewayConfig.config.fees_for %} + +
+ {{ form_row(form) }} +
\ No newline at end of file diff --git a/templates/admin/payment_method/form/integrated_payment.html.twig b/templates/admin/payment_method/form/integrated_payment.html.twig new file mode 100644 index 00000000..26c8c373 --- /dev/null +++ b/templates/admin/payment_method/form/integrated_payment.html.twig @@ -0,0 +1,5 @@ +{% set form = hookable_metadata.context.form.gatewayConfig.config.integratedPayment %} + +
+ {{ form_row(form) }} +
\ No newline at end of file diff --git a/templates/admin/payment_method/form/one_click.html.twig b/templates/admin/payment_method/form/one_click.html.twig new file mode 100644 index 00000000..9b8ca882 --- /dev/null +++ b/templates/admin/payment_method/form/one_click.html.twig @@ -0,0 +1,5 @@ +{% set form = hookable_metadata.context.form.gatewayConfig.config.oneClick %} + +
+ {{ form_row(form) }} +
\ No newline at end of file diff --git a/templates/admin/payment_method/form/secret_key.html.twig b/templates/admin/payment_method/form/secret_key.html.twig new file mode 100644 index 00000000..2bf05d7d --- /dev/null +++ b/templates/admin/payment_method/form/secret_key.html.twig @@ -0,0 +1,5 @@ +{% set form = hookable_metadata.context.form.gatewayConfig.config.secretKey %} + +
+ {{ form_row(form) }} +
\ No newline at end of file diff --git a/templates/form/form_gateway_config_row.html.twig b/templates/form/form_gateway_config_row.html.twig index d4d52219..e4737b58 100644 --- a/templates/form/form_gateway_config_row.html.twig +++ b/templates/form/form_gateway_config_row.html.twig @@ -1,199 +1,33 @@ -{% block _sylius_payment_method_gatewayConfig_factoryName_row %} - {% set isOney = constant('\\PayPlug\\SyliusPayPlugPlugin\\Gateway\\OneyGatewayFactory::FACTORY_NAME') in form.vars.value %} - {% if isOney %} -
-
-
-
{{ ('payplug_sylius_payplug_plugin.ui.oney_gateway_config.info')|trans({'%link%': 'https://support.payplug.com/hc/fr/articles/360015899980-Le-paiement-fractionn%C3%A9-garanti-avec-Oney-sur-Sylius'})|raw }}
-
+{% block _sylius_admin_payment_method_gatewayConfig_factoryName_help %} +
+ {% set isOney = constant('\\PayPlug\\SyliusPayPlugPlugin\\Gateway\\OneyGatewayFactory::FACTORY_NAME') in form.vars.value %} + {% if isOney %} + -
- {% endif %} -
- {{- form_row(form, not isOney ? {'attr': {'style': 'margin: 0 0 1rem;'}} : {}) -}} + {% endif %}
{% endblock %} -{% block _sylius_payment_method_gatewayConfig_config_secretKey_row %} - {% set hasFeesFor = constant('PayPlug\\SyliusPayPlugPlugin\\Gateway\\OneyGatewayFactory::FEES_FOR') in form.parent.children|keys %} - {% if hasFeesFor %} -
{# close previous to avoid 2 columns #} - {% endif %} -
- {{- form_label(form) -}} +{% block _sylius_admin_payment_method_gatewayConfig_config_payplug_checkbox_widget %} +
{{- form_widget(form) -}} - - {{- form_help(form) -}} - - {% for error in errors %} -
- {{ error.message|raw }} -
- {% endfor %}
- {% if hasFeesFor %} -
- {% endif %} {% endblock %} -{% block _sylius_payment_method_gatewayConfig_config_fees_for_row %} +{% block _sylius_admin_payment_method_gatewayConfig_config_fees_for_row %}
-
-
- {{ form_label(form) }} + {{ form_label(form) }} + {%- for child in form %} +
+ {{- form_widget(child, {'attr': 'client' in child.vars.value ? {'checked': 'checked'} : {}}, sylius_test_form_attribute('option')) -}} + {{- form_label(child, null, {translation_domain: choice_translation_domain}) -}}
- {%- for child in form %} -
-
- {{- form_label(child, null, {translation_domain: choice_translation_domain}) -}} - {{- form_widget(child, {'attr': 'client' in child.vars.value ? {'checked': 'checked'} : {}}, sylius_test_form_attribute('option')) -}} -
-
- {% endfor -%} -
- {{- form_errors(form) -}} + {% endfor -%}
- + {{- form_errors(form) -}} {% endblock %} -{% block _sylius_payment_method_gatewayConfig_config_payplug_checkbox_row %} -
-
- {{- form_label(form) -}} - {{- form_widget(form) -}} -
- - - {{- form_help(form) -}} - - {% for error in errors %} -
- {{ error.message|raw }} -
- {% endfor %} -
-{% endblock %} - -{% block _sylius_payment_method_enabled_errors %} - {% for error in errors %} -
- {{ error.message|raw }} -
- {% endfor %} -{% endblock %} - -{% block _sylius_checkout_select_payment_payments_entry_oney_payment_choice_row %} - {% set data = oney_simulation_data() %} - {% import "@SyliusShop/Common/Macro/money.html.twig" as money %} -
- - {% for keyChoice, choice in form.vars.choices %} - {% if data is not empty %} - {% set nx_with_fees = (choice.value|split('_', 2))[1] %} - {% set grand_total = data[nx_with_fees]['down_payment_amount'] %} - {% endif %} -
- - -
- {% endfor %} -
-{% endblock %} - -{% block _sylius_checkout_select_payment_payments_entry_payplug_card_choice_row %} -
- {% for card in sylius.customer.cards %} - {% set cardExpirationDate = ("%04d"|format(card.expirationYear) ~ '-' ~ "%02d"|format(card.expirationMonth))|date("Y-m") %} - {% if cardExpirationDate >= "now"|date("Y-m") %} -
- - -
- {% endif %} - {% endfor %} -
- - -
-
+{% block _sylius_admin_payment_method_gatewayConfig_config_fees_for_label %} + {{ label|trans }} {% endblock %} diff --git a/templates/form/sylius_checkout_select_payment_row.html.twig b/templates/form/sylius_checkout_select_payment_row.html.twig new file mode 100644 index 00000000..9fa276a6 --- /dev/null +++ b/templates/form/sylius_checkout_select_payment_row.html.twig @@ -0,0 +1,111 @@ +{% block _sylius_checkout_select_payment_payments_entry_oney_payment_choice_row %} + {% set data = oney_simulation_data() %} + {% import "@SyliusShop/Common/Macro/money.html.twig" as money %} +
+ + {% for keyChoice, choice in form.vars.choices %} + {% if data is not empty %} + {% set nx_with_fees = (choice.value|split('_', 2))[1] %} + {% set grand_total = data[nx_with_fees]['down_payment_amount'] %} + {% endif %} +
+ + +
+ {% endfor %} +
+{% endblock %} + +{% block _sylius_checkout_select_payment_payments_entry_payplug_card_choice_row %} +
+ {% for card in sylius.customer.cards %} + {% set cardExpirationDate = ("%04d"|format(card.expirationYear) ~ '-' ~ "%02d"|format(card.expirationMonth))|date("Y-m") %} + {% if cardExpirationDate >= "now"|date("Y-m") %} +
+ + +
+ {% endif %} + {% endfor %} +
+ + +
+
+{% endblock %} From b3b55180555d12bc7a46cf10e89e9320668f6acd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jib=C3=A9=20Barth?= Date: Fri, 18 Apr 2025 16:26:06 +0200 Subject: [PATCH 003/112] WIP: Allow to install on v2 BUT: not working for the moment as multiple service has been commented --- composer.json | 10 ++--- config/config.yml | 3 +- config/services.xml | 39 +++++++++---------- config/services/action.xml | 1 - src/Action/StatusAction.php | 5 --- .../CaptureAuthorizedPaymentCommand.php | 4 +- src/Controller/OrderController.php | 2 - .../PostPaymentSelectEventSubscriber.php | 2 +- .../RefundPaymentGeneratedHandler.php | 4 +- src/Processor/OrderPaymentProcessor.php | 3 -- .../Payment/ApplePayPaymentProvider.php | 4 +- src/Resolver/PaymentStateResolver.php | 2 - 12 files changed, 32 insertions(+), 47 deletions(-) diff --git a/composer.json b/composer.json index e7e66358..db07a143 100644 --- a/composer.json +++ b/composer.json @@ -14,11 +14,11 @@ "giggsey/libphonenumber-for-php": "^8.12", "payplug/payplug-php": "^3.1", "php-http/message-factory": "^1.1", - "sylius/refund-plugin": "^1.4", - "sylius/sylius": "^1.11.0", - "symfony/asset": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/validator": "^4.4|^5.0|^6.0" + "sylius/refund-plugin": "^2.0", + "sylius/sylius": "^2.0", + "symfony/asset": "^6.0|^7.0", + "symfony/lock": "^6.0|^7.0", + "symfony/validator": "^6.0|^7.0" }, "require-dev": { "behat/behat": "^3.7", diff --git a/config/config.yml b/config/config.yml index fb713c19..fa2e0683 100644 --- a/config/config.yml +++ b/config/config.yml @@ -1,4 +1,5 @@ imports: - - { resource: "state_machine.yml" } +# - { resource: "state_machine.yml" } - { resource: "resources.yaml" } +# - { resource: "ui.yaml" } - { resource: "twig_hooks/*.yaml" } diff --git a/config/services.xml b/config/services.xml index 9d5873b7..a5612f53 100644 --- a/config/services.xml +++ b/config/services.xml @@ -28,7 +28,6 @@ parent="sylius.controller.order" > - @@ -42,11 +41,9 @@ decorates="sylius.order_processing.order_payment_processor.checkout" > - - @@ -65,10 +62,10 @@ - - + + - + @@ -98,7 +95,7 @@ @@ -106,7 +103,7 @@ @@ -115,7 +112,7 @@ @@ -124,7 +121,7 @@ @@ -133,7 +130,7 @@ @@ -153,7 +150,7 @@ - + @@ -164,11 +161,11 @@ - + %sylius_refund.supported_gateways% @@ -222,7 +219,7 @@ - + @@ -235,7 +232,7 @@ - + @@ -249,12 +246,12 @@ - - + + - diff --git a/src/Action/StatusAction.php b/src/Action/StatusAction.php index ccc5ba2f..e6ceec94 100644 --- a/src/Action/StatusAction.php +++ b/src/Action/StatusAction.php @@ -27,9 +27,6 @@ final class StatusAction implements ActionInterface, GatewayAwareInterface, ApiA use GatewayAwareTrait; use ApiAwareTrait; - /** @var FactoryInterface */ - private $stateMachineFactory; - /** @var RefundPaymentHandlerInterface */ private $refundPaymentHandler; @@ -38,12 +35,10 @@ final class StatusAction implements ActionInterface, GatewayAwareInterface, ApiA private RequestStack $requestStack; public function __construct( - FactoryInterface $stateMachineFactory, RefundPaymentHandlerInterface $refundPaymentHandler, PaymentNotificationHandler $paymentNotificationHandler, RequestStack $requestStack ) { - $this->stateMachineFactory = $stateMachineFactory; $this->refundPaymentHandler = $refundPaymentHandler; $this->paymentNotificationHandler = $paymentNotificationHandler; $this->requestStack = $requestStack; diff --git a/src/Command/CaptureAuthorizedPaymentCommand.php b/src/Command/CaptureAuthorizedPaymentCommand.php index 5fa70d58..fd420b94 100644 --- a/src/Command/CaptureAuthorizedPaymentCommand.php +++ b/src/Command/CaptureAuthorizedPaymentCommand.php @@ -22,12 +22,12 @@ class CaptureAuthorizedPaymentCommand extends Command private LoggerInterface $logger; public function __construct( - Factory $stateMachineFactory, + // Factory $stateMachineFactory, PaymentRepositoryInterface $paymentRepository, EntityManagerInterface $entityManager, LoggerInterface $logger, ) { - $this->stateMachineFactory = $stateMachineFactory; + // $this->stateMachineFactory = $stateMachineFactory; $this->paymentRepository = $paymentRepository; $this->entityManager = $entityManager; $this->logger = $logger; diff --git a/src/Controller/OrderController.php b/src/Controller/OrderController.php index 51a1adff..076807ae 100644 --- a/src/Controller/OrderController.php +++ b/src/Controller/OrderController.php @@ -70,7 +70,6 @@ public function __construct( ResourceUpdateHandlerInterface $resourceUpdateHandler, ResourceDeleteHandlerInterface $resourceDeleteHandler, ApplePayPaymentProvider $applePayPaymentProvider, - \SM\Factory\FactoryInterface $stateMachineFactory, LockFactory $lockFactory, LoggerInterface $logger ) { @@ -95,7 +94,6 @@ public function __construct( ); $this->applePayPaymentProvider = $applePayPaymentProvider; - $this->stateMachineFactory = $stateMachineFactory; $this->lockFactory = $lockFactory; $this->logger = $logger; } diff --git a/src/EventSubscriber/PostPaymentSelectEventSubscriber.php b/src/EventSubscriber/PostPaymentSelectEventSubscriber.php index a4dcb5aa..c33946b4 100644 --- a/src/EventSubscriber/PostPaymentSelectEventSubscriber.php +++ b/src/EventSubscriber/PostPaymentSelectEventSubscriber.php @@ -28,7 +28,7 @@ final class PostPaymentSelectEventSubscriber implements EventSubscriberInterface public function __construct( private RequestStack $requestStack, private EntityManagerInterface $entityManager, - private FactoryInterface $stateMachineFactory, + // private FactoryInterface $stateMachineFactory, ) { } diff --git a/src/MessageHandler/RefundPaymentGeneratedHandler.php b/src/MessageHandler/RefundPaymentGeneratedHandler.php index 627cadd5..b8de2427 100644 --- a/src/MessageHandler/RefundPaymentGeneratedHandler.php +++ b/src/MessageHandler/RefundPaymentGeneratedHandler.php @@ -69,7 +69,7 @@ public function __construct( PaymentRepositoryInterface $paymentRepository, RepositoryInterface $refundPaymentRepository, RefundHistoryRepositoryInterface $payplugRefundHistoryRepository, - FactoryInterface $stateMachineFactory, + // FactoryInterface $stateMachineFactory, RefundPaymentProcessor $refundPaymentProcessor, LoggerInterface $logger, RequestStack $requestStack, @@ -80,7 +80,7 @@ public function __construct( $this->paymentRepository = $paymentRepository; $this->refundPaymentRepository = $refundPaymentRepository; $this->payplugRefundHistoryRepository = $payplugRefundHistoryRepository; - $this->stateMachineFactory = $stateMachineFactory; + // $this->stateMachineFactory = $stateMachineFactory; $this->refundPaymentProcessor = $refundPaymentProcessor; $this->logger = $logger; $this->requestStack = $requestStack; diff --git a/src/Processor/OrderPaymentProcessor.php b/src/Processor/OrderPaymentProcessor.php index cb85e045..f1d4873e 100644 --- a/src/Processor/OrderPaymentProcessor.php +++ b/src/Processor/OrderPaymentProcessor.php @@ -18,14 +18,11 @@ final class OrderPaymentProcessor implements OrderProcessorInterface { private OrderProcessorInterface $baseOrderPaymentProcessor; - private FactoryInterface $stateMachineFactory; public function __construct( OrderProcessorInterface $baseOrderPaymentProcessor, - FactoryInterface $stateMachineFactory ) { $this->baseOrderPaymentProcessor = $baseOrderPaymentProcessor; - $this->stateMachineFactory = $stateMachineFactory; } public function process(OrderInterface $order): void diff --git a/src/Provider/Payment/ApplePayPaymentProvider.php b/src/Provider/Payment/ApplePayPaymentProvider.php index e16a5040..99377828 100644 --- a/src/Provider/Payment/ApplePayPaymentProvider.php +++ b/src/Provider/Payment/ApplePayPaymentProvider.php @@ -38,7 +38,7 @@ class ApplePayPaymentProvider { private PaymentFactoryInterface $paymentFactory; - private StateMachineFactoryInterface $stateMachineFactory; + // private StateMachineFactoryInterface $stateMachineFactory; private PaymentMethodRepositoryInterface $paymentMethodRepository; private PayPlugPaymentDataCreator $paymentDataCreator; private PayPlugApiClientInterface $applePayClient; @@ -48,7 +48,7 @@ class ApplePayPaymentProvider public function __construct( PaymentFactoryInterface $paymentFactory, - StateMachineFactoryInterface $stateMachineFactory, + // StateMachineFactoryInterface $stateMachineFactory, PaymentMethodRepositoryInterface $paymentMethodRepository, PayPlugPaymentDataCreator $paymentDataCreator, PayPlugApiClientInterface $applePayClient, diff --git a/src/Resolver/PaymentStateResolver.php b/src/Resolver/PaymentStateResolver.php index e7d5282c..73816c30 100644 --- a/src/Resolver/PaymentStateResolver.php +++ b/src/Resolver/PaymentStateResolver.php @@ -28,11 +28,9 @@ final class PaymentStateResolver implements PaymentStateResolverInterface private $paymentEntityManager; public function __construct( - FactoryInterface $stateMachineFactory, PayPlugApiClientInterface $payPlugApiClient, EntityManagerInterface $paymentEntityManager ) { - $this->stateMachineFactory = $stateMachineFactory; $this->payPlugApiClient = $payPlugApiClient; $this->paymentEntityManager = $paymentEntityManager; } From ba4b3ed0748fd052b4cf818263f5925b5a1c84c3 Mon Sep 17 00:00:00 2001 From: maxperei Date: Wed, 16 Apr 2025 12:33:49 +0200 Subject: [PATCH 004/112] refactor(di): [wip] overall services syntax --- config/routing.yaml | 6 +- config/services.xml | 169 ++++++++---------- config/services/action.xml | 13 +- config/services/no_defaults.xml | 18 +- config/state_machine/sylius_payment.yml | 6 +- .../Admin/CompleteRefundPaymentAction.php | 49 ++--- src/Action/Admin/RefundUnitsAction.php | 29 +-- src/Action/NotifyAction.php | 20 +-- src/Checker/OneyChecker.php | 11 +- src/Cli/UpdatePaymentStateCommand.php | 27 +-- .../CaptureAuthorizedPaymentCommand.php | 24 +-- src/Controller/AbstractOneyController.php | 60 ++----- src/Controller/CardController.php | 37 ++-- src/Controller/CompleteInfoController.php | 2 + .../IntegratedPaymentController.php | 2 + src/Controller/IpnAction.php | 33 +--- src/Controller/OneClickAction.php | 20 +-- src/Controller/OneyIsProductEligible.php | 2 + src/Controller/OneySimulationPopin.php | 2 + src/Controller/OrderController.php | 17 +- .../RefundUnitsCommandCreatorDecorator.php | 36 ++-- src/EventListener/AccountMenuListener.php | 2 + src/Handler/PaymentNotificationHandler.php | 41 +---- src/Handler/RefundNotificationHandler.php | 18 +- .../RefundPaymentGeneratedHandler.php | 58 ++---- .../AbortPaymentProcessor.php | 12 +- .../RefundPaymentHandler.php | 24 +-- .../RefundPaymentProcessor.php | 37 ++-- src/Processor/OrderPaymentProcessor.php | 11 +- ...dRefundPaymentMethodsProviderDecorator.php | 2 + ...dRefundPaymentMethodsProviderDecorator.php | 2 + ...dRefundPaymentMethodsProviderDecorator.php | 2 + .../CachedSimulationDataProvider.php | 19 +- .../OneySimulationDataProvider.php | 20 +-- ...dRefundPaymentMethodsProviderDecorator.php | 10 +- .../Payment/ApplePayPaymentProvider.php | 33 +--- src/Provider/PaymentTokenProvider.php | 16 +- src/Provider/SupportedMethodsProvider.php | 5 +- ...dRefundPaymentMethodsProviderDecorator.php | 12 +- ...ExpressPaymentMethodsResolverDecorator.php | 26 ++- ...pplePayPaymentMethodsResolverDecorator.php | 31 ++-- ...contactPaymentMethodsResolverDecorator.php | 26 ++- .../OneyPaymentMethodsResolverDecorator.php | 33 ++-- ...PayPlugPaymentMethodsResolverDecorator.php | 26 ++- src/Resolver/PaymentStateResolver.php | 18 +- src/Twig/OneySimulationExtension.php | 29 +-- 46 files changed, 364 insertions(+), 732 deletions(-) diff --git a/config/routing.yaml b/config/routing.yaml index 3f629c0f..7b7994f4 100644 --- a/config/routing.yaml +++ b/config/routing.yaml @@ -61,7 +61,7 @@ payplug_shop_checkout_apple_prepare: repository: method: find arguments: - - "expr:service('payplug.apple_pay_order.provider').getCurrentCart()" + - "expr:service('PayPlug\\SyliusPayPlugPlugin\\Provider\\ApplePayOrderProvider').getCurrentCart()" payplug_shop_checkout_apple_confirm: path: /payplug/apple-pay/complete/{orderId} @@ -73,7 +73,7 @@ payplug_shop_checkout_apple_confirm: repository: method: find arguments: - - "expr:service('payplug.apple_pay_order.provider').getCurrentCart()" + - "expr:service('PayPlug\\SyliusPayPlugPlugin\\Provider\\ApplePayOrderProvider').getCurrentCart()" payplug_shop_checkout_apple_cancel: path: /payplug/apple-pay/cancel/{orderId} @@ -85,7 +85,7 @@ payplug_shop_checkout_apple_cancel: repository: method: find arguments: - - "expr:service('payplug.apple_pay_order.provider').getCurrentCart()" + - "expr:service('PayPlug\\SyliusPayPlugPlugin\\Provider\\ApplePayOrderProvider').getCurrentCart()" payplug_sylius_integrated_payment_init: path: /{_locale}/payplug/integrated_payment/init/{paymentMethodId} diff --git a/config/services.xml b/config/services.xml index a5612f53..e1da0098 100644 --- a/config/services.xml +++ b/config/services.xml @@ -12,17 +12,16 @@ - + - - - - + + - - + --> - + - - + id="PayPlug\SyliusPayPlugPlugin\Controller\OrderController" + parent="sylius.controller.order" + /> - + - + - - + - + - + - + + + - - + --> - - + --> - - + --> - - + --> - - + --> - + - - + +<!– –> - + --> - %sylius_refund.supported_gateways% - + --> - - + --> - - + --> - - + --> - - + --> - + - + - - + --> - - + --> - - + --> - - +<!– –> - + --> - + - + - - - + + + - + diff --git a/config/services/action.xml b/config/services/action.xml index e1527efa..38b90def 100644 --- a/config/services/action.xml +++ b/config/services/action.xml @@ -5,8 +5,7 @@ - - + @@ -14,8 +13,8 @@ - - + + @@ -30,9 +29,9 @@ - - - + + + diff --git a/config/services/no_defaults.xml b/config/services/no_defaults.xml index ef0c3997..a41f20be 100644 --- a/config/services/no_defaults.xml +++ b/config/services/no_defaults.xml @@ -7,15 +7,15 @@ - - - + id="PayPlug\SyliusPayPlugPlugin\Repository\PaymentRepositoryInterface" + class="PayPlug\SyliusPayPlugPlugin\Repository\PaymentRepository" + parent="sylius.repository.payment" + /> + diff --git a/config/state_machine/sylius_payment.yml b/config/state_machine/sylius_payment.yml index 3b9b4420..7a335e8e 100644 --- a/config/state_machine/sylius_payment.yml +++ b/config/state_machine/sylius_payment.yml @@ -4,13 +4,13 @@ winzou_state_machine: before: payplug_sylius_payplug_plugin_refund_process: on: ["refund"] - do: ["@payplug_sylius_payplug_plugin.payment_processing.refund", "process"] + do: ["@PayPlug\\SyliusPayPlugPlugin\\PaymentProcessing\\RefundPaymentHandler", "process"] args: ["object"] payplug_sylius_payplug_plugin_failed_process: on: ["fail"] - do: ["@payplug_sylius_payplug_plugin.payment_processing.abort", "process"] + do: ["@PayPlug\\SyliusPayPlugPlugin\\PaymentProcessing\\AbortPaymentProcessor", "process"] args: ["object"] payplug_sylius_payplug_plugin_complete: on: ["complete"] - do: ["@payplug_sylius_payplug_plugin.payment_processing.capture", "process"] + do: ["@PayPlug\\SyliusPayPlugPlugin\\PaymentProcessing\\CaptureAuthorizedPaymentProcessor", "process"] args: ["object"] diff --git a/src/Action/Admin/CompleteRefundPaymentAction.php b/src/Action/Admin/CompleteRefundPaymentAction.php index 7c4a9592..fd3aedf7 100644 --- a/src/Action/Admin/CompleteRefundPaymentAction.php +++ b/src/Action/Admin/CompleteRefundPaymentAction.php @@ -14,56 +14,27 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Attribute\AsController; use Symfony\Component\Messenger\MessageBusInterface; use Symfony\Component\Routing\RouterInterface; use Symfony\Contracts\Translation\TranslatorInterface; use Throwable; +#[AsController] final class CompleteRefundPaymentAction { private const COMPLETED_STATE = 'completed'; - /** @var ObjectRepository */ - private $refundPaymentRepository; - - /** @var RefundPaymentCompletedStateApplierInterface */ - private $refundPaymentCompletedStateApplier; - - /** @var RouterInterface */ - private $router; - - /** @var OrderRepositoryInterface */ - private $orderRepository; - - /** @var MessageBusInterface */ - private $messageBus; - - /** @var RelatedPaymentIdProviderInterface */ - private $relatedPaymentIdProvider; - - /** @var \Symfony\Contracts\Translation\TranslatorInterface */ - private $translator; - - private RequestStack $requestStack; - public function __construct( - RequestStack $requestStack, - ObjectRepository $refundPaymentInterface, - OrderRepositoryInterface $orderRepository, - RefundPaymentCompletedStateApplierInterface $refundPaymentCompletedStateApplier, - RouterInterface $router, - MessageBusInterface $messageBus, - RelatedPaymentIdProviderInterface $relatedPaymentIdProvider, - TranslatorInterface $translator + private RequestStack $requestStack, + private ObjectRepository $refundPaymentRepository, + private OrderRepositoryInterface $orderRepository, + private RefundPaymentCompletedStateApplierInterface $refundPaymentCompletedStateApplier, + private RouterInterface $router, + private MessageBusInterface $messageBus, + private RelatedPaymentIdProviderInterface $relatedPaymentIdProvider, + private TranslatorInterface $translator ) { - $this->requestStack = $requestStack; - $this->refundPaymentRepository = $refundPaymentInterface; - $this->refundPaymentCompletedStateApplier = $refundPaymentCompletedStateApplier; - $this->router = $router; - $this->orderRepository = $orderRepository; - $this->messageBus = $messageBus; - $this->relatedPaymentIdProvider = $relatedPaymentIdProvider; - $this->translator = $translator; } public function __invoke(string $orderNumber, string $id): Response diff --git a/src/Action/Admin/RefundUnitsAction.php b/src/Action/Admin/RefundUnitsAction.php index 75986900..150d3252 100644 --- a/src/Action/Admin/RefundUnitsAction.php +++ b/src/Action/Admin/RefundUnitsAction.php @@ -6,42 +6,29 @@ use Exception; use Psr\Log\LoggerInterface; -use Sylius\RefundPlugin\Creator\RefundUnitsCommandCreatorInterface; use Sylius\RefundPlugin\Creator\RequestCommandCreatorInterface; use Sylius\RefundPlugin\Exception\InvalidRefundAmount; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Attribute\AsController; use Symfony\Component\Messenger\Exception\HandlerFailedException; use Symfony\Component\Messenger\MessageBusInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +#[AsController] final class RefundUnitsAction { - /** @var MessageBusInterface */ - private $commandBus; - - /** @var UrlGeneratorInterface */ - private $router; - - /** @var LoggerInterface */ - private $logger; - public function __construct( - MessageBusInterface $commandBus, + private MessageBusInterface $commandBus, private RequestStack $requestStack, - UrlGeneratorInterface $router, - private RequestCommandCreatorInterface | RefundUnitsCommandCreatorInterface $commandCreator, - LoggerInterface $logger + private UrlGeneratorInterface $router, + #[Autowire('@sylius_refund.creator.request_command')] + private RequestCommandCreatorInterface $commandCreator, + private LoggerInterface $logger ) { - $this->commandBus = $commandBus; - $this->router = $router; - $this->logger = $logger; - - if ($this->commandCreator instanceof RefundUnitsCommandCreatorInterface) { - trigger_deprecation('sylius/refund-plugin', '1.4', sprintf('Passing an instance of %s as constructor argument for %s is deprecated as of Sylius Refund Plugin 1.4 and will be removed in 2.0. Pass an instance of %s instead.', RefundUnitsCommandCreatorInterface::class, self::class, RequestCommandCreatorInterface::class)); - } } public function __invoke(Request $request): Response diff --git a/src/Action/NotifyAction.php b/src/Action/NotifyAction.php index 813476ad..a1bf6fba 100644 --- a/src/Action/NotifyAction.php +++ b/src/Action/NotifyAction.php @@ -18,29 +18,19 @@ use Payum\Core\GatewayAwareTrait; use Payum\Core\Request\Notify; use Psr\Log\LoggerInterface; +use Symfony\Component\DependencyInjection\Attribute\Autowire; final class NotifyAction implements ActionInterface, ApiAwareInterface, GatewayAwareInterface { use GatewayAwareTrait; use ApiAwareTrait; - /** @var LoggerInterface */ - private $logger; - - /** @var \PayPlug\SyliusPayPlugPlugin\Handler\PaymentNotificationHandler */ - private $paymentNotificationHandler; - - /** @var \PayPlug\SyliusPayPlugPlugin\Handler\RefundNotificationHandler */ - private $refundNotificationHandler; - public function __construct( - LoggerInterface $logger, - PaymentNotificationHandler $paymentNotificationHandler, - RefundNotificationHandler $refundNotificationHandler + #[Autowire('@monolog.logger.payum')] + private LoggerInterface $logger, + private PaymentNotificationHandler $paymentNotificationHandler, + private RefundNotificationHandler $refundNotificationHandler ) { - $this->logger = $logger; - $this->paymentNotificationHandler = $paymentNotificationHandler; - $this->refundNotificationHandler = $refundNotificationHandler; } public function execute($request): void diff --git a/src/Checker/OneyChecker.php b/src/Checker/OneyChecker.php index 9fc40f27..627cc2d6 100644 --- a/src/Checker/OneyChecker.php +++ b/src/Checker/OneyChecker.php @@ -6,17 +6,16 @@ use PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientInterface; use PayPlug\SyliusPayPlugPlugin\Gateway\OneyGatewayFactory; +use Symfony\Component\DependencyInjection\Attribute\Autowire; final class OneyChecker implements OneyCheckerInterface { private const ONEY_PERMISSION_FIELD = 'can_use_oney'; - /** @var \PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientInterface */ - private $client; - - public function __construct(PayPlugApiClientInterface $oneyClient) - { - $this->client = $oneyClient; + public function __construct( + #[Autowire('@payplug_sylius_payplug_plugin.api_client.oney')] + private PayPlugApiClientInterface $client, + ) { } public function isEnabled(): bool diff --git a/src/Cli/UpdatePaymentStateCommand.php b/src/Cli/UpdatePaymentStateCommand.php index acc7625a..838c7667 100644 --- a/src/Cli/UpdatePaymentStateCommand.php +++ b/src/Cli/UpdatePaymentStateCommand.php @@ -9,43 +9,28 @@ use PayPlug\SyliusPayPlugPlugin\Resolver\PaymentStateResolverInterface; use Psr\Log\LoggerInterface; use Sylius\Component\Core\Model\PaymentInterface; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\LockableTrait; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'payplug:update-payment-state', description: 'Updates the payments state.')] final class UpdatePaymentStateCommand extends Command { use LockableTrait; - /** @var PaymentRepositoryInterface */ - private $paymentRepository; - - /** @var PaymentStateResolverInterface */ - private $paymentStateResolver; - - /** @var LoggerInterface */ - private $logger; - public function __construct( - PaymentRepositoryInterface $paymentRepository, - PaymentStateResolverInterface $paymentStateResolver, - LoggerInterface $logger + private PaymentRepositoryInterface $paymentRepository, + private PaymentStateResolverInterface $paymentStateResolver, + private LoggerInterface $logger ) { parent::__construct(); - - $this->paymentRepository = $paymentRepository; - $this->paymentStateResolver = $paymentStateResolver; - $this->logger = $logger; } protected function configure(): void { - $this - ->setName('payplug:update-payment-state') - ->setDescription('Updates the payments state.') - ->setHelp('This command allows you to update the payments state for PayPlug gateway.') - ; + $this->setHelp('This command allows you to update the payments state for PayPlug gateway.'); } /** diff --git a/src/Command/CaptureAuthorizedPaymentCommand.php b/src/Command/CaptureAuthorizedPaymentCommand.php index fd420b94..1e1a9a56 100644 --- a/src/Command/CaptureAuthorizedPaymentCommand.php +++ b/src/Command/CaptureAuthorizedPaymentCommand.php @@ -7,38 +7,28 @@ use Doctrine\ORM\EntityManagerInterface; use PayPlug\SyliusPayPlugPlugin\Repository\PaymentRepositoryInterface; use Psr\Log\LoggerInterface; -use SM\Factory\Factory; use Sylius\Component\Payment\PaymentTransitions; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'payplug:capture-authorized-payments', description: 'Capture payplug authorized payments older than X days (default 6)')] class CaptureAuthorizedPaymentCommand extends Command { - private Factory $stateMachineFactory; - private PaymentRepositoryInterface $paymentRepository; - private EntityManagerInterface $entityManager; - private LoggerInterface $logger; - public function __construct( - // Factory $stateMachineFactory, - PaymentRepositoryInterface $paymentRepository, - EntityManagerInterface $entityManager, - LoggerInterface $logger, + // private Factory $stateMachineFactory, + private PaymentRepositoryInterface $paymentRepository, + private EntityManagerInterface $entityManager, + private LoggerInterface $logger, ) { - // $this->stateMachineFactory = $stateMachineFactory; - $this->paymentRepository = $paymentRepository; - $this->entityManager = $entityManager; - $this->logger = $logger; - parent::__construct(); } protected function configure(): void { - $this->setName('payplug:capture-authorized-payments') - ->setDescription('Capture payplug authorized payments older than X days (default 6)') + $this ->addOption('days', 'd', InputOption::VALUE_OPTIONAL, 'Number of days to wait before capturing authorized payments', 6) ; } diff --git a/src/Controller/AbstractOneyController.php b/src/Controller/AbstractOneyController.php index 06eea9ef..88a58e27 100644 --- a/src/Controller/AbstractOneyController.php +++ b/src/Controller/AbstractOneyController.php @@ -4,7 +4,7 @@ namespace PayPlug\SyliusPayPlugPlugin\Controller; -use PayPlug\SyliusPayPlugPlugin\Provider\OneySimulation\OneySimulationDataProviderInterface; +use PayPlug\SyliusPayPlugPlugin\Provider\OneySimulation\OneySimulationDataProvider; use PayPlug\SyliusPayPlugPlugin\Twig\OneyRulesExtension; use Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductRepository; use Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductVariantRepository; @@ -18,57 +18,23 @@ use Sylius\Component\Order\Modifier\OrderModifierInterface; use Sylius\Component\Resource\Factory\FactoryInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\HttpKernel\Attribute\AsController; use Webmozart\Assert\Assert; +#[AsController] abstract class AbstractOneyController extends AbstractController { - /** @var OneySimulationDataProviderInterface */ - protected $oneySimulationDataProvider; - - /** @var CartContextInterface */ - protected $cartContext; - - /** @var \Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductVariantRepository */ - protected $productVariantRepository; - - /** @var FactoryInterface */ - protected $cartFactory; - - /** @var FactoryInterface */ - protected $orderItemFactory; - - /** @var OrderModifierInterface */ - protected $orderModifier; - - /** @var OrderItemQuantityModifierInterface */ - protected $itemQuantityModifier; - - /** @var OneyRulesExtension */ - protected $oneyRulesExtension; - - /** @var ProductRepository */ - protected $productRepository; - public function __construct( - OneySimulationDataProviderInterface $oneySimulationDataProvider, - CartContextInterface $cartContext, - ProductRepository $productRepository, - ProductVariantRepository $productVariantRepository, - FactoryInterface $orderFactory, - FactoryInterface $orderItemFactory, - OrderModifierInterface $orderModifier, - OrderItemQuantityModifierInterface $itemQuantityModifier, - OneyRulesExtension $oneyRulesExtension + protected OneySimulationDataProvider $oneySimulationDataProvider, + protected CartContextInterface $cartContext, + protected ProductRepository $productRepository, + protected ProductVariantRepository $productVariantRepository, + protected FactoryInterface $orderFactory, + protected FactoryInterface $orderItemFactory, + protected OrderModifierInterface $orderModifier, + protected OrderItemQuantityModifierInterface $itemQuantityModifier, + protected OneyRulesExtension $oneyRulesExtension ) { - $this->oneySimulationDataProvider = $oneySimulationDataProvider; - $this->cartContext = $cartContext; - $this->productVariantRepository = $productVariantRepository; - $this->cartFactory = $orderFactory; - $this->orderItemFactory = $orderItemFactory; - $this->orderModifier = $orderModifier; - $this->itemQuantityModifier = $itemQuantityModifier; - $this->oneyRulesExtension = $oneyRulesExtension; - $this->productRepository = $productRepository; } protected function createTempCart( @@ -79,7 +45,7 @@ protected function createTempCart( string $currencyCode ): OrderInterface { /** @var OrderInterface $tempCart */ - $tempCart = $this->cartFactory->createNew(); + $tempCart = $this->orderFactory->createNew(); $tempCart->setChannel($channel); $tempCart->setLocaleCode($localeCode); $tempCart->setCurrencyCode($currencyCode); diff --git a/src/Controller/CardController.php b/src/Controller/CardController.php index 19658c65..69f4efad 100644 --- a/src/Controller/CardController.php +++ b/src/Controller/CardController.php @@ -12,41 +12,24 @@ use Sylius\Component\Core\Model\CustomerInterface; use Sylius\Component\Customer\Context\CustomerContextInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Attribute\AsController; use Symfony\Contracts\Translation\TranslatorInterface; +#[AsController] final class CardController extends AbstractController { - /** @var CustomerContextInterface */ - private $customerContext; - - /** @var EntityRepository */ - private $payplugCardRepository; - - /** @var TranslatorInterface */ - private $translator; - - /** @var PayPlugApiClientInterface */ - private $payPlugApiClient; - - private RequestStack $requestStack; - private ManagerRegistry $managerRegistry; - public function __construct( - CustomerContextInterface $customerContext, - EntityRepository $payplugCardRepository, - TranslatorInterface $translator, - PayPlugApiClientInterface $payPlugApiClient, - RequestStack $requestStack, - ManagerRegistry $managerRegistry + private CustomerContextInterface $customerContext, + private EntityRepository $payplugCardRepository, + private TranslatorInterface $translator, + #[Autowire('@payplug_sylius_payplug_plugin.api_client.payplug')] + private PayPlugApiClientInterface $payPlugApiClient, + private RequestStack $requestStack, + private ManagerRegistry $managerRegistry ) { - $this->customerContext = $customerContext; - $this->payplugCardRepository = $payplugCardRepository; - $this->translator = $translator; - $this->payPlugApiClient = $payPlugApiClient; - $this->requestStack = $requestStack; - $this->managerRegistry = $managerRegistry; } public function indexAction(): Response diff --git a/src/Controller/CompleteInfoController.php b/src/Controller/CompleteInfoController.php index fcd6d9dc..44541cac 100644 --- a/src/Controller/CompleteInfoController.php +++ b/src/Controller/CompleteInfoController.php @@ -16,9 +16,11 @@ use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Attribute\AsController; use Symfony\Component\Validator\Constraints\NotBlank; use Webmozart\Assert\Assert; +#[AsController] final class CompleteInfoController extends AbstractController { /** @var \PayPlug\SyliusPayPlugPlugin\Validator\OneyInvalidDataRetriever */ diff --git a/src/Controller/IntegratedPaymentController.php b/src/Controller/IntegratedPaymentController.php index cd56a432..0c26201b 100644 --- a/src/Controller/IntegratedPaymentController.php +++ b/src/Controller/IntegratedPaymentController.php @@ -20,8 +20,10 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Attribute\AsController; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; +#[AsController] final class IntegratedPaymentController extends AbstractController { private CartContextInterface $cartContext; diff --git a/src/Controller/IpnAction.php b/src/Controller/IpnAction.php index 96476050..16ac87ea 100644 --- a/src/Controller/IpnAction.php +++ b/src/Controller/IpnAction.php @@ -23,37 +23,20 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Attribute\AsController; use Webmozart\Assert\Assert; +#[AsController] class IpnAction { - private LoggerInterface $logger; - - private PaymentNotificationHandler $paymentNotificationHandler; - - private RefundNotificationHandler $refundNotificationHandler; - - private PayPlugApiClientFactoryInterface $apiClientFactory; - - private PayPlugApiClientInterface $payPlugApiClient; - - private PaymentRepositoryInterface $paymentRepository; - private EntityManagerInterface $entityManager; - public function __construct( - LoggerInterface $logger, - PaymentNotificationHandler $paymentNotificationHandler, - RefundNotificationHandler $refundNotificationHandler, - PayPlugApiClientFactoryInterface $apiClientFactory, - PaymentRepositoryInterface $paymentRepository, - EntityManagerInterface $entityManager + private LoggerInterface $logger, + private PaymentNotificationHandler $paymentNotificationHandler, + private RefundNotificationHandler $refundNotificationHandler, + private PayPlugApiClientFactoryInterface $apiClientFactory, + private PaymentRepositoryInterface $paymentRepository, + private EntityManagerInterface $entityManager ) { - $this->logger = $logger; - $this->paymentNotificationHandler = $paymentNotificationHandler; - $this->refundNotificationHandler = $refundNotificationHandler; - $this->apiClientFactory = $apiClientFactory; - $this->paymentRepository = $paymentRepository; - $this->entityManager = $entityManager; } public function __invoke(Request $request): JsonResponse diff --git a/src/Controller/OneClickAction.php b/src/Controller/OneClickAction.php index 6b8e1384..dc585d6c 100644 --- a/src/Controller/OneClickAction.php +++ b/src/Controller/OneClickAction.php @@ -19,29 +19,19 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Attribute\AsController; +#[AsController] class OneClickAction extends AbstractController implements GatewayAwareInterface, ApiAwareInterface { use GatewayAwareTrait; use ApiAwareTrait; - /** @var PaymentRepositoryInterface */ - private $paymentRepository; - - /** @var Payum */ - private $payum; - - /** @var PayPlugApiClientFactory */ - private $payPlugApiClientFactory; - public function __construct( - PaymentRepositoryInterface $paymentRepository, - Payum $payum, - PayPlugApiClientFactory $payPlugApiClientFactory + private PaymentRepositoryInterface $paymentRepository, + private Payum $payum, + private PayPlugApiClientFactory $payPlugApiClientFactory ) { - $this->paymentRepository = $paymentRepository; - $this->payum = $payum; - $this->payPlugApiClientFactory = $payPlugApiClientFactory; } public function __invoke(Request $request): Response diff --git a/src/Controller/OneyIsProductEligible.php b/src/Controller/OneyIsProductEligible.php index 57eb435c..1a5298c5 100644 --- a/src/Controller/OneyIsProductEligible.php +++ b/src/Controller/OneyIsProductEligible.php @@ -9,8 +9,10 @@ use Sylius\Component\Core\Model\ProductVariantInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpKernel\Attribute\AsController; use Webmozart\Assert\Assert; +#[AsController] final class OneyIsProductEligible extends AbstractOneyController { public function __invoke(Request $request): JsonResponse diff --git a/src/Controller/OneySimulationPopin.php b/src/Controller/OneySimulationPopin.php index ac866bef..54b925fb 100644 --- a/src/Controller/OneySimulationPopin.php +++ b/src/Controller/OneySimulationPopin.php @@ -9,8 +9,10 @@ use Sylius\Component\Core\Model\ProductVariantInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Attribute\AsController; use Webmozart\Assert\Assert; +#[AsController] final class OneySimulationPopin extends AbstractOneyController { public function __invoke(Request $request): Response diff --git a/src/Controller/OrderController.php b/src/Controller/OrderController.php index 076807ae..7dd535df 100644 --- a/src/Controller/OrderController.php +++ b/src/Controller/OrderController.php @@ -36,21 +36,18 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Attribute\AsController; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\Lock\LockFactory; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Webmozart\Assert\Assert; +#[AsController] final class OrderController extends BaseOrderController { private const APPLE_ERROR_RESPONSE_CODE = 0; private const APPLE_SUCCESS_RESPONSE_CODE = 1; - private ApplePayPaymentProvider $applePayPaymentProvider; - private \SM\Factory\FactoryInterface $stateMachineFactory; - private LockFactory $lockFactory; - private LoggerInterface $logger; - public function __construct( MetadataInterface $metadata, RequestConfigurationFactoryInterface $requestConfigurationFactory, @@ -69,9 +66,9 @@ public function __construct( ?StateMachineInterface $stateMachine, ResourceUpdateHandlerInterface $resourceUpdateHandler, ResourceDeleteHandlerInterface $resourceDeleteHandler, - ApplePayPaymentProvider $applePayPaymentProvider, - LockFactory $lockFactory, - LoggerInterface $logger + private ApplePayPaymentProvider $applePayPaymentProvider, + private LockFactory $lockFactory, + private LoggerInterface $logger ) { parent::__construct( $metadata, @@ -92,10 +89,6 @@ public function __construct( $resourceUpdateHandler, $resourceDeleteHandler ); - - $this->applePayPaymentProvider = $applePayPaymentProvider; - $this->lockFactory = $lockFactory; - $this->logger = $logger; } public function initiateApplePaySessionAction(Request $request): Response diff --git a/src/Creator/RefundUnitsCommandCreatorDecorator.php b/src/Creator/RefundUnitsCommandCreatorDecorator.php index b2313b82..9cadccdf 100644 --- a/src/Creator/RefundUnitsCommandCreatorDecorator.php +++ b/src/Creator/RefundUnitsCommandCreatorDecorator.php @@ -22,42 +22,28 @@ use Sylius\RefundPlugin\Model\RefundType; use Sylius\RefundPlugin\Model\ShipmentRefund; use Sylius\RefundPlugin\Model\UnitRefundInterface; +use Symfony\Component\DependencyInjection\Attribute\AsDecorator; +use Symfony\Component\DependencyInjection\Attribute\Autowire; +use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated; use Symfony\Component\HttpFoundation\Request; use Symfony\Contracts\Translation\TranslatorInterface; use Webmozart\Assert\Assert; +#[AsDecorator('sylius_refund.creator.request_command')] class RefundUnitsCommandCreatorDecorator implements RequestCommandCreatorInterface { private const MINIMUM_REFUND_AMOUNT = 10; - /** @var RequestCommandCreatorInterface */ - private $decorated; - - /** @var PaymentMethodRepositoryInterface */ - private $paymentMethodRepository; - - /** @var OrderRepositoryInterface */ - private $orderRepository; - - /** @var TranslatorInterface */ - private $translator; - - /** @var PayPlugApiClientInterface */ - private $oneyClient; - public function __construct( - RequestCommandCreatorInterface $decorated, + #[AutowireDecorated] + private RequestCommandCreatorInterface $decorated, + #[Autowire('@sylius_refund.converter.request_to_refund_units')] private RequestToRefundUnitsConverterInterface | RefundUnitsConverterInterface $requestToRefundUnitsConverter, - PaymentMethodRepositoryInterface $paymentMethodRepository, - OrderRepositoryInterface $orderRepository, - TranslatorInterface $translator, - PayPlugApiClientInterface $oneyClient + private PaymentMethodRepositoryInterface $paymentMethodRepository, + private OrderRepositoryInterface $orderRepository, + private TranslatorInterface $translator, + private PayPlugApiClientInterface $oneyClient ) { - $this->decorated = $decorated; - $this->paymentMethodRepository = $paymentMethodRepository; - $this->orderRepository = $orderRepository; - $this->translator = $translator; - $this->oneyClient = $oneyClient; } public function fromRequest(Request $request): RefundUnits diff --git a/src/EventListener/AccountMenuListener.php b/src/EventListener/AccountMenuListener.php index 61f35637..9bc1cdbb 100644 --- a/src/EventListener/AccountMenuListener.php +++ b/src/EventListener/AccountMenuListener.php @@ -5,7 +5,9 @@ namespace PayPlug\SyliusPayPlugPlugin\EventListener; use Sylius\Bundle\UiBundle\Menu\Event\MenuBuilderEvent; +use Symfony\Component\EventDispatcher\Attribute\AsEventListener; +#[AsEventListener(event: 'sylius.menu.shop.account', method: 'addAccountMenuItems')] final class AccountMenuListener { public function addAccountMenuItems(MenuBuilderEvent $event): void diff --git a/src/Handler/PaymentNotificationHandler.php b/src/Handler/PaymentNotificationHandler.php index 50033acb..2cf315b6 100644 --- a/src/Handler/PaymentNotificationHandler.php +++ b/src/Handler/PaymentNotificationHandler.php @@ -18,45 +18,22 @@ use Sylius\Component\Core\Repository\CustomerRepositoryInterface; use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Component\Resource\Repository\RepositoryInterface; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Lock\LockFactory; class PaymentNotificationHandler { - /** @var \Psr\Log\LoggerInterface */ - private $logger; - - /** @var \Sylius\Component\Resource\Repository\RepositoryInterface */ - private $payplugCardRepository; - - /** @var \Sylius\Component\Resource\Factory\FactoryInterface */ - private $payplugCardFactory; - - /** @var \Sylius\Component\Core\Repository\CustomerRepositoryInterface */ - private $customerRepository; - - private EntityManagerInterface $entityManager; - - private LockFactory $lockFactory; - - private RequestStack $requestStack; - public function __construct( - LoggerInterface $logger, - RepositoryInterface $payplugCardRepository, - FactoryInterface $payplugCardFactory, - CustomerRepositoryInterface $customerRepository, - EntityManagerInterface $entityManager, - LockFactory $lockFactory, - RequestStack $requestStack + #[Autowire('@monolog.logger.payum')] + private LoggerInterface $logger, + private RepositoryInterface $payplugCardRepository, + private FactoryInterface $payplugCardFactory, + private CustomerRepositoryInterface $customerRepository, + private EntityManagerInterface $entityManager, + private LockFactory $lockFactory, + private RequestStack $requestStack ) { - $this->logger = $logger; - $this->payplugCardRepository = $payplugCardRepository; - $this->payplugCardFactory = $payplugCardFactory; - $this->customerRepository = $customerRepository; - $this->entityManager = $entityManager; - $this->lockFactory = $lockFactory; - $this->requestStack = $requestStack; } public function treat(PaymentInterface $payment, IVerifiableAPIResource $paymentResource, \ArrayObject $details): void diff --git a/src/Handler/RefundNotificationHandler.php b/src/Handler/RefundNotificationHandler.php index 1d7728d6..5a477a1c 100644 --- a/src/Handler/RefundNotificationHandler.php +++ b/src/Handler/RefundNotificationHandler.php @@ -15,23 +15,11 @@ class RefundNotificationHandler { - /** @var \PayPlug\SyliusPayPlugPlugin\Repository\RefundHistoryRepositoryInterface */ - private $payplugRefundHistoryRepository; - - /** @var \PayPlug\SyliusPayPlugPlugin\PaymentProcessing\RefundPaymentHandlerInterface */ - private $refundPaymentHandler; - - /** @var \Symfony\Component\Messenger\MessageBusInterface */ - private $commandBus; - public function __construct( - RefundHistoryRepositoryInterface $payplugRefundHistoryRepository, - RefundPaymentHandlerInterface $refundPaymentHandler, - MessageBusInterface $commandBus + private RefundHistoryRepositoryInterface $payplugRefundHistoryRepository, + private RefundPaymentHandlerInterface $refundPaymentHandler, + private MessageBusInterface $commandBus ) { - $this->payplugRefundHistoryRepository = $payplugRefundHistoryRepository; - $this->refundPaymentHandler = $refundPaymentHandler; - $this->commandBus = $commandBus; } public function treat(PaymentInterface $payment, IVerifiableAPIResource $refundResource, \ArrayObject $details): void diff --git a/src/MessageHandler/RefundPaymentGeneratedHandler.php b/src/MessageHandler/RefundPaymentGeneratedHandler.php index b8de2427..73599004 100644 --- a/src/MessageHandler/RefundPaymentGeneratedHandler.php +++ b/src/MessageHandler/RefundPaymentGeneratedHandler.php @@ -36,56 +36,18 @@ final class RefundPaymentGeneratedHandler { - /** @var EntityManagerInterface */ - private $entityManager; - - /** @var FactoryInterface */ - private $stateMachineFactory; - - /** @var RefundPaymentProcessor */ - private $refundPaymentProcessor; - - /** @var PaymentRepositoryInterface */ - private $paymentRepository; - - /** @var LoggerInterface */ - private $logger; - - /** @var RefundHistoryRepositoryInterface */ - private $payplugRefundHistoryRepository; - - /** @var OrderRepositoryInterface */ - private $orderRepository; - - /** @var TranslatorInterface */ - private $translator; - - /** @var RepositoryInterface */ - private $refundPaymentRepository; - private RequestStack $requestStack; - public function __construct( - EntityManagerInterface $entityManager, - PaymentRepositoryInterface $paymentRepository, - RepositoryInterface $refundPaymentRepository, - RefundHistoryRepositoryInterface $payplugRefundHistoryRepository, - // FactoryInterface $stateMachineFactory, - RefundPaymentProcessor $refundPaymentProcessor, - LoggerInterface $logger, - RequestStack $requestStack, - OrderRepositoryInterface $orderRepository, - TranslatorInterface $translator + private EntityManagerInterface $entityManager, + private PaymentRepositoryInterface $paymentRepository, + private RepositoryInterface $refundPaymentRepository, + private RefundHistoryRepositoryInterface $payplugRefundHistoryRepository, + // private FactoryInterface $stateMachineFactory, + private RefundPaymentProcessor $refundPaymentProcessor, + private LoggerInterface $logger, + private RequestStack $requestStack, + private OrderRepositoryInterface $orderRepository, + private TranslatorInterface $translator ) { - $this->entityManager = $entityManager; - $this->paymentRepository = $paymentRepository; - $this->refundPaymentRepository = $refundPaymentRepository; - $this->payplugRefundHistoryRepository = $payplugRefundHistoryRepository; - // $this->stateMachineFactory = $stateMachineFactory; - $this->refundPaymentProcessor = $refundPaymentProcessor; - $this->logger = $logger; - $this->requestStack = $requestStack; - $this->orderRepository = $orderRepository; - $this->translator = $translator; } public function __invoke(RefundPaymentGenerated $message): void diff --git a/src/PaymentProcessing/AbortPaymentProcessor.php b/src/PaymentProcessing/AbortPaymentProcessor.php index 457eba5a..711f702c 100644 --- a/src/PaymentProcessing/AbortPaymentProcessor.php +++ b/src/PaymentProcessing/AbortPaymentProcessor.php @@ -7,14 +7,16 @@ use Payplug\Exception\HttpException; use PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientInterface; use Sylius\Component\Core\Model\PaymentInterface; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; +#[Autoconfigure(public: true)] class AbortPaymentProcessor { - private PayPlugApiClientInterface $payPlugApiClient; - - public function __construct(PayPlugApiClientInterface $payPlugApiClient) - { - $this->payPlugApiClient = $payPlugApiClient; + public function __construct( + #[Autowire('@payplug_sylius_payplug_plugin.api_client.payplug')] + private PayPlugApiClientInterface $payPlugApiClient + ) { } public function process(PaymentInterface $payment): void diff --git a/src/PaymentProcessing/RefundPaymentHandler.php b/src/PaymentProcessing/RefundPaymentHandler.php index 99ca8155..5b4323eb 100644 --- a/src/PaymentProcessing/RefundPaymentHandler.php +++ b/src/PaymentProcessing/RefundPaymentHandler.php @@ -25,28 +25,12 @@ final class RefundPaymentHandler implements RefundPaymentHandlerInterface { - /** @var RemainingTotalProviderInterface */ - private $remainingTotalProvider; - - /** @var UnitRefundTotalCalculatorInterface */ - private $unitRefundTotalCalculator; - - /** @var ObjectRepository */ - private $refundPaymentRepository; - - /** @var RefundPaymentCompletedStateApplierInterface */ - private $refundPaymentCompletedStateApplier; - public function __construct( - UnitRefundTotalCalculatorInterface $unitRefundTotalCalculator, - RemainingTotalProviderInterface $remainingTotalProvider, - ObjectRepository $refundPaymentInterface, - RefundPaymentCompletedStateApplierInterface $refundPaymentCompletedStateApplier + private UnitRefundTotalCalculatorInterface $unitRefundTotalCalculator, + private RemainingTotalProviderInterface $remainingTotalProvider, + private ObjectRepository $refundPaymentRepository, + private RefundPaymentCompletedStateApplierInterface $refundPaymentCompletedStateApplier ) { - $this->unitRefundTotalCalculator = $unitRefundTotalCalculator; - $this->remainingTotalProvider = $remainingTotalProvider; - $this->refundPaymentRepository = $refundPaymentInterface; - $this->refundPaymentCompletedStateApplier = $refundPaymentCompletedStateApplier; } public function handle(Refund $refund, PaymentInterface $payment): RefundUnits diff --git a/src/PaymentProcessing/RefundPaymentProcessor.php b/src/PaymentProcessing/RefundPaymentProcessor.php index e0c41ae4..7fd60e19 100644 --- a/src/PaymentProcessing/RefundPaymentProcessor.php +++ b/src/PaymentProcessing/RefundPaymentProcessor.php @@ -6,7 +6,6 @@ use Exception; use PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientFactoryInterface; -use PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientInterface; use PayPlug\SyliusPayPlugPlugin\Entity\RefundHistory; use PayPlug\SyliusPayPlugPlugin\Gateway\AmericanExpressGatewayFactory; use PayPlug\SyliusPayPlugPlugin\Gateway\ApplePayGatewayFactory; @@ -21,39 +20,23 @@ use Sylius\Component\Resource\Exception\UpdateHandlingException; use Sylius\Component\Resource\Repository\RepositoryInterface; use Sylius\RefundPlugin\Entity\RefundPayment; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Contracts\Translation\TranslatorInterface; +#[Autoconfigure(public: true)] final class RefundPaymentProcessor implements PaymentProcessorInterface { - private RequestStack $requestStack; - - private PayPlugApiClientInterface $payPlugApiClient; - - private LoggerInterface $logger; - - private TranslatorInterface $translator; - - private RepositoryInterface $refundPaymentRepository; - - private RefundHistoryRepositoryInterface $payplugRefundHistoryRepository; - - private PayPlugApiClientFactoryInterface $apiClientFactory; - public function __construct( - RequestStack $requestStack, - LoggerInterface $logger, - TranslatorInterface $translator, - RepositoryInterface $refundPaymentRepository, - RefundHistoryRepositoryInterface $payplugRefundHistoryRepository, - PayPlugApiClientFactoryInterface $apiClientFactory + private RequestStack $requestStack, + #[Autowire('@monolog.logger.payum')] + private LoggerInterface $logger, + private TranslatorInterface $translator, + private RepositoryInterface $refundPaymentRepository, + private RefundHistoryRepositoryInterface $payplugRefundHistoryRepository, + private PayPlugApiClientFactoryInterface $apiClientFactory ) { - $this->requestStack = $requestStack; - $this->logger = $logger; - $this->translator = $translator; - $this->refundPaymentRepository = $refundPaymentRepository; - $this->payplugRefundHistoryRepository = $payplugRefundHistoryRepository; - $this->apiClientFactory = $apiClientFactory; } public function process(PaymentInterface $payment): void diff --git a/src/Processor/OrderPaymentProcessor.php b/src/Processor/OrderPaymentProcessor.php index f1d4873e..51370da0 100644 --- a/src/Processor/OrderPaymentProcessor.php +++ b/src/Processor/OrderPaymentProcessor.php @@ -5,24 +5,23 @@ namespace PayPlug\SyliusPayPlugPlugin\Processor; use PayPlug\SyliusPayPlugPlugin\Gateway\ApplePayGatewayFactory; -use SM\Factory\FactoryInterface; use Sylius\Bundle\PayumBundle\Model\GatewayConfigInterface; use Sylius\Component\Core\Model\PaymentInterface; use Sylius\Component\Core\Model\PaymentMethodInterface; use Sylius\Component\Order\Model\OrderInterface; use Sylius\Component\Order\Processor\OrderProcessorInterface; use Sylius\Component\Payment\PaymentTransitions; +use Symfony\Component\DependencyInjection\Attribute\AsDecorator; +use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated; use Webmozart\Assert\Assert; +#[AsDecorator('sylius.order_processing.order_payment_processor.checkout')] final class OrderPaymentProcessor implements OrderProcessorInterface { - private OrderProcessorInterface $baseOrderPaymentProcessor; - - public function __construct( - OrderProcessorInterface $baseOrderPaymentProcessor, + #[AutowireDecorated] + private OrderProcessorInterface $baseOrderPaymentProcessor, ) { - $this->baseOrderPaymentProcessor = $baseOrderPaymentProcessor; } public function process(OrderInterface $order): void diff --git a/src/Provider/AmexSupportedRefundPaymentMethodsProviderDecorator.php b/src/Provider/AmexSupportedRefundPaymentMethodsProviderDecorator.php index e834ecb2..1a9ee00d 100644 --- a/src/Provider/AmexSupportedRefundPaymentMethodsProviderDecorator.php +++ b/src/Provider/AmexSupportedRefundPaymentMethodsProviderDecorator.php @@ -6,7 +6,9 @@ use PayPlug\SyliusPayPlugPlugin\Gateway\AmericanExpressGatewayFactory; use Sylius\RefundPlugin\Provider\RefundPaymentMethodsProviderInterface; +use Symfony\Component\DependencyInjection\Attribute\AsDecorator; +#[AsDecorator(ApplePaySupportedRefundPaymentMethodsProviderDecorator::class)] final class AmexSupportedRefundPaymentMethodsProviderDecorator extends AbstractSupportedRefundPaymentMethodsProvider implements RefundPaymentMethodsProviderInterface { protected string $gatewayFactoryName = AmericanExpressGatewayFactory::FACTORY_NAME; diff --git a/src/Provider/ApplePaySupportedRefundPaymentMethodsProviderDecorator.php b/src/Provider/ApplePaySupportedRefundPaymentMethodsProviderDecorator.php index 2379d8a0..76bc7443 100644 --- a/src/Provider/ApplePaySupportedRefundPaymentMethodsProviderDecorator.php +++ b/src/Provider/ApplePaySupportedRefundPaymentMethodsProviderDecorator.php @@ -6,7 +6,9 @@ use PayPlug\SyliusPayPlugPlugin\Gateway\ApplePayGatewayFactory; use Sylius\RefundPlugin\Provider\RefundPaymentMethodsProviderInterface; +use Symfony\Component\DependencyInjection\Attribute\AsDecorator; +#[AsDecorator(BancontactSupportedRefundPaymentMethodsProviderDecorator::class)] final class ApplePaySupportedRefundPaymentMethodsProviderDecorator extends AbstractSupportedRefundPaymentMethodsProvider implements RefundPaymentMethodsProviderInterface { protected string $gatewayFactoryName = ApplePayGatewayFactory::FACTORY_NAME; diff --git a/src/Provider/BancontactSupportedRefundPaymentMethodsProviderDecorator.php b/src/Provider/BancontactSupportedRefundPaymentMethodsProviderDecorator.php index ec6803d5..d4f8e883 100644 --- a/src/Provider/BancontactSupportedRefundPaymentMethodsProviderDecorator.php +++ b/src/Provider/BancontactSupportedRefundPaymentMethodsProviderDecorator.php @@ -6,7 +6,9 @@ use PayPlug\SyliusPayPlugPlugin\Gateway\BancontactGatewayFactory; use Sylius\RefundPlugin\Provider\RefundPaymentMethodsProviderInterface; +use Symfony\Component\DependencyInjection\Attribute\AsDecorator; +#[AsDecorator(OneySupportedRefundPaymentMethodsProviderDecorator::class)] final class BancontactSupportedRefundPaymentMethodsProviderDecorator extends AbstractSupportedRefundPaymentMethodsProvider implements RefundPaymentMethodsProviderInterface { protected string $gatewayFactoryName = BancontactGatewayFactory::FACTORY_NAME; diff --git a/src/Provider/OneySimulation/CachedSimulationDataProvider.php b/src/Provider/OneySimulation/CachedSimulationDataProvider.php index a5a63fcc..e5988c57 100644 --- a/src/Provider/OneySimulation/CachedSimulationDataProvider.php +++ b/src/Provider/OneySimulation/CachedSimulationDataProvider.php @@ -6,25 +6,20 @@ use PayPlug\SyliusPayPlugPlugin\Provider\OneySupportedPaymentChoiceProvider; use Sylius\Component\Core\Model\OrderInterface; +use Symfony\Component\DependencyInjection\Attribute\AsDecorator; +use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated; use Symfony\Contracts\Cache\CacheInterface; use Symfony\Contracts\Cache\ItemInterface; +#[AsDecorator(OneySimulationDataProvider::class)] final class CachedSimulationDataProvider implements OneySimulationDataProviderInterface { - private OneySimulationDataProviderInterface $decorated; - - private CacheInterface $cache; - - private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider; - public function __construct( - OneySimulationDataProviderInterface $decorated, - CacheInterface $cache, - OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider + #[AutowireDecorated] + private OneySimulationDataProviderInterface $decorated, + private CacheInterface $cache, + private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider ) { - $this->decorated = $decorated; - $this->cache = $cache; - $this->oneySupportedPaymentChoiceProvider = $oneySupportedPaymentChoiceProvider; } public function getForCart(OrderInterface $cart): array diff --git a/src/Provider/OneySimulation/OneySimulationDataProvider.php b/src/Provider/OneySimulation/OneySimulationDataProvider.php index 0b0f1b9a..8cfb5e13 100644 --- a/src/Provider/OneySimulation/OneySimulationDataProvider.php +++ b/src/Provider/OneySimulation/OneySimulationDataProvider.php @@ -9,22 +9,16 @@ use PayPlug\SyliusPayPlugPlugin\Provider\OneySupportedPaymentChoiceProvider; use Psr\Log\LoggerInterface; use Sylius\Component\Core\Model\OrderInterface; +use Symfony\Component\DependencyInjection\Attribute\Autowire; final class OneySimulationDataProvider implements OneySimulationDataProviderInterface { - private PayPlugApiClientInterface $oneyClient; - private LoggerInterface $payplugLogger; - - private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider; - public function __construct( - PayPlugApiClientInterface $oneyClient, - LoggerInterface $payplugLogger, - OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider + private PayPlugApiClientInterface $oneyClient, + #[Autowire('@monolog.logger.payum')] + private LoggerInterface $logger, + private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider ) { - $this->oneyClient = $oneyClient; - $this->payplugLogger = $payplugLogger; - $this->oneySupportedPaymentChoiceProvider = $oneySupportedPaymentChoiceProvider; } public function getForCart(OrderInterface $cart): array @@ -36,14 +30,14 @@ public function getForCart(OrderInterface $cart): array 'country' => $country, 'operations' => $this->oneySupportedPaymentChoiceProvider->getSupportedPaymentChoices(), ]; - $this->payplugLogger->debug('[PayPlug] Call oney simulation with following data', $data); + $this->logger->debug('[PayPlug] Call oney simulation with following data', $data); try { $currency = $cart->getCurrencyCode(); $accountData = $this->oneyClient->getAccount(true); $simulationData = OneySimulation::getSimulations($data, $this->oneyClient->getConfiguration()); - $this->payplugLogger->debug('[PayPlug] Oney simulation response', $simulationData); + $this->logger->debug('[PayPlug] Oney simulation response', $simulationData); return \array_merge( [ diff --git a/src/Provider/OneySupportedRefundPaymentMethodsProviderDecorator.php b/src/Provider/OneySupportedRefundPaymentMethodsProviderDecorator.php index 21ca9ebc..009729bd 100644 --- a/src/Provider/OneySupportedRefundPaymentMethodsProviderDecorator.php +++ b/src/Provider/OneySupportedRefundPaymentMethodsProviderDecorator.php @@ -5,16 +5,10 @@ namespace PayPlug\SyliusPayPlugPlugin\Provider; use PayPlug\SyliusPayPlugPlugin\Gateway\OneyGatewayFactory; -use Payum\Core\Model\GatewayConfigInterface; -use Sylius\Component\Core\Model\ChannelInterface; -use Sylius\Component\Core\Model\OrderInterface; -use Sylius\Component\Core\Model\PaymentInterface; -use Sylius\Component\Core\Model\PaymentMethodInterface; -use Sylius\Component\Core\Repository\OrderRepositoryInterface; use Sylius\RefundPlugin\Provider\RefundPaymentMethodsProviderInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\DependencyInjection\Attribute\AsDecorator; +#[AsDecorator(SupportedRefundPaymentMethodsProviderDecorator::class)] final class OneySupportedRefundPaymentMethodsProviderDecorator extends AbstractSupportedRefundPaymentMethodsProvider implements RefundPaymentMethodsProviderInterface { protected string $gatewayFactoryName = OneyGatewayFactory::FACTORY_NAME; diff --git a/src/Provider/Payment/ApplePayPaymentProvider.php b/src/Provider/Payment/ApplePayPaymentProvider.php index 99377828..e8159c19 100644 --- a/src/Provider/Payment/ApplePayPaymentProvider.php +++ b/src/Provider/Payment/ApplePayPaymentProvider.php @@ -37,33 +37,16 @@ class ApplePayPaymentProvider { - private PaymentFactoryInterface $paymentFactory; - // private StateMachineFactoryInterface $stateMachineFactory; - private PaymentMethodRepositoryInterface $paymentMethodRepository; - private PayPlugPaymentDataCreator $paymentDataCreator; - private PayPlugApiClientInterface $applePayClient; - private EntityManagerInterface $entityManager; - private OrderTokenAssignerInterface $orderTokenAssigner; - private RouterInterface $router; - public function __construct( - PaymentFactoryInterface $paymentFactory, - // StateMachineFactoryInterface $stateMachineFactory, - PaymentMethodRepositoryInterface $paymentMethodRepository, - PayPlugPaymentDataCreator $paymentDataCreator, - PayPlugApiClientInterface $applePayClient, - EntityManagerInterface $entityManager, - OrderTokenAssignerInterface $orderTokenAssigner, - RouterInterface $router + private PaymentFactoryInterface $paymentFactory, + // private StateMachineFactoryInterface $stateMachineFactory; + private PaymentMethodRepositoryInterface $paymentMethodRepository, + private PayPlugPaymentDataCreator $paymentDataCreator, + private PayPlugApiClientInterface $applePayClient, + private EntityManagerInterface $entityManager, + private OrderTokenAssignerInterface $orderTokenAssigner, + private RouterInterface $router ) { - $this->paymentFactory = $paymentFactory; - $this->stateMachineFactory = $stateMachineFactory; - $this->paymentMethodRepository = $paymentMethodRepository; - $this->paymentDataCreator = $paymentDataCreator; - $this->applePayClient = $applePayClient; - $this->entityManager = $entityManager; - $this->orderTokenAssigner = $orderTokenAssigner; - $this->router = $router; } public function provide(Request $request, OrderInterface $order): PaymentInterface diff --git a/src/Provider/PaymentTokenProvider.php b/src/Provider/PaymentTokenProvider.php index 2d2af180..0e5502ef 100644 --- a/src/Provider/PaymentTokenProvider.php +++ b/src/Provider/PaymentTokenProvider.php @@ -9,19 +9,15 @@ use Payum\Core\Security\TokenInterface; use Sylius\Component\Core\Model\PaymentInterface; use Sylius\Component\Core\Model\PaymentMethodInterface; +use Symfony\Component\DependencyInjection\Attribute\Autowire; final class PaymentTokenProvider { - /** @var Payum */ - private $payum; - - /** @var string */ - private $afterPayRoute; - - public function __construct(Payum $payum, string $afterPayRoute) - { - $this->payum = $payum; - $this->afterPayRoute = $afterPayRoute; + public function __construct( + Payum $payum, + #[Autowire('sylius_shop_order_after_pay')] + string $afterPayRoute + ) { } public function getPaymentToken(PaymentInterface $payment): TokenInterface diff --git a/src/Provider/SupportedMethodsProvider.php b/src/Provider/SupportedMethodsProvider.php index 9ea33003..9f0e621b 100644 --- a/src/Provider/SupportedMethodsProvider.php +++ b/src/Provider/SupportedMethodsProvider.php @@ -11,11 +11,8 @@ final class SupportedMethodsProvider { - private CurrencyContextInterface $currencyContext; - - public function __construct(CurrencyContextInterface $currencyContext) + public function __construct(private CurrencyContextInterface $currencyContext) { - $this->currencyContext = $currencyContext; } public function provide(array $supportedMethods, string $factoryName, array $authorizedCurrencies, int $paymentAmount): array diff --git a/src/Provider/SupportedRefundPaymentMethodsProviderDecorator.php b/src/Provider/SupportedRefundPaymentMethodsProviderDecorator.php index aa05b826..1547ef3a 100644 --- a/src/Provider/SupportedRefundPaymentMethodsProviderDecorator.php +++ b/src/Provider/SupportedRefundPaymentMethodsProviderDecorator.php @@ -12,23 +12,25 @@ use Sylius\Component\Core\Model\PaymentMethodInterface; use Sylius\Component\Core\Repository\OrderRepositoryInterface; use Sylius\RefundPlugin\Provider\RefundPaymentMethodsProviderInterface; -use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\DependencyInjection\Attribute\AsDecorator; +use Symfony\Component\DependencyInjection\Attribute\Autowire; +use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated; use Symfony\Component\HttpFoundation\RequestStack; +#[AsDecorator('sylius_refund.provider.refund_payment_methods')] final class SupportedRefundPaymentMethodsProviderDecorator extends AbstractSupportedRefundPaymentMethodsProvider implements RefundPaymentMethodsProviderInterface { - protected array $supportedRefundGateways; - protected string $gatewayFactoryName = PayPlugGatewayFactory::FACTORY_NAME; public function __construct( + #[AutowireDecorated] RefundPaymentMethodsProviderInterface $decorated, RequestStack $requestStack, OrderRepositoryInterface $orderRepository, - array $supportedRefundGateways + #[Autowire('%sylius_refund.supported_gateways%')] + protected array $supportedRefundGateways ) { parent::__construct($decorated, $requestStack, $orderRepository); - $this->supportedRefundGateways = $supportedRefundGateways; } protected function find(array $paymentMethods, OrderInterface $order): array diff --git a/src/Resolver/AmericanExpressPaymentMethodsResolverDecorator.php b/src/Resolver/AmericanExpressPaymentMethodsResolverDecorator.php index 40ac30ef..39937e46 100644 --- a/src/Resolver/AmericanExpressPaymentMethodsResolverDecorator.php +++ b/src/Resolver/AmericanExpressPaymentMethodsResolverDecorator.php @@ -9,37 +9,35 @@ use Sylius\Component\Core\Model\Payment; use Sylius\Component\Payment\Model\PaymentInterface as BasePaymentInterface; use Sylius\Component\Payment\Resolver\PaymentMethodsResolverInterface; +use Symfony\Component\DependencyInjection\Attribute\AsDecorator; +use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated; use Webmozart\Assert\Assert; +#[AsDecorator('sylius.resolver.payment_methods')] final class AmericanExpressPaymentMethodsResolverDecorator implements PaymentMethodsResolverInterface { - private PaymentMethodsResolverInterface $decorated; - - private SupportedMethodsProvider $supportedMethodsProvider; - public function __construct( - PaymentMethodsResolverInterface $decorated, - SupportedMethodsProvider $supportedMethodsProvider + #[AutowireDecorated] + private PaymentMethodsResolverInterface $decorated, + private SupportedMethodsProvider $supportedMethodsProvider ) { - $this->decorated = $decorated; - $this->supportedMethodsProvider = $supportedMethodsProvider; } - public function getSupportedMethods(BasePaymentInterface $payment): array + public function getSupportedMethods(BasePaymentInterface $subject): array { - Assert::isInstanceOf($payment, Payment::class); - $supportedMethods = $this->decorated->getSupportedMethods($payment); + Assert::isInstanceOf($subject, Payment::class); + $supportedMethods = $this->decorated->getSupportedMethods($subject); return $this->supportedMethodsProvider->provide( $supportedMethods, AmericanExpressGatewayFactory::FACTORY_NAME, AmericanExpressGatewayFactory::AUTHORIZED_CURRENCIES, - $payment->getAmount() ?? 0 + $subject->getAmount() ?? 0 ); } - public function supports(BasePaymentInterface $payment): bool + public function supports(BasePaymentInterface $subject): bool { - return $this->decorated->supports($payment); + return $this->decorated->supports($subject); } } diff --git a/src/Resolver/ApplePayPaymentMethodsResolverDecorator.php b/src/Resolver/ApplePayPaymentMethodsResolverDecorator.php index 25ea6014..61de27f5 100644 --- a/src/Resolver/ApplePayPaymentMethodsResolverDecorator.php +++ b/src/Resolver/ApplePayPaymentMethodsResolverDecorator.php @@ -12,30 +12,25 @@ use Sylius\Component\Core\Model\PaymentMethodInterface; use Sylius\Component\Payment\Model\PaymentInterface as BasePaymentInterface; use Sylius\Component\Payment\Resolver\PaymentMethodsResolverInterface; +use Symfony\Component\DependencyInjection\Attribute\AsDecorator; +use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated; use Webmozart\Assert\Assert; +#[AsDecorator('sylius.resolver.payment_methods')] final class ApplePayPaymentMethodsResolverDecorator implements PaymentMethodsResolverInterface { - private PaymentMethodsResolverInterface $decorated; - - private SupportedMethodsProvider $supportedMethodsProvider; - - private ApplePayCheckerInterface $applePayChecker; - public function __construct( - PaymentMethodsResolverInterface $decorated, - SupportedMethodsProvider $supportedMethodsProvider, - ApplePayCheckerInterface $applePayChecker + #[AutowireDecorated] + private PaymentMethodsResolverInterface $decorated, + private SupportedMethodsProvider $supportedMethodsProvider, + private ApplePayCheckerInterface $applePayChecker ) { - $this->decorated = $decorated; - $this->supportedMethodsProvider = $supportedMethodsProvider; - $this->applePayChecker = $applePayChecker; } - public function getSupportedMethods(BasePaymentInterface $payment): array + public function getSupportedMethods(BasePaymentInterface $subject): array { - Assert::isInstanceOf($payment, Payment::class); - $supportedMethods = $this->decorated->getSupportedMethods($payment); + Assert::isInstanceOf($subject, Payment::class); + $supportedMethods = $this->decorated->getSupportedMethods($subject); foreach ($supportedMethods as $key => $paymentMethod) { Assert::isInstanceOf($paymentMethod, PaymentMethodInterface::class); @@ -56,12 +51,12 @@ public function getSupportedMethods(BasePaymentInterface $payment): array $supportedMethods, ApplePayGatewayFactory::FACTORY_NAME, ApplePayGatewayFactory::AUTHORIZED_CURRENCIES, - $payment->getAmount() ?? 0 + $subject->getAmount() ?? 0 ); } - public function supports(BasePaymentInterface $payment): bool + public function supports(BasePaymentInterface $subject): bool { - return $this->decorated->supports($payment); + return $this->decorated->supports($subject); } } diff --git a/src/Resolver/BancontactPaymentMethodsResolverDecorator.php b/src/Resolver/BancontactPaymentMethodsResolverDecorator.php index bb39481e..e16f1a12 100644 --- a/src/Resolver/BancontactPaymentMethodsResolverDecorator.php +++ b/src/Resolver/BancontactPaymentMethodsResolverDecorator.php @@ -9,37 +9,35 @@ use Sylius\Component\Core\Model\Payment; use Sylius\Component\Payment\Model\PaymentInterface as BasePaymentInterface; use Sylius\Component\Payment\Resolver\PaymentMethodsResolverInterface; +use Symfony\Component\DependencyInjection\Attribute\AsDecorator; +use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated; use Webmozart\Assert\Assert; +#[AsDecorator('sylius.resolver.payment_methods')] final class BancontactPaymentMethodsResolverDecorator implements PaymentMethodsResolverInterface { - private PaymentMethodsResolverInterface $decorated; - - private SupportedMethodsProvider $supportedMethodsProvider; - public function __construct( - PaymentMethodsResolverInterface $decorated, - SupportedMethodsProvider $supportedMethodsProvider + #[AutowireDecorated] + private PaymentMethodsResolverInterface $decorated, + private SupportedMethodsProvider $supportedMethodsProvider ) { - $this->decorated = $decorated; - $this->supportedMethodsProvider = $supportedMethodsProvider; } - public function getSupportedMethods(BasePaymentInterface $payment): array + public function getSupportedMethods(BasePaymentInterface $subject): array { - Assert::isInstanceOf($payment, Payment::class); - $supportedMethods = $this->decorated->getSupportedMethods($payment); + Assert::isInstanceOf($subject, Payment::class); + $supportedMethods = $this->decorated->getSupportedMethods($subject); return $this->supportedMethodsProvider->provide( $supportedMethods, BancontactGatewayFactory::FACTORY_NAME, BancontactGatewayFactory::AUTHORIZED_CURRENCIES, - $payment->getAmount() ?? 0 + $subject->getAmount() ?? 0 ); } - public function supports(BasePaymentInterface $payment): bool + public function supports(BasePaymentInterface $subject): bool { - return $this->decorated->supports($payment); + return $this->decorated->supports($subject); } } diff --git a/src/Resolver/OneyPaymentMethodsResolverDecorator.php b/src/Resolver/OneyPaymentMethodsResolverDecorator.php index 48073bf1..404c25a0 100644 --- a/src/Resolver/OneyPaymentMethodsResolverDecorator.php +++ b/src/Resolver/OneyPaymentMethodsResolverDecorator.php @@ -13,33 +13,28 @@ use Sylius\Component\Currency\Context\CurrencyContextInterface; use Sylius\Component\Payment\Model\PaymentInterface as BasePaymentInterface; use Sylius\Component\Payment\Resolver\PaymentMethodsResolverInterface; +use Symfony\Component\DependencyInjection\Attribute\AsDecorator; +use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated; use Webmozart\Assert\Assert; +#[AsDecorator('sylius.resolver.payment_methods')] final class OneyPaymentMethodsResolverDecorator implements PaymentMethodsResolverInterface { - private CurrencyContextInterface $currencyContext; - - private PaymentMethodsResolverInterface $decorated; - - private OneyCheckerInterface $oneyChecker; - public function __construct( - PaymentMethodsResolverInterface $decorated, - CurrencyContextInterface $currencyContext, - OneyCheckerInterface $oneyChecker + #[AutowireDecorated] + private PaymentMethodsResolverInterface $decorated, + private CurrencyContextInterface $currencyContext, + private OneyCheckerInterface $oneyChecker ) { - $this->currencyContext = $currencyContext; - $this->decorated = $decorated; - $this->oneyChecker = $oneyChecker; } - public function getSupportedMethods(BasePaymentInterface $payment): array + public function getSupportedMethods(BasePaymentInterface $subject): array { - Assert::isInstanceOf($payment, Payment::class); - $supportedMethods = $this->decorated->getSupportedMethods($payment); + Assert::isInstanceOf($subject, Payment::class); + $supportedMethods = $this->decorated->getSupportedMethods($subject); /** @var OrderInterface $order */ - $order = $payment->getOrder(); + $order = $subject->getOrder(); $activeCurrencyCode = $this->currencyContext->getCurrencyCode(); @@ -62,7 +57,7 @@ public function getSupportedMethods(BasePaymentInterface $payment): array } if (!$this->oneyChecker->isEnabled() || - !$this->oneyChecker->isPriceEligible($payment->getAmount() ?? 0, $activeCurrencyCode) || + !$this->oneyChecker->isPriceEligible($subject->getAmount() ?? 0, $activeCurrencyCode) || !$this->oneyChecker->isNumberOfProductEligible($order->getItemUnits()->count()) || !$this->oneyChecker->isCountryEligible($countryCodeShipping, $countryCodeBilling)) { unset($supportedMethods[$key]); @@ -72,8 +67,8 @@ public function getSupportedMethods(BasePaymentInterface $payment): array return $supportedMethods; } - public function supports(BasePaymentInterface $payment): bool + public function supports(BasePaymentInterface $subject): bool { - return $this->decorated->supports($payment); + return $this->decorated->supports($subject); } } diff --git a/src/Resolver/PayPlugPaymentMethodsResolverDecorator.php b/src/Resolver/PayPlugPaymentMethodsResolverDecorator.php index 5f276578..375193ea 100644 --- a/src/Resolver/PayPlugPaymentMethodsResolverDecorator.php +++ b/src/Resolver/PayPlugPaymentMethodsResolverDecorator.php @@ -9,37 +9,35 @@ use Sylius\Component\Core\Model\Payment; use Sylius\Component\Payment\Model\PaymentInterface as BasePaymentInterface; use Sylius\Component\Payment\Resolver\PaymentMethodsResolverInterface; +use Symfony\Component\DependencyInjection\Attribute\AsDecorator; +use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated; use Webmozart\Assert\Assert; +#[AsDecorator('sylius.resolver.payment_methods')] final class PayPlugPaymentMethodsResolverDecorator implements PaymentMethodsResolverInterface { - private PaymentMethodsResolverInterface $decorated; - - private SupportedMethodsProvider $supportedMethodsProvider; - public function __construct( - PaymentMethodsResolverInterface $decorated, - SupportedMethodsProvider $supportedMethodsProvider + #[AutowireDecorated] + private PaymentMethodsResolverInterface $decorated, + private SupportedMethodsProvider $supportedMethodsProvider ) { - $this->decorated = $decorated; - $this->supportedMethodsProvider = $supportedMethodsProvider; } - public function getSupportedMethods(BasePaymentInterface $payment): array + public function getSupportedMethods(BasePaymentInterface $subject): array { - Assert::isInstanceOf($payment, Payment::class); - $supportedMethods = $this->decorated->getSupportedMethods($payment); + Assert::isInstanceOf($subject, Payment::class); + $supportedMethods = $this->decorated->getSupportedMethods($subject); return $this->supportedMethodsProvider->provide( $supportedMethods, PayPlugGatewayFactory::FACTORY_NAME, PayPlugGatewayFactory::AUTHORIZED_CURRENCIES, - $payment->getAmount() ?? 0 + $subject->getAmount() ?? 0 ); } - public function supports(BasePaymentInterface $payment): bool + public function supports(BasePaymentInterface $subject): bool { - return $this->decorated->supports($payment); + return $this->decorated->supports($subject); } } diff --git a/src/Resolver/PaymentStateResolver.php b/src/Resolver/PaymentStateResolver.php index 73816c30..cac7b789 100644 --- a/src/Resolver/PaymentStateResolver.php +++ b/src/Resolver/PaymentStateResolver.php @@ -10,29 +10,19 @@ use PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientInterface; use PayPlug\SyliusPayPlugPlugin\Gateway\PayPlugGatewayFactory; use Payum\Core\Model\GatewayConfigInterface; -use SM\Factory\FactoryInterface; use SM\StateMachine\StateMachineInterface; use Sylius\Component\Core\Model\PaymentInterface; use Sylius\Component\Core\Model\PaymentMethodInterface; use Sylius\Component\Payment\PaymentTransitions; +use Symfony\Component\DependencyInjection\Attribute\Autowire; final class PaymentStateResolver implements PaymentStateResolverInterface { - /** @var FactoryInterface */ - private $stateMachineFactory; - - /** @var PayPlugApiClientInterface */ - private $payPlugApiClient; - - /** @var EntityManagerInterface */ - private $paymentEntityManager; - public function __construct( - PayPlugApiClientInterface $payPlugApiClient, - EntityManagerInterface $paymentEntityManager + #[Autowire('@payplug_sylius_payplug_plugin.api_client.payplug')] + private PayPlugApiClientInterface $payPlugApiClient, + private EntityManagerInterface $paymentEntityManager ) { - $this->payPlugApiClient = $payPlugApiClient; - $this->paymentEntityManager = $paymentEntityManager; } public function resolve(PaymentInterface $payment): void diff --git a/src/Twig/OneySimulationExtension.php b/src/Twig/OneySimulationExtension.php index 63cfe274..6000a117 100644 --- a/src/Twig/OneySimulationExtension.php +++ b/src/Twig/OneySimulationExtension.php @@ -18,32 +18,13 @@ final class OneySimulationExtension extends AbstractExtension { - /** @var \Sylius\Component\Order\Context\CartContextInterface */ - private $cartContext; - - /** @var \PayPlug\SyliusPayPlugPlugin\Provider\OneySimulation\OneySimulationDataProviderInterface */ - private $oneySimulationDataProvider; - - /** @var \Symfony\Component\HttpFoundation\RequestStack */ - private $requestStack; - - /** @var \Sylius\Component\Core\Repository\OrderRepositoryInterface */ - private $orderRepository; - - private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider; - public function __construct( - CartContextInterface $cartContext, - OneySimulationDataProviderInterface $oneySimulationDataProvider, - RequestStack $requestStack, - OrderRepositoryInterface $orderRepository, - OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider + private CartContextInterface $cartContext, + private OneySimulationDataProviderInterface $oneySimulationDataProvider, + private RequestStack $requestStack, + private OrderRepositoryInterface $orderRepository, + private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider ) { - $this->cartContext = $cartContext; - $this->oneySimulationDataProvider = $oneySimulationDataProvider; - $this->requestStack = $requestStack; - $this->orderRepository = $orderRepository; - $this->oneySupportedPaymentChoiceProvider = $oneySupportedPaymentChoiceProvider; } public function getFunctions(): array From ca96763c5ec5234ba0c43ff26c44c51ce60daee6 Mon Sep 17 00:00:00 2001 From: maxperei Date: Wed, 16 Apr 2025 15:49:45 +0200 Subject: [PATCH 005/112] refactor(lint): [grump] run quality tools --- composer.json | 68 +- grumphp.yml | 32 + {rulesets => ruleset}/.php_md.xml | 0 ruleset/ecs.php | 19 + ruleset/phpstan-baseline.neon | 1453 +++++++++++++++++ {rulesets => ruleset}/phpstan.neon | 17 +- ruleset/rector.php | 41 + ruleset/ruleset.xml | 19 + rulesets/ecs.php | 25 - rulesets/phpstan-baseline.neon | 464 ------ spec/Action/ConvertPaymentActionSpec.php | 10 +- spec/Action/NotifyActionSpec.php | 8 +- spec/Action/StatusActionSpec.php | 6 +- .../RefundPaymentProcessorSpec.php | 6 +- .../Admin/CompleteRefundPaymentAction.php | 8 +- src/Action/Admin/RefundUnitsAction.php | 4 +- src/Action/Api/ApiAwareTrait.php | 2 +- src/Action/CaptureAction.php | 104 +- src/Action/ConvertPaymentAction.php | 8 +- src/Action/NotifyAction.php | 2 +- src/Action/StatusAction.php | 29 +- src/ApiClient/PayPlugApiClient.php | 14 +- src/ApiClient/PayPlugApiClientFactory.php | 14 +- src/Checker/ApplePayChecker.php | 7 +- src/Checker/CanSaveCardChecker.php | 11 +- .../CanSavePayplugPaymentMethodChecker.php | 5 +- src/Checker/OneyChecker.php | 7 +- src/Checker/OneyOrderChecker.php | 8 +- src/Checker/PermissionCanSaveCardsChecker.php | 6 +- src/Cli/UpdatePaymentStateCommand.php | 2 +- .../CaptureAuthorizedPaymentCommand.php | 7 +- src/Const/Permission.php | 5 + src/Controller/AbstractOneyController.php | 4 +- src/Controller/CardController.php | 15 +- src/Controller/CompleteInfoController.php | 21 +- .../IntegratedPaymentController.php | 34 +- src/Controller/IpnAction.php | 4 +- src/Controller/OneClickAction.php | 7 +- src/Controller/OneyIsProductEligible.php | 4 +- src/Controller/OneySimulationPopin.php | 8 +- src/Controller/OrderController.php | 25 +- src/Creator/PayPlugPaymentDataCreator.php | 64 +- .../RefundUnitsCommandCreatorDecorator.php | 20 +- src/Entity/Card.php | 15 + src/Entity/RefundHistory.php | 12 + src/Entity/Traits/CustomerTrait.php | 7 +- src/Entity/Traits/PaymentMethodTrait.php | 10 +- src/Entity/Traits/PaymentTrait.php | 4 +- .../DisplayOneyGatewayFormEventSubscriber.php | 25 +- .../PostPaymentSelectEventSubscriber.php | 11 +- src/Form/Extension/PaymentTypeExtension.php | 40 +- src/Gateway/AbstractGatewayFactory.php | 2 +- ...yPlugGatewayConfigurationTypeExtension.php | 5 +- .../Type/AbstractGatewayConfigurationType.php | 21 +- src/Gateway/PayPlugGatewayFactory.php | 3 + .../Constraints/IsCanSaveCardsValidator.php | 11 +- .../IsCanSavePaymentMethodValidator.php | 7 +- .../Constraints/IsOneyEnabledValidator.php | 8 +- .../IsPayPlugSecretKeyValidator.php | 8 +- .../Constraints/PayplugPermission.php | 3 + .../PayplugPermissionValidator.php | 8 +- src/Handler/PaymentNotificationHandler.php | 43 +- src/Handler/RefundNotificationHandler.php | 9 +- .../RefundPaymentGeneratedHandler.php | 22 +- src/Model/OneyCompleteInfoDTO.php | 18 +- src/PayPlugSyliusPayPlugPlugin.php | 4 +- .../AbortPaymentProcessor.php | 4 +- .../CaptureAuthorizedPaymentProcessor.php | 9 +- .../RefundPaymentHandler.php | 8 +- .../RefundPaymentProcessor.php | 6 +- src/Processor/OrderPaymentProcessor.php | 2 + ...tSupportedRefundPaymentMethodsProvider.php | 21 +- src/Provider/ApplePayOrderProvider.php | 5 +- .../CachedSimulationDataProvider.php | 2 +- .../OneySimulationDataProvider.php | 6 +- .../OneySupportedPaymentChoiceProvider.php | 13 +- .../Payment/ApplePayPaymentProvider.php | 54 +- src/Provider/PaymentTokenProvider.php | 8 +- src/Provider/SupportedMethodsProvider.php | 13 +- ...dRefundPaymentMethodsProviderDecorator.php | 13 +- src/Repository/PaymentRepository.php | 8 +- ...ExpressPaymentMethodsResolverDecorator.php | 4 +- ...pplePayPaymentMethodsResolverDecorator.php | 4 +- ...contactPaymentMethodsResolverDecorator.php | 4 +- .../OneyPaymentMethodsResolverDecorator.php | 8 +- ...PayPlugPaymentMethodsResolverDecorator.php | 4 +- src/Resolver/PaymentStateResolver.php | 18 +- src/Twig/GetCurrentRouteExtension.php | 4 +- src/Twig/GetPayPlugApiUrlExtension.php | 2 +- src/Twig/OneyExtension.php | 26 +- src/Twig/OneyRulesExtension.php | 60 +- src/Twig/OneySimulationExtension.php | 14 +- src/Twig/PayPlugExtension.php | 16 +- src/Twig/ProductVariantsCodesExtension.php | 2 +- src/Twig/ShowMeaExtension.php | 22 +- src/Validator/OneyInvalidDataRetriever.php | 2 +- .../Order/Show/_payment.html.twig | 7 +- .../Context/Cli/UpdatePaymentStateContext.php | 2 +- tests/Behat/Context/Setup/OrderContext.php | 2 +- tests/Behat/Context/Setup/PayPlugContext.php | 28 +- .../Ui/Admin/ManagingPaymentMethodContext.php | 2 +- .../Behat/Context/Ui/Admin/RefundContext.php | 10 +- .../Behat/Context/Ui/Shop/CheckoutContext.php | 8 +- tests/Behat/Mocker/PayPlugApiMocker.php | 8 +- tests/Behat/Page/Shop/Payum/PaymentPage.php | 4 +- 105 files changed, 2124 insertions(+), 1222 deletions(-) mode change 100644 => 100755 composer.json create mode 100644 grumphp.yml rename {rulesets => ruleset}/.php_md.xml (100%) create mode 100644 ruleset/ecs.php create mode 100644 ruleset/phpstan-baseline.neon rename {rulesets => ruleset}/phpstan.neon (64%) create mode 100644 ruleset/rector.php create mode 100644 ruleset/ruleset.xml delete mode 100644 rulesets/ecs.php delete mode 100644 rulesets/phpstan-baseline.neon mode change 100755 => 100644 templates/SyliusAdminBundle/Order/Show/_payment.html.twig diff --git a/composer.json b/composer.json old mode 100644 new mode 100755 index db07a143..452a10ae --- a/composer.json +++ b/composer.json @@ -21,38 +21,38 @@ "symfony/validator": "^6.0|^7.0" }, "require-dev": { - "behat/behat": "^3.7", - "behat/mink-selenium2-driver": "^1.4", - "dmore/behat-chrome-extension": "^1.3", - "dmore/chrome-mink-driver": "^2.7", - "friends-of-behat/mink": "^1.8", - "friends-of-behat/mink-browserkit-driver": "^1.4", - "friends-of-behat/mink-debug-extension": "^2.0", - "friends-of-behat/mink-extension": "^2.4", - "friends-of-behat/page-object-extension": "^0.3", - "friends-of-behat/suite-settings-extension": "^1.0", - "friends-of-behat/symfony-extension": "^2.1", - "friends-of-behat/variadic-extension": "^1.3", - "friendsoftwig/twigcs": "^5.0", - "j13k/yaml-lint": "^1.1", - "lakion/mink-debug-extension": "^2.0", - "mockery/mockery": "^1.5", - "php-parallel-lint/php-parallel-lint": "^1.0", - "phpmd/phpmd": "^2.8", - "phpspec/phpspec": "^6.1 || ^7.2", - "phpstan/extension-installer": "1.1.0", - "phpstan/phpstan": "1.8.2", - "phpstan/phpstan-doctrine": "1.3.11", - "phpstan/phpstan-strict-rules": "1.3.0", - "phpstan/phpstan-webmozart-assert": "1.2.0", - "phpunit/phpunit": "^9.0", - "slevomat/coding-standard": "^6.3.2", - "sylius-labs/coding-standard": "^4.0", - "symfony/browser-kit": "^5.0|^6.0", - "symfony/debug-bundle": "^5.0|^6.0", - "symfony/dotenv": "^5.0|^6.0", - "symfony/intl": "^5.0|^6.0", - "symfony/web-profiler-bundle": "^5.0|^6.0", + "behat/behat": "3.20.0", + "behat/mink-selenium2-driver": "1.7.0", + "dmore/behat-chrome-extension": "1.4.0", + "dmore/chrome-mink-driver": "2.9.3", + "friends-of-behat/mink": "1.11.0", + "friends-of-behat/mink-browserkit-driver": "1.6.2", + "friends-of-behat/mink-debug-extension": "2.1.0", + "friends-of-behat/mink-extension": "2.7.5", + "friends-of-behat/page-object-extension": "0.3.2", + "friends-of-behat/suite-settings-extension": "1.1.0", + "friends-of-behat/symfony-extension": "2.6.0", + "friends-of-behat/variadic-extension": "1.6.0", + "friendsoftwig/twigcs": "6.4.0", + "j13k/yaml-lint": "1.1.6", + "lakion/mink-debug-extension": "2.0.0", + "mockery/mockery": "1.6.12", + "php-parallel-lint/php-parallel-lint": "1.4.0", + "phpmd/phpmd": "^2.15.0", + "phpro/grumphp": "^2.12", + "phpspec/phpspec": "7.5.0", + "phpstan/extension-installer": "1.4.3", + "phpstan/phpstan": "2.0.4", + "phpstan/phpstan-doctrine": "2.0.1", + "phpstan/phpstan-strict-rules": "2.0.1", + "phpstan/phpstan-webmozart-assert": "2.0.0", + "phpunit/phpunit": "9.6.22", + "rector/rector": "2.0.4", + "sylius-labs/coding-standard": "4.4.0", + "symfony/browser-kit": "7.2.4", + "symfony/debug-bundle": "^7.2.0", + "symfony/dotenv": "7.2.0", + "symfony/web-profiler-bundle": "7.2.4", "webmozart/assert": "^1.8" }, "prefer-stable": true, @@ -65,8 +65,10 @@ "config": { "sort-packages": true, "allow-plugins": { - "phpstan/extension-installer": true, "dealerdirect/phpcodesniffer-composer-installer": true, + "php-http/discovery": true, + "phpro/grumphp": true, + "phpstan/extension-installer": true, "symfony/flex": true, "symfony/thanks": true } diff --git a/grumphp.yml b/grumphp.yml new file mode 100644 index 00000000..1ae601d8 --- /dev/null +++ b/grumphp.yml @@ -0,0 +1,32 @@ +grumphp: + ascii: + failed: ~ + succeeded: ~ + tasks: + composer: + no_check_all: true + jsonlint: + detect_key_conflicts: true + phplint: + exclude: ['vendor', 'tests/Application/*'] + triggered_by: ['php'] + phpstan: + level: ~ + configuration: 'ruleset/phpstan.neon' + use_grumphp_paths: false + securitychecker_symfony: ~ + yamllint: + parse_custom_tags: true + ecs: + config: 'ruleset/ecs.php' + no-progress-bar: true + twigcs: + path: 'src/' + severity: error + phpcs: + standard: "ruleset" + warning_severity: 0 + whitelist_patterns: + - 'src' + exclude: + - 'PSR12.Files.FileHeader' \ No newline at end of file diff --git a/rulesets/.php_md.xml b/ruleset/.php_md.xml similarity index 100% rename from rulesets/.php_md.xml rename to ruleset/.php_md.xml diff --git a/ruleset/ecs.php b/ruleset/ecs.php new file mode 100644 index 00000000..6c43f8fa --- /dev/null +++ b/ruleset/ecs.php @@ -0,0 +1,19 @@ +import(dirname(__DIR__) . '/vendor/sylius-labs/coding-standard/ecs.php'); + + $ecsConfig->paths([ + dirname(__DIR__, 1) . '/src', + dirname(__DIR__, 1) . '/tests/Behat', + dirname(__DIR__, 1) . '/tests/PHPUnit', + dirname(__DIR__, 1) . '/spec', + ]); + + /** @phpstan-ignore-next-line */ + $ecsConfig->rule(\SlevomatCodingStandard\Sniffs\Classes\RequireMultiLineMethodSignatureSniff::class); +}; \ No newline at end of file diff --git a/ruleset/phpstan-baseline.neon b/ruleset/phpstan-baseline.neon new file mode 100644 index 00000000..8563556e --- /dev/null +++ b/ruleset/phpstan-baseline.neon @@ -0,0 +1,1453 @@ +parameters: + ignoreErrors: + - + message: '#^Cannot call method add\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: ../src/Action/Admin/CompleteRefundPaymentAction.php + + - + message: '#^Parameter \#1 \$id of class Sylius\\RefundPlugin\\Event\\RefundPaymentGenerated constructor expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Action/Admin/CompleteRefundPaymentAction.php + + - + message: '#^Parameter \#5 \$paymentMethodId of class Sylius\\RefundPlugin\\Event\\RefundPaymentGenerated constructor expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Action/Admin/CompleteRefundPaymentAction.php + + - + message: '#^Cannot call method add\(\) on mixed\.$#' + identifier: method.nonObject + count: 3 + path: ../src/Action/Admin/RefundUnitsAction.php + + - + message: '#^Cannot access offset ''billing'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 2 + path: ../src/Action/CaptureAction.php + + - + message: '#^Cannot access offset ''can_save_cards'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Action/CaptureAction.php + + - + message: '#^Cannot access offset ''cancel_url'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 2 + path: ../src/Action/CaptureAction.php + + - + message: '#^Cannot access offset ''postcode'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 6 + path: ../src/Action/CaptureAction.php + + - + message: '#^Cannot access offset ''shipping'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 2 + path: ../src/Action/CaptureAction.php + + - + message: '#^Cannot access property \$payment_url on mixed\.$#' + identifier: property.nonObject + count: 2 + path: ../src/Action/CaptureAction.php + + - + message: '#^Cannot call method add\(\) on mixed\.$#' + identifier: method.nonObject + count: 6 + path: ../src/Action/CaptureAction.php + + - + message: '#^Cannot call method getFirstModel\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Action/CaptureAction.php + + - + message: '#^Cannot call method getModel\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Action/CaptureAction.php + + - + message: '#^Cannot call method getToken\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Action/CaptureAction.php + + - + message: '#^Parameter \#1 \$timestamp of method DateTimeImmutable\:\:setTimestamp\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Action/CaptureAction.php + + - + message: '#^Parameter \#1 \$url of class Payum\\Core\\Reply\\HttpRedirect constructor expects string, mixed given\.$#' + identifier: argument.type + count: 3 + path: ../src/Action/CaptureAction.php + + - + message: '#^Cannot call method getSource\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Action/ConvertPaymentAction.php + + - + message: '#^Cannot call method setResult\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Action/ConvertPaymentAction.php + + - + message: '#^Cannot call method getFirstModel\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: ../src/Action/NotifyAction.php + + - + message: '#^Cannot call method getModel\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Action/NotifyAction.php + + - + message: '#^Parameter \#1 \$payment of method PayPlug\\SyliusPayPlugPlugin\\Handler\\PaymentNotificationHandler\:\:treat\(\) expects Sylius\\Component\\Core\\Model\\PaymentInterface, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Action/NotifyAction.php + + - + message: '#^Parameter \#1 \$payment of method PayPlug\\SyliusPayPlugPlugin\\Handler\\RefundNotificationHandler\:\:treat\(\) expects Sylius\\Component\\Core\\Model\\PaymentInterface, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Action/NotifyAction.php + + - + message: '#^Access to an undefined property PayPlug\\SyliusPayPlugPlugin\\Action\\StatusAction\:\:\$stateMachineFactory\.$#' + identifier: property.notFound + count: 2 + path: ../src/Action/StatusAction.php + + - + message: '#^Cannot call method add\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Action/StatusAction.php + + - + message: '#^Cannot call method apply\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Action/StatusAction.php + + - + message: '#^Cannot call method can\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Action/StatusAction.php + + - + message: '#^Cannot call method get\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: ../src/Action/StatusAction.php + + - + message: '#^Cannot call method getFirstModel\(\) on mixed\.$#' + identifier: method.nonObject + count: 3 + path: ../src/Action/StatusAction.php + + - + message: '#^Cannot call method getModel\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: ../src/Action/StatusAction.php + + - + message: '#^Cannot call method markNew\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Action/StatusAction.php + + - + message: '#^Parameter \#1 \$payment of method PayPlug\\SyliusPayPlugPlugin\\Handler\\PaymentNotificationHandler\:\:treat\(\) expects Sylius\\Component\\Core\\Model\\PaymentInterface, mixed given\.$#' + identifier: argument.type + count: 3 + path: ../src/Action/StatusAction.php + + - + message: '#^Parameter \#1 \$payment of method PayPlug\\SyliusPayPlugPlugin\\PaymentProcessing\\RefundPaymentHandlerInterface\:\:updatePaymentStatus\(\) expects Sylius\\Component\\Core\\Model\\PaymentInterface, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Action/StatusAction.php + + - + message: '#^Parameter \#1 \$paymentId of method PayPlug\\SyliusPayPlugPlugin\\ApiClient\\PayPlugApiClientInterface\:\:retrieve\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 3 + path: ../src/Action/StatusAction.php + + - + message: '#^Parameter \#1 \$status of method PayPlug\\SyliusPayPlugPlugin\\Action\\StatusAction\:\:markRequestAs\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Action/StatusAction.php + + - + message: '#^Parameter \#2 \$request of method PayPlug\\SyliusPayPlugPlugin\\Action\\StatusAction\:\:markRequestAs\(\) expects Payum\\Core\\Request\\GetStatusInterface, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Action/StatusAction.php + + - + message: '#^Access to constant VERSION on an unknown class Sylius\\Bundle\\CoreBundle\\Application\\Kernel\.$#' + identifier: class.notFound + count: 2 + path: ../src/ApiClient/PayPlugApiClient.php + + - + message: '#^Anonymous function should return array but returns mixed\.$#' + identifier: return.type + count: 1 + path: ../src/ApiClient/PayPlugApiClient.php + + - + message: '#^Binary operation "\." between ''Sylius/'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: ../src/ApiClient/PayPlugApiClient.php + + - + message: '#^PHPDoc tag @var with type Payplug\\Resource\\Refund\|null is not subtype of type Payplug\\Refund\|null\.$#' + identifier: varTag.type + count: 2 + path: ../src/ApiClient/PayPlugApiClient.php + + - + message: '#^PHPDoc tag @var with type Payum\\Core\\Model\\GatewayConfig\|null is not subtype of type Sylius\\Resource\\Model\\ResourceInterface\|null\.$#' + identifier: varTag.type + count: 1 + path: ../src/ApiClient/PayPlugApiClientFactory.php + + - + message: '#^Parameter \#1 \$secretKey of class PayPlug\\SyliusPayPlugPlugin\\ApiClient\\PayPlugApiClient constructor expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: ../src/ApiClient/PayPlugApiClientFactory.php + + - + message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#' + identifier: foreach.nonIterable + count: 1 + path: ../src/Checker/CanSavePayplugPaymentMethodChecker.php + + - + message: '#^Cannot access offset ''enabled'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Checker/CanSavePayplugPaymentMethodChecker.php + + - + message: '#^Cannot call method getHostname\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Checker/CanSavePayplugPaymentMethodChecker.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Checker\\CanSavePayplugPaymentMethodChecker\:\:isEnabled\(\) should return bool but returns mixed\.$#' + identifier: return.type + count: 1 + path: ../src/Checker/CanSavePayplugPaymentMethodChecker.php + + - + message: '#^Parameter \#1 \$method of method PayPlug\\SyliusPayPlugPlugin\\Checker\\CanSavePayplugPaymentMethodChecker\:\:isAllowedDomainNames\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Checker/CanSavePayplugPaymentMethodChecker.php + + - + message: '#^Parameter \#2 \$haystack of function in_array expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Checker/CanSavePayplugPaymentMethodChecker.php + + - + message: '#^Cannot access offset ''allowed_countries'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Checker/OneyChecker.php + + - + message: '#^Cannot access offset ''max_amounts'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Checker/OneyChecker.php + + - + message: '#^Cannot access offset ''min_amounts'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Checker/OneyChecker.php + + - + message: '#^Cannot access offset ''oney'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 3 + path: ../src/Checker/OneyChecker.php + + - + message: '#^Cannot access offset string on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 2 + path: ../src/Checker/OneyChecker.php + + - + message: '#^Parameter \#2 \$haystack of function in_array expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Checker/OneyChecker.php + + - + message: '#^Cannot call method apply\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Command/CaptureAuthorizedPaymentCommand.php + + - + message: '#^Cannot call method get\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Command/CaptureAuthorizedPaymentCommand.php + + - + message: '#^Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Command/CaptureAuthorizedPaymentCommand.php + + - + message: '#^Property PayPlug\\SyliusPayPlugPlugin\\Command\\CaptureAuthorizedPaymentCommand\:\:\$stateMachineFactory has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../src/Command/CaptureAuthorizedPaymentCommand.php + + - + message: '#^Cannot call method add\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: ../src/Controller/CardController.php + + - + message: '#^Parameter \#2 \$type of method Symfony\\Component\\Form\\FormBuilderInterface\:\:add\(\) expects string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Controller/CompleteInfoController.php + + - + message: '#^PHPDoc tag @param for parameter \$paymentMethodRepository contains generic type Sylius\\Component\\Resource\\Repository\\RepositoryInterface\ but interface Sylius\\Component\\Resource\\Repository\\RepositoryInterface is not generic\.$#' + identifier: generics.notGeneric + count: 1 + path: ../src/Controller/IntegratedPaymentController.php + + - + message: '#^PHPDoc type for property PayPlug\\SyliusPayPlugPlugin\\Controller\\IntegratedPaymentController\:\:\$paymentMethodRepository contains generic type Sylius\\Component\\Resource\\Repository\\RepositoryInterface\ but interface Sylius\\Component\\Resource\\Repository\\RepositoryInterface is not generic\.$#' + identifier: generics.notGeneric + count: 1 + path: ../src/Controller/IntegratedPaymentController.php + + - + message: '#^Call to function is_string\(\) with string will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 1 + path: ../src/Controller/IpnAction.php + + - + message: '#^Parameter \#1 \$payplugPaymentId of method PayPlug\\SyliusPayPlugPlugin\\Repository\\PaymentRepositoryInterface\:\:findOneByPayPlugPaymentId\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Controller/IpnAction.php + + - + message: '#^Parameter \#1 \$secretKey of method PayPlug\\SyliusPayPlugPlugin\\ApiClient\\PayPlugApiClientInterface\:\:initialise\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Controller/IpnAction.php + + - + message: '#^Parameter \#2 \$key of method PayPlug\\SyliusPayPlugPlugin\\ApiClient\\PayPlugApiClientFactoryInterface\:\:create\(\) expects string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Controller/IpnAction.php + + - + message: '#^Cannot access offset ''payment_url'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Controller/OneClickAction.php + + - + message: '#^Cannot access offset ''return_url'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Controller/OneClickAction.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 1 + path: ../src/Controller/OneClickAction.php + + - + message: '#^PHPDoc tag @var with type Payum\\Core\\Model\\GatewayConfigInterface is not subtype of type Sylius\\Component\\Payment\\Model\\GatewayConfigInterface\|null\.$#' + identifier: varTag.type + count: 1 + path: ../src/Controller/OneClickAction.php + + - + message: '#^Parameter \#1 \$url of class Symfony\\Component\\HttpFoundation\\RedirectResponse constructor expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Controller/OneClickAction.php + + - + message: '#^Parameter \#2 \$key of method PayPlug\\SyliusPayPlugPlugin\\ApiClient\\PayPlugApiClientFactory\:\:create\(\) expects string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Controller/OneClickAction.php + + - + message: '#^Cannot cast mixed to int\.$#' + identifier: cast.int + count: 1 + path: ../src/Controller/OneyIsProductEligible.php + + - + message: '#^PHPDoc tag @var with type int\|null is not subtype of native type int\.$#' + identifier: varTag.nativeType + count: 1 + path: ../src/Controller/OneyIsProductEligible.php + + - + message: '#^Parameter \#2 \$productVariantCode of method PayPlug\\SyliusPayPlugPlugin\\Controller\\OneyIsProductEligible\:\:isProductEligible\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Controller/OneyIsProductEligible.php + + - + message: '#^Cannot cast mixed to int\.$#' + identifier: cast.int + count: 1 + path: ../src/Controller/OneySimulationPopin.php + + - + message: '#^PHPDoc tag @var with type int\|null is not subtype of native type int\.$#' + identifier: varTag.nativeType + count: 1 + path: ../src/Controller/OneySimulationPopin.php + + - + message: '#^Binary operation "\." between ''apple_pay_cancel'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: ../src/Controller/OrderController.php + + - + message: '#^Cannot call method add\(\) on mixed\.$#' + identifier: method.nonObject + count: 4 + path: ../src/Controller/OrderController.php + + - + message: '#^Cannot call method apply\(\) on mixed\.$#' + identifier: method.nonObject + count: 3 + path: ../src/Controller/OrderController.php + + - + message: '#^Cannot call method can\(\) on mixed\.$#' + identifier: method.nonObject + count: 3 + path: ../src/Controller/OrderController.php + + - + message: '#^Cannot call method get\(\) on mixed\.$#' + identifier: method.nonObject + count: 3 + path: ../src/Controller/OrderController.php + + - + message: '#^Property PayPlug\\SyliusPayPlugPlugin\\Controller\\OrderController\:\:\$stateMachineFactory has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../src/Controller/OrderController.php + + - + message: '#^Cannot access offset ''company_name'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 2 + path: ../src/Creator/PayPlugPaymentDataCreator.php + + - + message: '#^Cannot access offset ''first_name'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 2 + path: ../src/Creator/PayPlugPaymentDataCreator.php + + - + message: '#^Cannot access offset ''last_name'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 2 + path: ../src/Creator/PayPlugPaymentDataCreator.php + + - + message: '#^PHPDoc tag @SuppressWarnings has invalid value \(\(PHPMD\.UnusedFormalParameter\)\)\: Unexpected token "\.UnusedFormalParameter\)", expected ''\)'' at offset 34 on line 2$#' + identifier: phpDoc.parseError + count: 1 + path: ../src/Creator/PayPlugPaymentDataCreator.php + + - + message: '#^Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#' + identifier: argument.type + count: 2 + path: ../src/Creator/PayPlugPaymentDataCreator.php + + - + message: '#^Parameter \#3 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#' + identifier: argument.type + count: 2 + path: ../src/Creator/PayPlugPaymentDataCreator.php + + - + message: '#^Parameter &\$landingPhone by\-ref type of method PayPlug\\SyliusPayPlugPlugin\\Creator\\PayPlugPaymentDataCreator\:\:loadPhoneNumbers\(\) expects string\|null, mixed given\.$#' + identifier: parameterByRef.type + count: 1 + path: ../src/Creator/PayPlugPaymentDataCreator.php + + - + message: '#^Parameter &\$mobilePhone by\-ref type of method PayPlug\\SyliusPayPlugPlugin\\Creator\\PayPlugPaymentDataCreator\:\:loadPhoneNumbers\(\) expects string\|null, mixed given\.$#' + identifier: parameterByRef.type + count: 1 + path: ../src/Creator/PayPlugPaymentDataCreator.php + + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 1 + path: ../src/Creator/PayPlugPaymentDataCreator.php + + - + message: '#^PHPDoc tag @var with type Payum\\Core\\Model\\GatewayConfigInterface is not subtype of type Sylius\\Component\\Payment\\Model\\GatewayConfigInterface\|null\.$#' + identifier: varTag.type + count: 1 + path: ../src/Creator/RefundUnitsCommandCreatorDecorator.php + + - + message: '#^Parameter \#1 \$paymentId of method PayPlug\\SyliusPayPlugPlugin\\ApiClient\\PayPlugApiClientInterface\:\:retrieve\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Creator/RefundUnitsCommandCreatorDecorator.php + + - + message: '#^Parameter \#1 \$unit of method PayPlug\\SyliusPayPlugPlugin\\Creator\\RefundUnitsCommandCreatorDecorator\:\:getAmount\(\) expects Sylius\\RefundPlugin\\Model\\UnitRefundInterface, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Creator/RefundUnitsCommandCreatorDecorator.php + + - + message: '#^Parameter \#1 \$units of method Sylius\\RefundPlugin\\Converter\\RefundUnitsConverterInterface\:\:convert\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 2 + path: ../src/Creator/RefundUnitsCommandCreatorDecorator.php + + - + message: '#^Property PayPlug\\SyliusPayPlugPlugin\\Entity\\RefundHistory\:\:\$value type mapping mismatch\: database can contain int\|null but property expects int\.$#' + identifier: doctrine.columnType + count: 1 + path: ../src/Entity/RefundHistory.php + + - + message: '#^Trait PayPlug\\SyliusPayPlugPlugin\\Entity\\Traits\\CustomerTrait is used zero times and is not analysed\.$#' + identifier: trait.unused + count: 1 + path: ../src/Entity/Traits/CustomerTrait.php + + - + message: '#^Trait PayPlug\\SyliusPayPlugPlugin\\Entity\\Traits\\PaymentMethodTrait is used zero times and is not analysed\.$#' + identifier: trait.unused + count: 1 + path: ../src/Entity/Traits/PaymentMethodTrait.php + + - + message: '#^Trait PayPlug\\SyliusPayPlugPlugin\\Entity\\Traits\\PaymentTrait is used zero times and is not analysed\.$#' + identifier: trait.unused + count: 1 + path: ../src/Entity/Traits/PaymentTrait.php + + - + message: '#^Cannot call method add\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/EventSubscriber/DisplayOneyGatewayFormEventSubscriber.php + + - + message: '#^Cannot call method apply\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/EventSubscriber/PostPaymentSelectEventSubscriber.php + + - + message: '#^Cannot call method can\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/EventSubscriber/PostPaymentSelectEventSubscriber.php + + - + message: '#^Cannot call method get\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/EventSubscriber/PostPaymentSelectEventSubscriber.php + + - + message: '#^Property PayPlug\\SyliusPayPlugPlugin\\EventSubscriber\\PostPaymentSelectEventSubscriber\:\:\$stateMachineFactory has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../src/EventSubscriber/PostPaymentSelectEventSubscriber.php + + - + message: '#^Parameter \#1 \$input of method Payum\\Core\\Bridge\\Spl\\ArrayObject\:\:defaults\(\) expects array\|Traversable, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Gateway/AbstractGatewayFactory.php + + - + message: '#^Parameter \#1 \$required of method Payum\\Core\\Bridge\\Spl\\ArrayObject\:\:validateNotEmpty\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Gateway/AbstractGatewayFactory.php + + - + message: '#^Parameter \#1 \$secretKey of class PayPlug\\SyliusPayPlugPlugin\\ApiClient\\PayPlugApiClient constructor expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Gateway/AbstractGatewayFactory.php + + - + message: '#^Parameter \#2 \$factoryName of class PayPlug\\SyliusPayPlugPlugin\\ApiClient\\PayPlugApiClient constructor expects string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Gateway/AbstractGatewayFactory.php + + - + message: '#^Cannot call method add\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Gateway/Form/Type/AbstractGatewayConfigurationType.php + + - + message: '#^Cannot call method getId\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Gateway/Form/Type/AbstractGatewayConfigurationType.php + + - + message: '#^Cannot access offset ''secretKey'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Gateway/Validator/Constraints/IsCanSaveCardsValidator.php + + - + message: '#^Cannot call method getConfig\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Gateway/Validator/Constraints/IsCanSaveCardsValidator.php + + - + message: '#^Cannot call method getData\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Gateway/Validator/Constraints/IsCanSaveCardsValidator.php + + - + message: '#^Cannot call method getGatewayConfig\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Gateway/Validator/Constraints/IsCanSaveCardsValidator.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Gateway\\Validator\\Constraints\\IsCanSaveCardsValidator\:\:validate\(\) has parameter \$value with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: ../src/Gateway/Validator/Constraints/IsCanSaveCardsValidator.php + + - + message: '#^Parameter \#2 \$key of method PayPlug\\SyliusPayPlugPlugin\\ApiClient\\PayPlugApiClientFactory\:\:create\(\) expects string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Gateway/Validator/Constraints/IsCanSaveCardsValidator.php + + - + message: '#^Cannot call method getChannels\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Gateway/Validator/Constraints/IsCanSavePaymentMethodValidator.php + + - + message: '#^Cannot call method getData\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: ../src/Gateway/Validator/Constraints/IsCanSavePaymentMethodValidator.php + + - + message: '#^Cannot call method getFactoryName\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Gateway/Validator/Constraints/IsCanSavePaymentMethodValidator.php + + - + message: '#^Cannot call method getGatewayConfig\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Gateway/Validator/Constraints/IsCanSavePaymentMethodValidator.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Gateway\\Validator\\Constraints\\IsCanSavePaymentMethodValidator\:\:validate\(\) has parameter \$value with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: ../src/Gateway/Validator/Constraints/IsCanSavePaymentMethodValidator.php + + - + message: '#^Parameter \#2 \$channels of method PayPlug\\SyliusPayPlugPlugin\\Checker\\CanSavePayplugPaymentMethodChecker\:\:isEnabled\(\) expects Doctrine\\Common\\Collections\\Collection, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Gateway/Validator/Constraints/IsCanSavePaymentMethodValidator.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Gateway\\Validator\\Constraints\\IsOneyEnabledValidator\:\:validate\(\) has parameter \$value with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: ../src/Gateway/Validator/Constraints/IsOneyEnabledValidator.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Gateway\\Validator\\Constraints\\IsPayPlugSecretKeyValidator\:\:validate\(\) has parameter \$value with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: ../src/Gateway/Validator/Constraints/IsPayPlugSecretKeyValidator.php + + - + message: '#^Cannot access offset ''secretKey'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Gateway/Validator/Constraints/PayplugPermissionValidator.php + + - + message: '#^Cannot call method getConfig\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Gateway/Validator/Constraints/PayplugPermissionValidator.php + + - + message: '#^Cannot call method getData\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Gateway/Validator/Constraints/PayplugPermissionValidator.php + + - + message: '#^Cannot call method getGatewayConfig\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Gateway/Validator/Constraints/PayplugPermissionValidator.php + + - + message: '#^Parameter \#2 \$key of method PayPlug\\SyliusPayPlugPlugin\\ApiClient\\PayPlugApiClientFactory\:\:create\(\) expects string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Gateway/Validator/Constraints/PayplugPermissionValidator.php + + - + message: '#^Binary operation "\." between ''payment_'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Cannot access offset ''customer_id'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Cannot access property \$brand on mixed\.$#' + identifier: property.nonObject + count: 1 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Cannot access property \$code on mixed\.$#' + identifier: property.nonObject + count: 2 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Cannot access property \$country on mixed\.$#' + identifier: property.nonObject + count: 1 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Cannot access property \$exp_month on mixed\.$#' + identifier: property.nonObject + count: 1 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Cannot access property \$exp_year on mixed\.$#' + identifier: property.nonObject + count: 1 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Cannot access property \$id on mixed\.$#' + identifier: property.nonObject + count: 4 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Cannot access property \$last4 on mixed\.$#' + identifier: property.nonObject + count: 1 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Cannot access property \$message on mixed\.$#' + identifier: property.nonObject + count: 2 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Cannot call method add\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Parameter \#1 \$brand of method PayPlug\\SyliusPayPlugPlugin\\Entity\\Card\:\:setBrand\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Parameter \#1 \$countryCode of method PayPlug\\SyliusPayPlugPlugin\\Entity\\Card\:\:setCountryCode\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Parameter \#1 \$expirationMonth of method PayPlug\\SyliusPayPlugPlugin\\Entity\\Card\:\:setExpirationMonth\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Parameter \#1 \$expirationYear of method PayPlug\\SyliusPayPlugPlugin\\Entity\\Card\:\:setExpirationYear\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Parameter \#1 \$externalId of method PayPlug\\SyliusPayPlugPlugin\\Entity\\Card\:\:setExternalId\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Parameter \#1 \$isLive of method PayPlug\\SyliusPayPlugPlugin\\Entity\\Card\:\:setIsLive\(\) expects bool, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Parameter \#1 \$last4 of method PayPlug\\SyliusPayPlugPlugin\\Entity\\Card\:\:setLast4\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Parameter \#1 \$timestamp of method DateTimeImmutable\:\:setTimestamp\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Parameter \#2 \$array of function array_key_exists expects array, mixed given\.$#' + identifier: argument.type + count: 2 + path: ../src/Handler/PaymentNotificationHandler.php + + - + message: '#^Cannot access offset ''refund_from_sylius'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Handler/RefundNotificationHandler.php + + - + message: '#^Parameter \#1 \$externalId of method PayPlug\\SyliusPayPlugPlugin\\Entity\\RefundHistory\:\:setExternalId\(\) expects string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Handler/RefundNotificationHandler.php + + - + message: '#^Parameter \#1 \$value of method PayPlug\\SyliusPayPlugPlugin\\Entity\\RefundHistory\:\:setValue\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Handler/RefundNotificationHandler.php + + - + message: '#^Call to static method Webmozart\\Assert\\Assert\:\:isInstanceOf\(\) with DateTimeInterface and ''DateTimeInterface'' will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 1 + path: ../src/MessageHandler/RefundPaymentGeneratedHandler.php + + - + message: '#^Cannot call method add\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/MessageHandler/RefundPaymentGeneratedHandler.php + + - + message: '#^Cannot call method apply\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: ../src/MessageHandler/RefundPaymentGeneratedHandler.php + + - + message: '#^Cannot call method get\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: ../src/MessageHandler/RefundPaymentGeneratedHandler.php + + - + message: '#^Property PayPlug\\SyliusPayPlugPlugin\\MessageHandler\\RefundPaymentGeneratedHandler\:\:\$stateMachineFactory has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../src/MessageHandler/RefundPaymentGeneratedHandler.php + + - + message: '#^Parameter \#1 \$paymentId of method PayPlug\\SyliusPayPlugPlugin\\ApiClient\\PayPlugApiClientInterface\:\:abortPayment\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/PaymentProcessing/AbortPaymentProcessor.php + + - + message: '#^Binary operation "\-\=" between float\|int and mixed results in an error\.$#' + identifier: assignOp.invalid + count: 2 + path: ../src/PaymentProcessing/RefundPaymentHandler.php + + - + message: '#^Cannot cast mixed to float\.$#' + identifier: cast.double + count: 1 + path: ../src/PaymentProcessing/RefundPaymentHandler.php + + - + message: '#^Class Sylius\\RefundPlugin\\Command\\RefundUnits constructor invoked with 5 parameters, 4 required\.$#' + identifier: arguments.count + count: 1 + path: ../src/PaymentProcessing/RefundPaymentHandler.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\PaymentProcessing\\RefundPaymentHandler\:\:parseIdsToUnitRefunds\(\) should return array\ but returns list\\.$#' + identifier: return.type + count: 1 + path: ../src/PaymentProcessing/RefundPaymentHandler.php + + - + message: '#^PHPDoc tag @var with type Sylius\\Component\\Core\\Model\\ShipmentInterface is not subtype of type Sylius\\Component\\Order\\Model\\AdjustmentInterface\.$#' + identifier: varTag.type + count: 1 + path: ../src/PaymentProcessing/RefundPaymentHandler.php + + - + message: '#^Parameter \#1 \$id of method Sylius\\RefundPlugin\\Provider\\RemainingTotalProviderInterface\:\:getTotalLeftToRefund\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 2 + path: ../src/PaymentProcessing/RefundPaymentHandler.php + + - + message: '#^Parameter \#1 \$unit of method PayPlug\\SyliusPayPlugPlugin\\PaymentProcessing\\RefundPaymentHandler\:\:getAmount\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/PaymentProcessing/RefundPaymentHandler.php + + - + message: '#^Parameter \#1 \$units of method PayPlug\\SyliusPayPlugPlugin\\PaymentProcessing\\RefundPaymentHandler\:\:parseIdsToUnitRefunds\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 2 + path: ../src/PaymentProcessing/RefundPaymentHandler.php + + - + message: '#^Parameter \#1 \$value of function count expects array\|Countable, mixed given\.$#' + identifier: argument.type + count: 2 + path: ../src/PaymentProcessing/RefundPaymentHandler.php + + - + message: '#^Parameter \#3 \$amount of method PayPlug\\SyliusPayPlugPlugin\\PaymentProcessing\\RefundPaymentHandler\:\:addItem\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 2 + path: ../src/PaymentProcessing/RefundPaymentHandler.php + + - + message: '#^Parameter \#3 \$amount of method PayPlug\\SyliusPayPlugPlugin\\PaymentProcessing\\RefundPaymentHandler\:\:dispatchRefundPrice\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/PaymentProcessing/RefundPaymentHandler.php + + - + message: '#^Parameter \#3 \$paymentMethodId of class Sylius\\RefundPlugin\\Command\\RefundUnits constructor expects int, array\ given\.$#' + identifier: argument.type + count: 1 + path: ../src/PaymentProcessing/RefundPaymentHandler.php + + - + message: '#^Parameter \#4 \$comment of class Sylius\\RefundPlugin\\Command\\RefundUnits constructor expects int\|string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/PaymentProcessing/RefundPaymentHandler.php + + - + message: '#^Cannot access an offset on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/PaymentProcessing/RefundPaymentProcessor.php + + - + message: '#^Cannot access property \$amount on mixed\.$#' + identifier: property.nonObject + count: 1 + path: ../src/PaymentProcessing/RefundPaymentProcessor.php + + - + message: '#^Cannot access property \$id on mixed\.$#' + identifier: property.nonObject + count: 1 + path: ../src/PaymentProcessing/RefundPaymentProcessor.php + + - + message: '#^Cannot access property \$metadata on mixed\.$#' + identifier: property.nonObject + count: 1 + path: ../src/PaymentProcessing/RefundPaymentProcessor.php + + - + message: '#^Cannot call method add\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/PaymentProcessing/RefundPaymentProcessor.php + + - + message: '#^Cannot call method refundPayment\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/PaymentProcessing/RefundPaymentProcessor.php + + - + message: '#^Cannot call method refundPaymentWithAmount\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/PaymentProcessing/RefundPaymentProcessor.php + + - + message: '#^Parameter \#1 \$secretKey of method PayPlug\\SyliusPayPlugPlugin\\ApiClient\\PayPlugApiClientInterface\:\:initialise\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/PaymentProcessing/RefundPaymentProcessor.php + + - + message: '#^Parameter \#2 \$key of method PayPlug\\SyliusPayPlugPlugin\\ApiClient\\PayPlugApiClientFactoryInterface\:\:create\(\) expects string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/PaymentProcessing/RefundPaymentProcessor.php + + - + message: '#^Property PayPlug\\SyliusPayPlugPlugin\\PaymentProcessing\\RefundPaymentProcessor\:\:\$payPlugApiClient has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../src/PaymentProcessing/RefundPaymentProcessor.php + + - + message: '#^Cannot call method apply\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Processor/OrderPaymentProcessor.php + + - + message: '#^Cannot call method get\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Processor/OrderPaymentProcessor.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Processor\\OrderPaymentProcessor\:\:getFactoryName\(\) should return string but returns string\|null\.$#' + identifier: return.type + count: 1 + path: ../src/Processor/OrderPaymentProcessor.php + + - + message: '#^Property PayPlug\\SyliusPayPlugPlugin\\Processor\\OrderPaymentProcessor\:\:\$stateMachineFactory has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../src/Processor/OrderPaymentProcessor.php + + - + message: '#^Call to an undefined method Sylius\\RefundPlugin\\Provider\\RefundPaymentMethodsProviderInterface\:\:findForChannel\(\)\.$#' + identifier: method.notFound + count: 2 + path: ../src/Provider/AbstractSupportedRefundPaymentMethodsProvider.php + + - + message: '#^Cannot call method getGatewayConfig\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Provider/AbstractSupportedRefundPaymentMethodsProvider.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Provider\\AbstractSupportedRefundPaymentMethodsProvider\:\:findForChannel\(\) should return array but returns mixed\.$#' + identifier: return.type + count: 3 + path: ../src/Provider/AbstractSupportedRefundPaymentMethodsProvider.php + + - + message: '#^Parameter \#1 \$paymentMethods of method PayPlug\\SyliusPayPlugPlugin\\Provider\\AbstractSupportedRefundPaymentMethodsProvider\:\:find\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 2 + path: ../src/Provider/AbstractSupportedRefundPaymentMethodsProvider.php + + - + message: '#^Parameter \#2 \$callback of function array_filter expects \(callable\(mixed\)\: bool\)\|null, Closure\(Sylius\\Component\\Core\\Model\\PaymentMethodInterface\)\: bool given\.$#' + identifier: argument.type + count: 1 + path: ../src/Provider/AbstractSupportedRefundPaymentMethodsProvider.php + + - + message: '#^Cannot cast mixed to int\.$#' + identifier: cast.int + count: 1 + path: ../src/Provider/ApplePayOrderProvider.php + + - + message: '#^Cannot access offset ''max_amounts'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Provider/OneySimulation/OneySimulationDataProvider.php + + - + message: '#^Cannot access offset ''min_amounts'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Provider/OneySimulation/OneySimulationDataProvider.php + + - + message: '#^Cannot access offset ''oney'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 2 + path: ../src/Provider/OneySimulation/OneySimulationDataProvider.php + + - + message: '#^Cannot access offset string\|null on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 2 + path: ../src/Provider/OneySimulation/OneySimulationDataProvider.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Provider\\OneySupportedPaymentChoiceProvider\:\:getFeesFor\(\) should return string but returns mixed\.$#' + identifier: return.type + count: 1 + path: ../src/Provider/OneySupportedPaymentChoiceProvider.php + + - + message: '#^PHPDoc tag @var with type Payum\\Core\\Model\\GatewayConfigInterface is not subtype of native type Sylius\\Component\\Payment\\Model\\GatewayConfigInterface\|null\.$#' + identifier: varTag.nativeType + count: 1 + path: ../src/Provider/OneySupportedPaymentChoiceProvider.php + + - + message: '#^Call to method apply\(\) on an unknown class SM\\StateMachine\\StateMachineInterface\.$#' + identifier: class.notFound + count: 3 + path: ../src/Provider/Payment/ApplePayPaymentProvider.php + + - + message: '#^Cannot access offset ''merchant_session'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Provider/Payment/ApplePayPaymentProvider.php + + - + message: '#^Cannot call method get\(\) on mixed\.$#' + identifier: method.nonObject + count: 3 + path: ../src/Provider/Payment/ApplePayPaymentProvider.php + + - + message: '#^PHPDoc tag @var for variable \$stateMachine contains unknown class SM\\StateMachine\\StateMachineInterface\.$#' + identifier: class.notFound + count: 3 + path: ../src/Provider/Payment/ApplePayPaymentProvider.php + + - + message: '#^Parameter \#1 \$customer of method Sylius\\Component\\Customer\\Model\\CustomerAwareInterface\:\:setCustomer\(\) expects Sylius\\Component\\Customer\\Model\\CustomerInterface\|null, true given\.$#' + identifier: argument.type + count: 1 + path: ../src/Provider/Payment/ApplePayPaymentProvider.php + + - + message: '#^Parameter \#1 \$paymentId of method PayPlug\\SyliusPayPlugPlugin\\ApiClient\\PayPlugApiClientInterface\:\:retrieve\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Provider/Payment/ApplePayPaymentProvider.php + + - + message: '#^Parameter \#1 \$timestamp of method DateTimeImmutable\:\:setTimestamp\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Provider/Payment/ApplePayPaymentProvider.php + + - + message: '#^Parameter \#2 \$array of function array_key_exists expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Provider/Payment/ApplePayPaymentProvider.php + + - + message: '#^Property PayPlug\\SyliusPayPlugPlugin\\Provider\\Payment\\ApplePayPaymentProvider\:\:\$stateMachineFactory has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../src/Provider/Payment/ApplePayPaymentProvider.php + + - + message: '#^PHPDoc tag @var with type Payum\\Core\\Model\\GatewayConfigInterface is not subtype of type Sylius\\Component\\Payment\\Model\\GatewayConfigInterface\|null\.$#' + identifier: varTag.type + count: 1 + path: ../src/Provider/PaymentTokenProvider.php + + - + message: '#^Cannot access offset ''max_amount'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Provider/SupportedMethodsProvider.php + + - + message: '#^Cannot access offset ''min_amount'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Provider/SupportedMethodsProvider.php + + - + message: '#^PHPDoc tag @var with type Payum\\Core\\Model\\GatewayConfigInterface is not subtype of native type Sylius\\Component\\Payment\\Model\\GatewayConfigInterface\|null\.$#' + identifier: varTag.nativeType + count: 1 + path: ../src/Provider/SupportedMethodsProvider.php + + - + message: '#^Cannot call method add\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Provider/SupportedRefundPaymentMethodsProviderDecorator.php + + - + message: '#^Cannot call method getGatewayConfig\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Provider/SupportedRefundPaymentMethodsProviderDecorator.php + + - + message: '#^Parameter \#2 \$callback of function array_filter expects \(callable\(mixed\)\: bool\)\|null, Closure\(Sylius\\Component\\Core\\Model\\PaymentMethodInterface\)\: bool given\.$#' + identifier: argument.type + count: 1 + path: ../src/Provider/SupportedRefundPaymentMethodsProviderDecorator.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Repository\\PaymentMethodRepository\:\:findOneByGatewayName\(\) should return Sylius\\Component\\Core\\Model\\PaymentMethodInterface\|null but returns mixed\.$#' + identifier: return.type + count: 1 + path: ../src/Repository/PaymentMethodRepository.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Repository\\PaymentRepository\:\:findAllActiveByGatewayFactoryName\(\) should return array but returns mixed\.$#' + identifier: return.type + count: 1 + path: ../src/Repository/PaymentRepository.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Repository\\PaymentRepository\:\:findAllAuthorizedOlderThanDays\(\) should return array\ but returns mixed\.$#' + identifier: return.type + count: 1 + path: ../src/Repository/PaymentRepository.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Repository\\PaymentRepository\:\:findOneByPayPlugPaymentId\(\) should return Sylius\\Component\\Core\\Model\\PaymentInterface but returns mixed\.$#' + identifier: return.type + count: 1 + path: ../src/Repository/PaymentRepository.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Repository\\RefundHistoryRepository\:\:findLastProcessedRefundForPayment\(\) should return PayPlug\\SyliusPayPlugPlugin\\Entity\\RefundHistory\|null but returns mixed\.$#' + identifier: return.type + count: 1 + path: ../src/Repository/RefundHistoryRepository.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Repository\\RefundHistoryRepository\:\:findLastRefundForPayment\(\) should return PayPlug\\SyliusPayPlugPlugin\\Entity\\RefundHistory\|null but returns mixed\.$#' + identifier: return.type + count: 1 + path: ../src/Repository/RefundHistoryRepository.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Resolver\\AmericanExpressPaymentMethodsResolverDecorator\:\:getSupportedMethods\(\) should return array\ but returns array\.$#' + identifier: return.type + count: 1 + path: ../src/Resolver/AmericanExpressPaymentMethodsResolverDecorator.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Resolver\\ApplePayPaymentMethodsResolverDecorator\:\:getSupportedMethods\(\) should return array\ but returns array\.$#' + identifier: return.type + count: 1 + path: ../src/Resolver/ApplePayPaymentMethodsResolverDecorator.php + + - + message: '#^PHPDoc tag @var with type Payum\\Core\\Model\\GatewayConfigInterface is not subtype of native type Sylius\\Component\\Payment\\Model\\GatewayConfigInterface\|null\.$#' + identifier: varTag.nativeType + count: 1 + path: ../src/Resolver/ApplePayPaymentMethodsResolverDecorator.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Resolver\\BancontactPaymentMethodsResolverDecorator\:\:getSupportedMethods\(\) should return array\ but returns array\.$#' + identifier: return.type + count: 1 + path: ../src/Resolver/BancontactPaymentMethodsResolverDecorator.php + + - + message: '#^PHPDoc tag @var with type Payum\\Core\\Model\\GatewayConfigInterface is not subtype of native type Sylius\\Component\\Payment\\Model\\GatewayConfigInterface\|null\.$#' + identifier: varTag.nativeType + count: 1 + path: ../src/Resolver/OneyPaymentMethodsResolverDecorator.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Resolver\\PayPlugPaymentMethodsResolverDecorator\:\:getSupportedMethods\(\) should return array\ but returns array\.$#' + identifier: return.type + count: 1 + path: ../src/Resolver/PayPlugPaymentMethodsResolverDecorator.php + + - + message: '#^Call to method apply\(\) on an unknown class SM\\StateMachine\\StateMachineInterface\.$#' + identifier: class.notFound + count: 1 + path: ../src/Resolver/PaymentStateResolver.php + + - + message: '#^Call to method can\(\) on an unknown class SM\\StateMachine\\StateMachineInterface\.$#' + identifier: class.notFound + count: 1 + path: ../src/Resolver/PaymentStateResolver.php + + - + message: '#^Cannot call method get\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: ../src/Resolver/PaymentStateResolver.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 1 + path: ../src/Resolver/PaymentStateResolver.php + + - + message: '#^Parameter \#1 \$paymentStateMachine of method PayPlug\\SyliusPayPlugPlugin\\Resolver\\PaymentStateResolver\:\:applyTransition\(\) expects SM\\StateMachine\\StateMachineInterface, mixed given\.$#' + identifier: argument.type + count: 4 + path: ../src/Resolver/PaymentStateResolver.php + + - + message: '#^Parameter \#1 \$secretKey of method PayPlug\\SyliusPayPlugPlugin\\ApiClient\\PayPlugApiClientInterface\:\:initialise\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Resolver/PaymentStateResolver.php + + - + message: '#^Parameter \#1 \$timestamp of method DateTimeImmutable\:\:setTimestamp\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: ../src/Resolver/PaymentStateResolver.php + + - + message: '#^Parameter \$paymentStateMachine of method PayPlug\\SyliusPayPlugPlugin\\Resolver\\PaymentStateResolver\:\:applyTransition\(\) has invalid type SM\\StateMachine\\StateMachineInterface\.$#' + identifier: class.notFound + count: 1 + path: ../src/Resolver/PaymentStateResolver.php + + - + message: '#^Property PayPlug\\SyliusPayPlugPlugin\\Resolver\\PaymentStateResolver\:\:\$stateMachineFactory has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../src/Resolver/PaymentStateResolver.php + + - + message: '#^Method PayPlug\\SyliusPayPlugPlugin\\Twig\\GetCurrentRouteExtension\:\:payplugGetCurrentRoute\(\) should return string but returns mixed\.$#' + identifier: return.type + count: 1 + path: ../src/Twig/GetCurrentRouteExtension.php + + - + message: '#^Cannot access offset ''max_amounts'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Twig/OneyRulesExtension.php + + - + message: '#^Cannot access offset ''min_amounts'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/Twig/OneyRulesExtension.php + + - + message: '#^Cannot access offset ''oney'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 2 + path: ../src/Twig/OneyRulesExtension.php + + - + message: '#^Cannot access offset string on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 2 + path: ../src/Twig/OneyRulesExtension.php + + - + message: '#^PHPDoc tag @var with type Sylius\\Component\\Core\\Model\\ProductVariantInterface\|null is not subtype of type Sylius\\Component\\Product\\Model\\ProductVariantInterface\|false\.$#' + identifier: varTag.type + count: 1 + path: ../src/Twig/OneyRulesExtension.php + + - + message: '#^Parameter \#1 \$amount of method Sylius\\Bundle\\MoneyBundle\\Formatter\\MoneyFormatterInterface\:\:format\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 2 + path: ../src/Twig/OneyRulesExtension.php + + - + message: '#^Parameter \#2 \$callback of function array_filter expects \(callable\(mixed\)\: bool\)\|null, Closure\(string\)\: bool given\.$#' + identifier: argument.type + count: 1 + path: ../src/Twig/OneySimulationExtension.php diff --git a/rulesets/phpstan.neon b/ruleset/phpstan.neon similarity index 64% rename from rulesets/phpstan.neon rename to ruleset/phpstan.neon index c7466a84..3feaeb71 100644 --- a/rulesets/phpstan.neon +++ b/ruleset/phpstan.neon @@ -4,25 +4,22 @@ includes: parameters: level: max reportUnmatchedIgnoredErrors: false - checkMissingIterableValueType: false - checkGenericClassInNonGenericObjectType: false + paths: + - ../src bootstrapFiles: - ../vendor/autoload.php excludePaths: # Makes PHPStan crash - - ../src/DependencyInjection/Configuration.php - - ../src/Repository/PaymentMethodRepository.php - - ../src/Migrations/ - - ../src/Entity/ - - ../tests/PHPUnit - - ../src/Manager/SettingsManager.php - - ../src/Form/Type/SettingsType.php + - ../src/DependencyInjection/ + - ../migrations # Test dependencies - - ../tests/Application + - ../tests/Application? - ../tests/PHPUnit - ../install ignoreErrors: + - identifier: missingType.iterableValue + - identifier: missingType.generics # ignore false positive - '#Access to an undefined property Payplug\\Resource\\[a-zA-Z0-9]+::\$#' - '#Call to static method getSimulations\(\) on an unknown class Payplug\\OneySimulation.#' diff --git a/ruleset/rector.php b/ruleset/rector.php new file mode 100644 index 00000000..c68c6f8f --- /dev/null +++ b/ruleset/rector.php @@ -0,0 +1,41 @@ +withPaths([ + \dirname(__DIR__) . '/src', + \dirname(__DIR__) . '/tests/PHPUnit', + ]) + ->withSkipPath( + \dirname(__DIR__) . '/src/Entity', + ) + ->withPHPStanConfigs([__DIR__ . '/phpstan.neon']) + ->withPhpSets(php82: true) + ->withAttributesSets(symfony: true, doctrine: true) + ->withPreparedSets( + deadCode: true, + codeQuality: true, + doctrineCodeQuality: true, + symfonyConfigs: true, + ) + ->withSkip([ + ReadOnlyPropertyRector::class, + ]) + ->withTypeCoverageLevel(0) + ->withSets([ + SymfonySetList::SYMFONY_60, + SymfonySetList::SYMFONY_61, + SymfonySetList::SYMFONY_62, + SymfonySetList::SYMFONY_63, + SymfonySetList::SYMFONY_64, + SymfonySetList::SYMFONY_71, + SymfonySetList::SYMFONY_72, + SetList::CODE_QUALITY, + SetList::DEAD_CODE, + ]); \ No newline at end of file diff --git a/ruleset/ruleset.xml b/ruleset/ruleset.xml new file mode 100644 index 00000000..95660985 --- /dev/null +++ b/ruleset/ruleset.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rulesets/ecs.php b/rulesets/ecs.php deleted file mode 100644 index b7d5fb1f..00000000 --- a/rulesets/ecs.php +++ /dev/null @@ -1,25 +0,0 @@ -import(dirname(__DIR__).'/vendor/sylius-labs/coding-standard/ecs.php'); - - $parameters = $containerConfigurator->parameters(); - $parameters->set(Option::PATHS, [ - dirname(__DIR__, 1).'/src', - dirname(__DIR__, 1).'/tests/Behat', - dirname(__DIR__, 1).'/tests/PHPUnit', - dirname(__DIR__, 1).'/spec', - ]); - $parameters->set(Option::SKIP, [ - __DIR__.'/tests/Application', - __DIR__.'/vendor', - ]); - - $containerConfigurator->import(SetList::SYMFONY); -}; diff --git a/rulesets/phpstan-baseline.neon b/rulesets/phpstan-baseline.neon deleted file mode 100644 index 409b325f..00000000 --- a/rulesets/phpstan-baseline.neon +++ /dev/null @@ -1,464 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Cannot access offset 'cancel_url' on mixed\\.$#" - count: 2 - path: ../src/Action/CaptureAction.php - - - - message: "#^Cannot access offset 'postcode' on mixed\\.$#" - count: 2 - path: ../src/Action/CaptureAction.php - - - - message: "#^Cannot call method getFirstModel\\(\\) on mixed\\.$#" - count: 1 - path: ../src/Action/CaptureAction.php - - - - message: "#^Cannot call method getModel\\(\\) on mixed\\.$#" - count: 1 - path: ../src/Action/CaptureAction.php - - - - message: "#^Cannot call method getToken\\(\\) on mixed\\.$#" - count: 1 - path: ../src/Action/CaptureAction.php - - - - message: "#^Cannot cast mixed to string\\.$#" - count: 1 - path: ../src/Action/CaptureAction.php - - - - message: "#^Parameter \\#1 \\$url of class Payum\\\\Core\\\\Reply\\\\HttpRedirect constructor expects string, mixed given\\.$#" - count: 2 - path: ../src/Action/CaptureAction.php - - - - message: "#^Cannot call method getSource\\(\\) on mixed\\.$#" - count: 1 - path: ../src/Action/ConvertPaymentAction.php - - - - message: "#^Cannot call method setResult\\(\\) on mixed\\.$#" - count: 1 - path: ../src/Action/ConvertPaymentAction.php - - - - message: "#^Cannot call method getFirstModel\\(\\) on mixed\\.$#" - count: 2 - path: ../src/Action/NotifyAction.php - - - - message: "#^Cannot call method getModel\\(\\) on mixed\\.$#" - count: 1 - path: ../src/Action/NotifyAction.php - - - - message: "#^Cannot call method getFirstModel\\(\\) on mixed\\.$#" - count: 3 - path: ../src/Action/StatusAction.php - - - - message: "#^Cannot call method getModel\\(\\) on mixed\\.$#" - count: 2 - path: ../src/Action/StatusAction.php - - - - message: "#^Cannot call method markNew\\(\\) on mixed\\.$#" - count: 1 - path: ../src/Action/StatusAction.php - - - - message: "#^Parameter \\#1 \\$payment of method PayPlug\\\\SyliusPayPlugPlugin\\\\PaymentProcessing\\\\RefundPaymentHandlerInterface\\:\\:updatePaymentStatus\\(\\) expects Sylius\\\\Component\\\\Core\\\\Model\\\\PaymentInterface, mixed given\\.$#" - count: 1 - path: ../src/Action/StatusAction.php - - - - message: "#^Parameter \\#1 \\$paymentId of method PayPlug\\\\SyliusPayPlugPlugin\\\\ApiClient\\\\PayPlugApiClientInterface\\:\\:retrieve\\(\\) expects string, mixed given\\.$#" - count: 3 - path: ../src/Action/StatusAction.php - - - - message: "#^Parameter \\#1 \\$status of method PayPlug\\\\SyliusPayPlugPlugin\\\\Action\\\\StatusAction\\:\\:markRequestAs\\(\\) expects string, mixed given\\.$#" - count: 1 - path: ../src/Action/StatusAction.php - - - - message: "#^Parameter \\#2 \\$request of method PayPlug\\\\SyliusPayPlugPlugin\\\\Action\\\\StatusAction\\:\\:markRequestAs\\(\\) expects Payum\\\\Core\\\\Request\\\\GetStatusInterface, mixed given\\.$#" - count: 1 - path: ../src/Action/StatusAction.php - - - - message: "#^Method PayPlug\\\\SyliusPayPlugPlugin\\\\ApiClient\\\\PayPlugApiClient\\:\\:getAccount\\(\\) should return array but returns mixed\\.$#" - count: 1 - path: ../src/ApiClient/PayPlugApiClient.php - - - - message: "#^Expression on left side of \\?\\? is not nullable\\.$#" - count: 1 - path: ../src/Checker/CanSaveCardChecker.php - - - - message: "#^Cannot call method getHostname\\(\\) on mixed\\.$#" - count: 1 - path: ../src/Checker/CanSavePayplugPaymentMethodChecker.php - - - - message: "#^Call to function is_string\\(\\) with string will always evaluate to true\\.$#" - count: 1 - path: ../src/Controller/IpnAction.php - - - - message: "#^Parameter \\#1 \\$payplugPaymentId of method PayPlug\\\\SyliusPayPlugPlugin\\\\Repository\\\\PaymentRepositoryInterface\\:\\:findOneByPayPlugPaymentId\\(\\) expects string, mixed given\\.$#" - count: 1 - path: ../src/Controller/IpnAction.php - - - - message: "#^Cannot cast mixed to int\\.$#" - count: 1 - path: ../src/Controller/OneyIsProductEligible.php - - - - message: "#^Parameter \\#2 \\$productVariantCode of method PayPlug\\\\SyliusPayPlugPlugin\\\\Controller\\\\OneyIsProductEligible\\:\\:isProductEligible\\(\\) expects string, mixed given\\.$#" - count: 1 - path: ../src/Controller/OneyIsProductEligible.php - - - - message: "#^Cannot cast mixed to int\\.$#" - count: 1 - path: ../src/Controller/OneySimulationPopin.php - - - - message: "#^Cannot access offset 'company_name' on mixed\\.$#" - count: 4 - path: ../src/Creator/PayPlugPaymentDataCreator.php - - - - message: "#^Cannot access offset 'first_name' on mixed\\.$#" - count: 2 - path: ../src/Creator/PayPlugPaymentDataCreator.php - - - - message: "#^Cannot access offset 'last_name' on mixed\\.$#" - count: 2 - path: ../src/Creator/PayPlugPaymentDataCreator.php - - - - message: "#^Cannot call method getProductName\\(\\) on mixed\\.$#" - count: 2 - path: ../src/Creator/PayPlugPaymentDataCreator.php - - - - message: "#^Cannot call method getQuantity\\(\\) on mixed\\.$#" - count: 1 - path: ../src/Creator/PayPlugPaymentDataCreator.php - - - - message: "#^Cannot call method getTotal\\(\\) on mixed\\.$#" - count: 1 - path: ../src/Creator/PayPlugPaymentDataCreator.php - - - - message: "#^Cannot call method getUnitPrice\\(\\) on mixed\\.$#" - count: 1 - path: ../src/Creator/PayPlugPaymentDataCreator.php - - - - message: "#^Cannot call method getVariant\\(\\) on mixed\\.$#" - count: 2 - path: ../src/Creator/PayPlugPaymentDataCreator.php - - - - message: "#^Cannot call method getVariantName\\(\\) on mixed\\.$#" - count: 1 - path: ../src/Creator/PayPlugPaymentDataCreator.php - - - - message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#" - count: 2 - path: ../src/Creator/PayPlugPaymentDataCreator.php - - - - message: "#^Parameter \\#3 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#" - count: 2 - path: ../src/Creator/PayPlugPaymentDataCreator.php - - - - message: "#^Right side of && is always true\\.$#" - count: 1 - path: ../src/Creator/PayPlugPaymentDataCreator.php - - - - message: "#^Parameter \\#1 \\$number of method Sylius\\\\Component\\\\Order\\\\Repository\\\\OrderRepositoryInterface\\:\\:findOneByNumber\\(\\) expects string, mixed given\\.$#" - count: 1 - path: ../src/Creator/RefundUnitsCommandCreatorDecorator.php - - - - message: "#^Parameter \\#1 \\$input of method Payum\\\\Core\\\\Bridge\\\\Spl\\\\ArrayObject\\:\\:defaults\\(\\) expects array\\|Traversable, mixed given\\.$#" - count: 1 - path: ../src/Gateway/AbstractGatewayFactory.php - - - - message: "#^Parameter \\#1 \\$required of method Payum\\\\Core\\\\Bridge\\\\Spl\\\\ArrayObject\\:\\:validateNotEmpty\\(\\) expects array, mixed given\\.$#" - count: 1 - path: ../src/Gateway/AbstractGatewayFactory.php - - - - message: "#^Parameter \\#1 \\$secretKey of class PayPlug\\\\SyliusPayPlugPlugin\\\\ApiClient\\\\PayPlugApiClient constructor expects string, mixed given\\.$#" - count: 1 - path: ../src/Gateway/AbstractGatewayFactory.php - - - - message: "#^Cannot call method getId\\(\\) on mixed\\.$#" - count: 1 - path: ../src/Gateway/Form/Type/AbstractGatewayConfigurationType.php - - - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: ../src/Gateway/Form/Type/ApplePayGatewayConfigurationType.php - - - - message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Form\\\\FormInterface\\:\\:get\\(\\) expects string, mixed given\\.$#" - count: 1 - path: ../src/Gateway/Form/Type/ApplePayGatewayConfigurationType.php - - - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: ../src/Gateway/Form/Type/BancontactGatewayConfigurationType.php - - - - message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Form\\\\FormInterface\\:\\:get\\(\\) expects string, mixed given\\.$#" - count: 1 - path: ../src/Gateway/Form/Type/BancontactGatewayConfigurationType.php - - - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: ../src/Gateway/Form/Type/OneyGatewayConfigurationType.php - - - - message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Form\\\\FormInterface\\:\\:get\\(\\) expects string, mixed given\\.$#" - count: 1 - path: ../src/Gateway/Form/Type/OneyGatewayConfigurationType.php - - - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: ../src/Gateway/Form/Type/PayPlugGatewayConfigurationType.php - - - - message: "#^Cannot access offset 'payum\\.http_client' on mixed\\.$#" - count: 1 - path: ../src/Gateway/Form/Type/PayPlugGatewayConfigurationType.php - - - - message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Form\\\\FormInterface\\:\\:get\\(\\) expects string, mixed given\\.$#" - count: 1 - path: ../src/Gateway/Form/Type/PayPlugGatewayConfigurationType.php - - - - message: "#^Cannot call method getData\\(\\) on mixed\\.$#" - count: 1 - path: ../src/Gateway/Validator/Constraints/IsCanSaveCardsValidator.php - - - - message: "#^Cannot call method getData\\(\\) on mixed\\.$#" - count: 1 - path: ../src/Gateway/Validator/Constraints/PayplugPermissionValidator.php - - - - message: "#^Method PayPlug\\\\SyliusPayPlugPlugin\\\\Gateway\\\\Validator\\\\Constraints\\\\IsCanSaveCardsValidator\\:\\:validate\\(\\) has parameter \\$value with no type specified\\.$#" - count: 1 - path: ../src/Gateway/Validator/Constraints/IsCanSaveCardsValidator.php - - - - message: "#^Cannot call method getData\\(\\) on mixed\\.$#" - count: 2 - path: ../src/Gateway/Validator/Constraints/IsCanSavePaymentMethodValidator.php - - - - message: "#^Method PayPlug\\\\SyliusPayPlugPlugin\\\\Gateway\\\\Validator\\\\Constraints\\\\IsCanSavePaymentMethodValidator\\:\\:validate\\(\\) has parameter \\$value with no type specified\\.$#" - count: 1 - path: ../src/Gateway/Validator/Constraints/IsCanSavePaymentMethodValidator.php - - - - message: "#^Method PayPlug\\\\SyliusPayPlugPlugin\\\\Gateway\\\\Validator\\\\Constraints\\\\IsOneyEnabledValidator\\:\\:validate\\(\\) has parameter \\$value with no type specified\\.$#" - count: 1 - path: ../src/Gateway/Validator/Constraints/IsOneyEnabledValidator.php - - - - message: "#^Method PayPlug\\\\SyliusPayPlugPlugin\\\\Gateway\\\\Validator\\\\Constraints\\\\IsPayPlugSecretKeyValidator\\:\\:validate\\(\\) has parameter \\$value with no type specified\\.$#" - count: 1 - path: ../src/Gateway/Validator/Constraints/IsPayPlugSecretKeyValidator.php - - - - message: "#^Cannot access offset 'customer_id' on mixed\\.$#" - count: 3 - path: ../src/Handler/PaymentNotificationHandler.php - - - - message: "#^Cannot access property \\$brand on mixed\\.$#" - count: 1 - path: ../src/Handler/PaymentNotificationHandler.php - - - - message: "#^Cannot access property \\$country on mixed\\.$#" - count: 1 - path: ../src/Handler/PaymentNotificationHandler.php - - - - message: "#^Cannot access property \\$exp_month on mixed\\.$#" - count: 1 - path: ../src/Handler/PaymentNotificationHandler.php - - - - message: "#^Cannot access property \\$exp_year on mixed\\.$#" - count: 1 - path: ../src/Handler/PaymentNotificationHandler.php - - - - message: "#^Cannot access property \\$id on mixed\\.$#" - count: 4 - path: ../src/Handler/PaymentNotificationHandler.php - - - - message: "#^Cannot access property \\$last4 on mixed\\.$#" - count: 1 - path: ../src/Handler/PaymentNotificationHandler.php - - - - message: "#^Parameter \\#1 \\$timestamp of method DateTimeImmutable\\:\\:setTimestamp\\(\\) expects int, mixed given\\.$#" - count: 1 - path: ../src/Handler/PaymentNotificationHandler.php - - - - message: "#^Parameter \\#1 \\$timestamp of method DateTimeImmutable\\:\\:setTimestamp\\(\\) expects int, mixed given\\.$#" - count: 1 - path: ../src/Resolver/PaymentStateResolver.php - - - message: "#^Parameter \\#1 \\$timestamp of method DateTimeImmutable\\:\\:setTimestamp\\(\\) expects int, mixed given\\.$#" - count: 1 - path: ../src/Action/CaptureAction.php - - - - message: "#^Parameter \\#2 \\$array of function array_key_exists expects array, mixed given\\.$#" - count: 2 - path: ../src/Handler/PaymentNotificationHandler.php - - - - message: "#^Parameter \\#2 \\$search of function array_key_exists expects array, mixed given\\.$#" - count: 2 - path: ../src/Handler/PaymentNotificationHandler.php - - - - message: "#^Call to static method Webmozart\\\\Assert\\\\Assert\\:\\:isInstanceOf\\(\\) with DateTimeInterface and 'DateTimeInterface' will always evaluate to true\\.$#" - count: 1 - path: ../src/MessageHandler/RefundPaymentGeneratedHandler.php - - - - message: "#^Cannot call method getId\\(\\) on mixed\\.$#" - count: 2 - path: ../src/PaymentProcessing/RefundPaymentHandler.php - - - - message: "#^Method PayPlug\\\\SyliusPayPlugPlugin\\\\PaymentProcessing\\\\RefundPaymentHandler\\:\\:parseIdsToUnitRefunds\\(\\) should return array\\ but returns array\\\\.$#" - count: 1 - path: ../src/PaymentProcessing/RefundPaymentHandler.php - - - - message: "#^Cannot cast mixed to int\\.$#" - count: 1 - path: ../src/Provider/ApplePayOrderProvider.php - - - - message: "#^Parameter \\#1 \\$number of method Sylius\\\\Component\\\\Order\\\\Repository\\\\OrderRepositoryInterface\\:\\:findOneByNumber\\(\\) expects string, mixed given\\.$#" - count: 1 - path: ../src/Provider/ApplePaySupportedRefundPaymentMethodsProviderDecorator.php - - - - message: "#^Parameter \\#1 \\$number of method Sylius\\\\Component\\\\Order\\\\Repository\\\\OrderRepositoryInterface\\:\\:findOneByNumber\\(\\) expects string, mixed given\\.$#" - count: 1 - path: ../src/Provider/BancontactSupportedRefundPaymentMethodsProviderDecorator.php - - - - message: "#^Method PayPlug\\\\SyliusPayPlugPlugin\\\\Provider\\\\OneySimulation\\\\CachedSimulationDataProvider\\:\\:getForCart\\(\\) should return array but returns mixed\\.$#" - count: 1 - path: ../src/Provider/OneySimulation/CachedSimulationDataProvider.php - - - - message: "#^Parameter \\#1 \\$number of method Sylius\\\\Component\\\\Order\\\\Repository\\\\OrderRepositoryInterface\\:\\:findOneByNumber\\(\\) expects string, mixed given\\.$#" - count: 1 - path: ../src/Provider/OneySupportedRefundPaymentMethodsProviderDecorator.php - - - - message: "#^Parameter \\#1 \\$timestamp of method DateTimeImmutable\\:\\:setTimestamp\\(\\) expects int, mixed given\\.$#" - count: 1 - path: ../src/Provider/Payment/ApplePayPaymentProvider.php - - - - message: "#^Parameter \\#2 \\$array of function array_key_exists expects array, mixed given\\.$#" - count: 1 - path: ../src/Provider/Payment/ApplePayPaymentProvider.php - - - - message: "#^Parameter \\#2 \\$search of function array_key_exists expects array, mixed given\\.$#" - count: 1 - path: ../src/Provider/Payment/ApplePayPaymentProvider.php - - - - message: "#^Parameter \\#1 \\$number of method Sylius\\\\Component\\\\Order\\\\Repository\\\\OrderRepositoryInterface\\:\\:findOneByNumber\\(\\) expects string, mixed given\\.$#" - count: 1 - path: ../src/Provider/SupportedRefundPaymentMethodsProviderDecorator.php - - - - message: "#^Method PayPlug\\\\SyliusPayPlugPlugin\\\\Repository\\\\PaymentRepository\\:\\:findAllActiveByGatewayFactoryName\\(\\) should return array but returns mixed\\.$#" - count: 1 - path: ../src/Repository/PaymentRepository.php - - - - message: "#^Method PayPlug\\\\SyliusPayPlugPlugin\\\\Repository\\\\PaymentRepository\\:\\:findOneByPayPlugPaymentId\\(\\) should return Sylius\\\\Component\\\\Core\\\\Model\\\\PaymentInterface but returns mixed\\.$#" - count: 1 - path: ../src/Repository/PaymentRepository.php - - - - message: "#^Method PayPlug\\\\SyliusPayPlugPlugin\\\\Repository\\\\RefundHistoryRepository\\:\\:findLastProcessedRefundForPayment\\(\\) should return PayPlug\\\\SyliusPayPlugPlugin\\\\Entity\\\\RefundHistory\\|null but returns mixed\\.$#" - count: 1 - path: ../src/Repository/RefundHistoryRepository.php - - - - message: "#^Method PayPlug\\\\SyliusPayPlugPlugin\\\\Repository\\\\RefundHistoryRepository\\:\\:findLastRefundForPayment\\(\\) should return PayPlug\\\\SyliusPayPlugPlugin\\\\Entity\\\\RefundHistory\\|null but returns mixed\\.$#" - count: 1 - path: ../src/Repository/RefundHistoryRepository.php - - - - message: "#^Method PayPlug\\\\SyliusPayPlugPlugin\\\\Twig\\\\GetCurrentRouteExtension\\:\\:payplugGetCurrentRoute\\(\\) should return string but returns mixed\\.$#" - count: 1 - path: ../src/Twig/GetCurrentRouteExtension.php - - - - message: "#^Cannot access offset 'slug' on mixed\\.$#" - count: 1 - path: ../src/Twig/OneyRulesExtension.php - - - - message: "#^Parameter \\#3 \\$slug of method Sylius\\\\Component\\\\Core\\\\Repository\\\\ProductRepositoryInterface\\:\\:findOneByChannelAndSlug\\(\\) expects string, mixed given\\.$#" - count: 1 - path: ../src/Twig/OneyRulesExtension.php - - - - message: "#^Parameter \\#1 \\$tokenValue of method Sylius\\\\Component\\\\Order\\\\Repository\\\\OrderRepositoryInterface\\:\\:findOneByTokenValue\\(\\) expects string, mixed given\\.$#" - count: 1 - path: ../src/Twig/OneySimulationExtension.php - - - message: "#^PHPDoc tag @param for parameter \\$paymentMethodRepository contains generic type Sylius\\\\Component\\\\Resource\\\\Repository\\\\RepositoryInterface\\ but interface Sylius\\\\Component\\\\Resource\\\\Repository\\\\RepositoryInterface is not generic\\.$#" - count: 1 - path: ../src/Controller/IntegratedPaymentController.php - - - - message: "#^PHPDoc tag @var for property PayPlug\\\\SyliusPayPlugPlugin\\\\Controller\\\\IntegratedPaymentController\\:\\:\\$paymentMethodRepository contains generic type Sylius\\\\Component\\\\Resource\\\\Repository\\\\RepositoryInterface\\ but interface Sylius\\\\Component\\\\Resource\\\\Repository\\\\RepositoryInterface is not generic\\.$#" - count: 1 - path: ../src/Controller/IntegratedPaymentController.php diff --git a/spec/Action/ConvertPaymentActionSpec.php b/spec/Action/ConvertPaymentActionSpec.php index 215ead3a..4233cc03 100644 --- a/spec/Action/ConvertPaymentActionSpec.php +++ b/spec/Action/ConvertPaymentActionSpec.php @@ -20,7 +20,7 @@ final class ConvertPaymentActionSpec extends ObjectBehavior { public function let( - PayPlugPaymentDataCreator $paymentDataCreator + PayPlugPaymentDataCreator $paymentDataCreator, ): void { $this->beConstructedWith($paymentDataCreator); } @@ -41,7 +41,7 @@ public function it_executes( OrderInterface $order, CustomerInterface $customer, AddressInterface $address, - PayPlugPaymentDataCreator $paymentDataCreator + PayPlugPaymentDataCreator $paymentDataCreator, ): void { $this->setApi(new PayPlugApiClient('test', PayPlugGatewayFactory::FACTORY_NAME)); @@ -111,7 +111,7 @@ public function it_executes_with_different_address( CustomerInterface $customer, AddressInterface $address, AddressInterface $otherAddress, - PayPlugPaymentDataCreator $paymentDataCreator + PayPlugPaymentDataCreator $paymentDataCreator, ): void { $this->setApi(new PayPlugApiClient('test', PayPlugGatewayFactory::FACTORY_NAME)); @@ -177,7 +177,7 @@ public function it_executes_with_different_address( public function it_supports_only_convert_request_payment_source_and_array_to( Convert $request, - PaymentInterface $payment + PaymentInterface $payment, ): void { $request->getSource()->willReturn($payment); $request->getTo()->willReturn('array'); @@ -229,7 +229,7 @@ private function getOrder( OrderInterface $order, CustomerInterface $customer, AddressInterface $billingAddress, - AddressInterface $shippingAddress + AddressInterface $shippingAddress, ) { $order->getCustomer()->willReturn($customer); $order->getBillingAddress()->willReturn($billingAddress); diff --git a/spec/Action/NotifyActionSpec.php b/spec/Action/NotifyActionSpec.php index a03872a1..d2224f61 100644 --- a/spec/Action/NotifyActionSpec.php +++ b/spec/Action/NotifyActionSpec.php @@ -23,12 +23,12 @@ final class NotifyActionSpec extends ObjectBehavior public function let( LoggerInterface $logger, PaymentNotificationHandler $paymentNotificationHandler, - RefundNotificationHandler $refundNotificationHandler + RefundNotificationHandler $refundNotificationHandler, ): void { $this->beConstructedWith( $logger, $paymentNotificationHandler, - $refundNotificationHandler + $refundNotificationHandler, ); } @@ -56,7 +56,7 @@ public function it_executes( Notify $request, \ArrayObject $arrayObject, GatewayInterface $gateway, - PayPlugApiClient $payPlugApiClient + PayPlugApiClient $payPlugApiClient, ): void { $payment = \Mockery::mock('payment', Payment::class); @@ -74,7 +74,7 @@ public function it_executes( public function it_supports_only_notify_request_and_array_access( Notify $request, - \ArrayAccess $arrayAccess + \ArrayAccess $arrayAccess, ): void { $request->getModel()->willReturn($arrayAccess); $this->supports($request)->shouldReturn(true); diff --git a/spec/Action/StatusActionSpec.php b/spec/Action/StatusActionSpec.php index cd4ac9f1..b06a2c8f 100644 --- a/spec/Action/StatusActionSpec.php +++ b/spec/Action/StatusActionSpec.php @@ -22,7 +22,7 @@ public function let( FactoryInterface $stateMachineFactory, RefundPaymentHandlerInterface $refundPaymentHandler, PaymentNotificationHandler $paymentNotificationHandler, - RequestStack $requestStack + RequestStack $requestStack, ): void { $this->beConstructedWith($stateMachineFactory, $refundPaymentHandler, $paymentNotificationHandler, $requestStack); } @@ -45,7 +45,7 @@ public function it_implements_gateway_aware_interface(): void public function it_executes( GetStatusInterface $request, PaymentInterface $payment, - GatewayInterface $gateway + GatewayInterface $gateway, ): void { $this->setGateway($gateway); @@ -59,7 +59,7 @@ public function it_executes( public function it_supports_only_get_status_request_and_array_access( GetStatusInterface $request, - PaymentInterface $payment + PaymentInterface $payment, ): void { $request->getModel()->willReturn($payment); $this->supports($request)->shouldReturn(true); diff --git a/spec/PaymentProcessing/RefundPaymentProcessorSpec.php b/spec/PaymentProcessing/RefundPaymentProcessorSpec.php index 45636456..4dcbbd3a 100644 --- a/spec/PaymentProcessing/RefundPaymentProcessorSpec.php +++ b/spec/PaymentProcessing/RefundPaymentProcessorSpec.php @@ -26,7 +26,7 @@ public function let( TranslatorInterface $translator, RepositoryInterface $refundPaymentRepository, RefundHistoryRepositoryInterface $payplugRefundHistoryRepository, - PayPlugApiClientFactoryInterface $apiClientFactory + PayPlugApiClientFactoryInterface $apiClientFactory, ): void { $this->beConstructedWith( $requestStack, @@ -34,7 +34,7 @@ public function let( $translator, $refundPaymentRepository, $payplugRefundHistoryRepository, - $apiClientFactory + $apiClientFactory, ); } @@ -51,7 +51,7 @@ public function it_implements_payment_processor_interface(): void public function it_processes( PaymentInterface $payment, PaymentMethodInterface $paymentMethod, - GatewayConfigInterface $gatewayConfig + GatewayConfigInterface $gatewayConfig, ): void { $gatewayConfig->getFactoryName()->willReturn(PayPlugGatewayFactory::FACTORY_NAME); $gatewayConfig->getConfig()->willReturn([ diff --git a/src/Action/Admin/CompleteRefundPaymentAction.php b/src/Action/Admin/CompleteRefundPaymentAction.php index fd3aedf7..917ccd3e 100644 --- a/src/Action/Admin/CompleteRefundPaymentAction.php +++ b/src/Action/Admin/CompleteRefundPaymentAction.php @@ -33,7 +33,7 @@ public function __construct( private RouterInterface $router, private MessageBusInterface $messageBus, private RelatedPaymentIdProviderInterface $relatedPaymentIdProvider, - private TranslatorInterface $translator + private TranslatorInterface $translator, ) { } @@ -52,20 +52,20 @@ public function __invoke(string $orderNumber, string $id): Response $refundPayment->getAmount(), $refundPayment->getCurrencyCode(), $refundPayment->getPaymentMethod()->getId(), - $this->relatedPaymentIdProvider->getForRefundPayment($refundPayment) + $this->relatedPaymentIdProvider->getForRefundPayment($refundPayment), )); if (self::COMPLETED_STATE !== $refundPayment->getState()) { $this->refundPaymentCompletedStateApplier->apply($refundPayment); } $this->requestStack->getSession()->getFlashBag()->add('success', 'sylius_refund.refund_payment_completed'); - } catch (Throwable $throwable) { + } catch (Throwable) { $this->requestStack->getSession()->getFlashBag()->add('error', $this->translator->trans('payplug_sylius_payplug_plugin.ui.impossible_to_refund_this_payment')); } return new RedirectResponse($this->router->generate( 'sylius_admin_order_show', - ['id' => $order->getId()] + ['id' => $order->getId()], )); } } diff --git a/src/Action/Admin/RefundUnitsAction.php b/src/Action/Admin/RefundUnitsAction.php index 150d3252..4db69c54 100644 --- a/src/Action/Admin/RefundUnitsAction.php +++ b/src/Action/Admin/RefundUnitsAction.php @@ -27,7 +27,7 @@ public function __construct( private UrlGeneratorInterface $router, #[Autowire('@sylius_refund.creator.request_command')] private RequestCommandCreatorInterface $commandCreator, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } @@ -52,7 +52,7 @@ public function __invoke(Request $request): Response return new RedirectResponse($this->router->generate( 'sylius_refund_order_refunds_list', - ['orderNumber' => $request->attributes->get('orderNumber')] + ['orderNumber' => $request->attributes->get('orderNumber')], )); } } diff --git a/src/Action/Api/ApiAwareTrait.php b/src/Action/Api/ApiAwareTrait.php index 9c1a4600..2bab0e65 100644 --- a/src/Action/Api/ApiAwareTrait.php +++ b/src/Action/Api/ApiAwareTrait.php @@ -15,7 +15,7 @@ trait ApiAwareTrait public function setApi($api): void { if (!$api instanceof PayPlugApiClientInterface) { - throw new UnsupportedApiException('Not supported.Expected an instance of '.PayPlugApiClientInterface::class); + throw new UnsupportedApiException('Not supported.Expected an instance of ' . PayPlugApiClientInterface::class); } $this->payPlugApiClient = $api; } diff --git a/src/Action/CaptureAction.php b/src/Action/CaptureAction.php index 1f47d886..d03c6378 100644 --- a/src/Action/CaptureAction.php +++ b/src/Action/CaptureAction.php @@ -46,30 +46,13 @@ final class CaptureAction implements ActionInterface, ApiAwareInterface, Gateway /** @var GenericTokenFactoryInterface|null */ private $tokenFactory; - /** @var LoggerInterface */ - private $logger; - - /** @var TranslatorInterface */ - private $translator; - - private RequestStack $requestStack; - - private AbortPaymentProcessor $abortPaymentProcessor; - - private RepositoryInterface $payplugCardRepository; - public function __construct( - LoggerInterface $logger, - TranslatorInterface $translator, - AbortPaymentProcessor $abortPaymentProcessor, - RequestStack $requestStack, - RepositoryInterface $payplugCardRepository + private LoggerInterface $logger, + private TranslatorInterface $translator, + private AbortPaymentProcessor $abortPaymentProcessor, + private RequestStack $requestStack, + private RepositoryInterface $payplugCardRepository, ) { - $this->logger = $logger; - $this->translator = $translator; - $this->abortPaymentProcessor = $abortPaymentProcessor; - $this->requestStack = $requestStack; - $this->payplugCardRepository = $payplugCardRepository; } public function setGenericTokenFactory(GenericTokenFactoryInterface $genericTokenFactory = null): void @@ -87,16 +70,20 @@ public function execute($request): void $details = ArrayObject::ensureArrayObject($request->getModel()); - if (isset($details['payment_method']) && - ApplePayGatewayFactory::PAYMENT_METHOD_APPLE_PAY === $details['payment_method']) { + if ( + isset($details['payment_method']) && + ApplePayGatewayFactory::PAYMENT_METHOD_APPLE_PAY === $details['payment_method'] + ) { $this->abortPaymentProcessor->process($paymentModel); $details['status'] = PayPlugApiClientInterface::STATUS_CANCELED; return; } - if (PayPlugApiClientInterface::FAILED === ($details['status'] ?? null) && - PayPlugApiClientInterface::INTEGRATED_PAYMENT_INTEGRATION === ($details['integration'] ?? null)) { + if ( + PayPlugApiClientInterface::FAILED === ($details['status'] ?? null) && + PayPlugApiClientInterface::INTEGRATED_PAYMENT_INTEGRATION === ($details['integration'] ?? null) + ) { // Do not try to capture a failed integrated payment and do not remove status return; } @@ -108,14 +95,17 @@ public function execute($request): void return; } - if (isset($details['status'], $details['payment_id']) && - PayPlugApiClientInterface::STATUS_CREATED !== $details['status']) { + if ( + isset($details['status'], $details['payment_id']) && + PayPlugApiClientInterface::STATUS_CREATED !== $details['status'] + ) { return; } - /* @var Capture $request */ - if (array_key_exists('status', $paymentModel->getDetails()) - && PayPlugApiClientInterface::STATUS_CAPTURED === $paymentModel->getDetails()['status']) { + if ( + array_key_exists('status', $paymentModel->getDetails()) && + PayPlugApiClientInterface::STATUS_CAPTURED === $paymentModel->getDetails()['status'] + ) { return; } @@ -126,7 +116,7 @@ public function execute($request): void $details['hosted_payment'] = [ 'return_url' => $token->getAfterUrl(), - 'cancel_url' => $token->getTargetUrl().'?&'.http_build_query(['status' => PayPlugApiClientInterface::STATUS_CANCELED]), + 'cancel_url' => $token->getTargetUrl() . '?&' . http_build_query(['status' => PayPlugApiClientInterface::STATUS_CANCELED]), ]; if (isset($details['status']) && 'pending' === $details['status']) { @@ -135,14 +125,16 @@ public function execute($request): void unset($details['status']); } - if (!in_array( - $details['payment_method'], - array_merge( - [ApplePayGatewayFactory::PAYMENT_METHOD_APPLE_PAY], - OneyGatewayFactory::PAYMENT_CHOICES - ), - true - )) { + if ( + !in_array( + $details['payment_method'], + array_merge( + [ApplePayGatewayFactory::PAYMENT_METHOD_APPLE_PAY], + OneyGatewayFactory::PAYMENT_CHOICES, + ), + true, + ) + ) { // clean other detail values if ($details->offsetExists('payment_context')) { unset($details['payment_context']); @@ -180,10 +172,12 @@ public function execute($request): void } $now = new \DateTimeImmutable(); - if ($payment->__isset('authorization') && + if ( + $payment->__isset('authorization') && $payment->__get('authorization') instanceof PaymentAuthorization && null !== $payment->__get('authorization')->__get('expires_at') && - $now < $now->setTimestamp($payment->__get('authorization')->__get('expires_at'))) { + $now < $now->setTimestamp($payment->__get('authorization')->__get('expires_at')) + ) { return; } @@ -191,20 +185,20 @@ public function execute($request): void $details['hosted_payment'] = [ 'payment_url' => $payment->hosted_payment->payment_url, 'return_url' => $token->getAfterUrl(), - 'cancel_url' => $token->getTargetUrl().'?&'.http_build_query(['status' => PayPlugApiClientInterface::STATUS_CANCELED]), + 'cancel_url' => $token->getTargetUrl() . '?&' . http_build_query(['status' => PayPlugApiClientInterface::STATUS_CANCELED]), ]; $oneClickToken = $this->tokenFactory->createCaptureToken( $token->getGatewayName(), $token->getDetails(), - 'payplug_sylius_oneclick_verification' + 'payplug_sylius_oneclick_verification', ); throw new HttpRedirect($oneClickToken->getAfterUrl()); } throw new HttpRedirect($payment->hosted_payment->payment_url); - } catch (ForbiddenException $forbiddenException) { + } catch (ForbiddenException) { $accountData = $this->payPlugApiClient->getAccount(true); $canSaveCard = (bool) $accountData['permissions']['can_save_cards']; @@ -228,7 +222,7 @@ public function execute($request): void $this->notifyErrors($details, $errorObject); throw new HttpRedirect($details['hosted_payment']['cancel_url']); - } catch (UnknownApiErrorException $unknownApiErrorException) { + } catch (UnknownApiErrorException) { $details['status'] = PayPlugApiClientInterface::FAILED; $this->displayGenericError($details); @@ -275,9 +269,10 @@ private function addNotificationUrl(TokenInterface $token, ArrayObject $details) private function createPayment(ArrayObject $details, PaymentInterface $paymentModel): Payment { try { - if ($details->offsetExists('payment_id') - && $details->offsetExists('status') - && $details->offsetExists('is_live') + if ( + $details->offsetExists('payment_id') && + $details->offsetExists('status') && + $details->offsetExists('is_live') ) { $this->abortPaymentProcessor->process($paymentModel); unset($details['status'], $details['payment_id'], $details['is_live']); @@ -302,6 +297,7 @@ private function createPayment(ArrayObject $details, PaymentInterface $paymentMo return $payment; } catch (BadRequestException $badRequestException) { $details['status'] = PayPlugApiClientInterface::FAILED; + throw $badRequestException; } catch (\Throwable $throwable) { $details['status'] = PayPlugApiClientInterface::FAILED; @@ -321,7 +317,7 @@ private function notifyErrors(ArrayObject $details, array $errorDetails): void 'error', $this->translator->trans('payplug_sylius_payplug_plugin.ui.error.billing.postcode', [ '%postalCode%' => $details['billing']['postcode'], - ]) + ]), ); } @@ -330,12 +326,14 @@ private function notifyErrors(ArrayObject $details, array $errorDetails): void 'error', $this->translator->trans('payplug_sylius_payplug_plugin.ui.error.shipping.postcode', [ '%postalCode%' => $details['shipping']['postcode'], - ]) + ]), ); } - if (!isset($errorDetails['details']['billing']['postcode']) && - !isset($errorDetails['details']['shipping']['postcode'])) { + if ( + !isset($errorDetails['details']['billing']['postcode']) && + !isset($errorDetails['details']['shipping']['postcode']) + ) { $this->requestStack->getSession()->getFlashBag()->add('error', 'payplug_sylius_payplug_plugin.error.api_unknow_error'); } } diff --git a/src/Action/ConvertPaymentAction.php b/src/Action/ConvertPaymentAction.php index 767dbdd5..cf04d4fe 100644 --- a/src/Action/ConvertPaymentAction.php +++ b/src/Action/ConvertPaymentAction.php @@ -16,12 +16,8 @@ final class ConvertPaymentAction implements ActionInterface, ApiAwareInterface { use ApiAwareTrait; - private PayPlugPaymentDataCreator $paymentDataCreator; - - public function __construct( - PayPlugPaymentDataCreator $paymentDataCreator - ) { - $this->paymentDataCreator = $paymentDataCreator; + public function __construct(private PayPlugPaymentDataCreator $paymentDataCreator) + { } public function execute($request): void diff --git a/src/Action/NotifyAction.php b/src/Action/NotifyAction.php index a1bf6fba..0224ff12 100644 --- a/src/Action/NotifyAction.php +++ b/src/Action/NotifyAction.php @@ -29,7 +29,7 @@ public function __construct( #[Autowire('@monolog.logger.payum')] private LoggerInterface $logger, private PaymentNotificationHandler $paymentNotificationHandler, - private RefundNotificationHandler $refundNotificationHandler + private RefundNotificationHandler $refundNotificationHandler, ) { } diff --git a/src/Action/StatusAction.php b/src/Action/StatusAction.php index e6ceec94..d7797fa0 100644 --- a/src/Action/StatusAction.php +++ b/src/Action/StatusAction.php @@ -17,7 +17,6 @@ use Payum\Core\GatewayAwareTrait; use Payum\Core\Request\GetHttpRequest; use Payum\Core\Request\GetStatusInterface; -use SM\Factory\FactoryInterface; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\Model\PaymentInterface; use Symfony\Component\HttpFoundation\RequestStack; @@ -27,21 +26,11 @@ final class StatusAction implements ActionInterface, GatewayAwareInterface, ApiA use GatewayAwareTrait; use ApiAwareTrait; - /** @var RefundPaymentHandlerInterface */ - private $refundPaymentHandler; - - /** @var \PayPlug\SyliusPayPlugPlugin\Handler\PaymentNotificationHandler */ - private $paymentNotificationHandler; - private RequestStack $requestStack; - public function __construct( - RefundPaymentHandlerInterface $refundPaymentHandler, - PaymentNotificationHandler $paymentNotificationHandler, - RequestStack $requestStack + private RefundPaymentHandlerInterface $refundPaymentHandler, + private PaymentNotificationHandler $paymentNotificationHandler, + private RequestStack $requestStack, ) { - $this->refundPaymentHandler = $refundPaymentHandler; - $this->paymentNotificationHandler = $paymentNotificationHandler; - $this->requestStack = $requestStack; } public function execute($request): void @@ -62,14 +51,18 @@ public function execute($request): void $this->gateway->execute($httpRequest = new GetHttpRequest()); //If we don't have received the notification when we reach this page, call the API manually to update the status - if (PayPlugApiClientInterface::STATUS_CREATED === $details['status'] - && isset($httpRequest->query['payum_token'])) { + if ( + PayPlugApiClientInterface::STATUS_CREATED === $details['status'] && + isset($httpRequest->query['payum_token']) + ) { $resource = $this->payPlugApiClient->retrieve($details['payment_id']); $this->paymentNotificationHandler->treat($request->getFirstModel(), $resource, $details); } - if (isset($httpRequest->query['status']) && - PayPlugApiClientInterface::STATUS_CANCELED === $httpRequest->query['status']) { + if ( + isset($httpRequest->query['status']) && + PayPlugApiClientInterface::STATUS_CANCELED === $httpRequest->query['status'] + ) { // we need to show a specific error message when the payment is cancelled using the 1click feature if (PayPlugApiClientInterface::INTERNAL_STATUS_ONE_CLICK === $details['status']) { $this->requestStack->getSession()->getFlashBag()->add('error', 'payplug_sylius_payplug_plugin.error.transaction_failed_1click'); diff --git a/src/ApiClient/PayPlugApiClient.php b/src/ApiClient/PayPlugApiClient.php index 4a7c8ba8..f581189d 100644 --- a/src/ApiClient/PayPlugApiClient.php +++ b/src/ApiClient/PayPlugApiClient.php @@ -41,7 +41,7 @@ public function __construct(string $secretKey, ?string $factoryName = null, ?Cac ]); $this->factoryName = $factoryName ?? PayPlugGatewayFactory::FACTORY_NAME; - if (null === $cache) { + if (!$cache instanceof \Symfony\Contracts\Cache\CacheInterface) { $cache = new ArrayAdapter(); } $this->cache = $cache; @@ -49,7 +49,7 @@ public function __construct(string $secretKey, ?string $factoryName = null, ?Cac HttpClient::addDefaultUserAgentProduct( 'PayPlug-Sylius', PayPlugSyliusPayPlugPlugin::VERSION, - 'Sylius/'.Kernel::VERSION + 'Sylius/' . Kernel::VERSION, ); } @@ -62,20 +62,18 @@ public function initialise(string $secretKey): void HttpClient::addDefaultUserAgentProduct( 'PayPlug-Sylius', PayPlugSyliusPayPlugPlugin::VERSION, - 'Sylius/'.Kernel::VERSION + 'Sylius/' . Kernel::VERSION, ); } public function getAccount(bool $refresh = false): array { - $cacheKey = 'payplug_account_'.substr($this->configuration->getToken(), 8); + $cacheKey = 'payplug_account_' . substr($this->configuration->getToken(), 8); if ($refresh) { $this->cache->delete($cacheKey); } - return $this->cache->get($cacheKey, function (): array { - return Authentication::getAccount($this->configuration)['httpResponse'] ?? []; - }); + return $this->cache->get($cacheKey, fn (): array => Authentication::getAccount($this->configuration)['httpResponse'] ?? []); } public function getGatewayFactoryName(): string @@ -87,7 +85,7 @@ public function getPermissions(): array { try { return Authentication::getPermissions($this->configuration) ?? []; - } catch (UnauthorizedException $exception) { + } catch (UnauthorizedException) { return []; } } diff --git a/src/ApiClient/PayPlugApiClientFactory.php b/src/ApiClient/PayPlugApiClientFactory.php index 3e93429a..5a017598 100644 --- a/src/ApiClient/PayPlugApiClientFactory.php +++ b/src/ApiClient/PayPlugApiClientFactory.php @@ -10,18 +10,10 @@ final class PayPlugApiClientFactory implements PayPlugApiClientFactoryInterface { - /** @var \Sylius\Component\Resource\Repository\RepositoryInterface */ - private $gatewayConfigRepository; - - /** @var CacheInterface */ - private $cache; - public function __construct( - RepositoryInterface $gatewayConfigRepository, - CacheInterface $cache + private RepositoryInterface $gatewayConfigRepository, + private CacheInterface $cache, ) { - $this->gatewayConfigRepository = $gatewayConfigRepository; - $this->cache = $cache; } public function create(string $factoryName, ?string $key = null): PayPlugApiClientInterface @@ -31,7 +23,7 @@ public function create(string $factoryName, ?string $key = null): PayPlugApiClie $gatewayConfig = $this->gatewayConfigRepository->findOneBy(['factoryName' => $factoryName]); if (null === $gatewayConfig) { - throw new \LogicException('Not yet gateway created for '.$factoryName); + throw new \LogicException('Not yet gateway created for ' . $factoryName); } $key = $gatewayConfig->getConfig()['secretKey']; } diff --git a/src/Checker/ApplePayChecker.php b/src/Checker/ApplePayChecker.php index 2efa3e88..f3e681b1 100644 --- a/src/Checker/ApplePayChecker.php +++ b/src/Checker/ApplePayChecker.php @@ -9,11 +9,8 @@ final class ApplePayChecker implements ApplePayCheckerInterface { - private RequestStack $requestStack; - - public function __construct(RequestStack $requestStack) + public function __construct(private RequestStack $requestStack) { - $this->requestStack = $requestStack; } public function isDeviceReady(): bool @@ -32,7 +29,7 @@ public function isDeviceReady(): bool $browsers = ['Opera', 'Edg', 'Chrome', 'Firefox', 'MSIE', 'Trident']; foreach ($browsers as $browser) { - if (false !== strpos($userAgent, $browser)) { + if (str_contains($userAgent, $browser)) { return false; } } diff --git a/src/Checker/CanSaveCardChecker.php b/src/Checker/CanSaveCardChecker.php index 1a0bd72f..c3ba0506 100644 --- a/src/Checker/CanSaveCardChecker.php +++ b/src/Checker/CanSaveCardChecker.php @@ -4,23 +4,16 @@ namespace PayPlug\SyliusPayPlugPlugin\Checker; -use PayPlug\SyliusPayPlugPlugin\Gateway\PayPlugGatewayFactory; -use Sylius\Bundle\PayumBundle\Model\GatewayConfigInterface; use Sylius\Component\Core\Model\CustomerInterface; use Sylius\Component\Core\Model\PaymentMethodInterface; use Sylius\Component\Customer\Context\CustomerContextInterface; class CanSaveCardChecker implements CanSaveCardCheckerInterface { - private CustomerContextInterface $customerContext; - private PayplugFeatureChecker $payplugFeatureChecker; - public function __construct( - CustomerContextInterface $customerContext, - PayplugFeatureChecker $payplugFeatureChecker, + private CustomerContextInterface $customerContext, + private PayplugFeatureChecker $payplugFeatureChecker, ) { - $this->customerContext = $customerContext; - $this->payplugFeatureChecker = $payplugFeatureChecker; } public function isAllowed(PaymentMethodInterface $paymentMethod): bool diff --git a/src/Checker/CanSavePayplugPaymentMethodChecker.php b/src/Checker/CanSavePayplugPaymentMethodChecker.php index 8d599fea..7409fde5 100644 --- a/src/Checker/CanSavePayplugPaymentMethodChecker.php +++ b/src/Checker/CanSavePayplugPaymentMethodChecker.php @@ -10,11 +10,8 @@ final class CanSavePayplugPaymentMethodChecker { - private PayPlugApiClientInterface $client; - - public function __construct(PayPlugApiClientInterface $apiClient) + public function __construct(private PayPlugApiClientInterface $client) { - $this->client = $apiClient; } public function isLive(): bool diff --git a/src/Checker/OneyChecker.php b/src/Checker/OneyChecker.php index 627cc2d6..a25acf6a 100644 --- a/src/Checker/OneyChecker.php +++ b/src/Checker/OneyChecker.php @@ -56,11 +56,6 @@ public function isCountryEligible(?string $shippingCountry, ?string $billingCoun $allowedCountries = $this->client->getAccount()['configuration']['oney']['allowed_countries']; - if (!in_array($shippingCountry, $allowedCountries, true) || - !in_array($billingCountry, $allowedCountries, true)) { - return false; - } - - return true; + return in_array($shippingCountry, $allowedCountries, true) && in_array($billingCountry, $allowedCountries, true); } } diff --git a/src/Checker/OneyOrderChecker.php b/src/Checker/OneyOrderChecker.php index 1e0c827e..eb6cc4ee 100644 --- a/src/Checker/OneyOrderChecker.php +++ b/src/Checker/OneyOrderChecker.php @@ -9,12 +9,8 @@ final class OneyOrderChecker { - /** @var \PayPlug\SyliusPayPlugPlugin\Validator\OneyInvalidDataRetriever */ - private $invalidDataRetriever; - - public function __construct(OneyInvalidDataRetriever $invalidDataRetriever) + public function __construct(private OneyInvalidDataRetriever $invalidDataRetriever) { - $this->invalidDataRetriever = $invalidDataRetriever; } /** @@ -22,6 +18,6 @@ public function __construct(OneyInvalidDataRetriever $invalidDataRetriever) */ public function isOrderInfoCorrect(OrderInterface $order): bool { - return 0 === \count($this->invalidDataRetriever->getForOrder($order)); + return [] === $this->invalidDataRetriever->getForOrder($order); } } diff --git a/src/Checker/PermissionCanSaveCardsChecker.php b/src/Checker/PermissionCanSaveCardsChecker.php index bfb06e02..03eb8adb 100644 --- a/src/Checker/PermissionCanSaveCardsChecker.php +++ b/src/Checker/PermissionCanSaveCardsChecker.php @@ -10,12 +10,8 @@ final class PermissionCanSaveCardsChecker { private const CAN_SAVE_CARDS_PERMISSION_FIELD = 'can_save_cards'; - /** @var PayPlugApiClientInterface */ - private $client; - - public function __construct(PayPlugApiClientInterface $apiClient) + public function __construct(private PayPlugApiClientInterface $client) { - $this->client = $apiClient; } public function isEnabled(): bool diff --git a/src/Cli/UpdatePaymentStateCommand.php b/src/Cli/UpdatePaymentStateCommand.php index 838c7667..413d9874 100644 --- a/src/Cli/UpdatePaymentStateCommand.php +++ b/src/Cli/UpdatePaymentStateCommand.php @@ -23,7 +23,7 @@ final class UpdatePaymentStateCommand extends Command public function __construct( private PaymentRepositoryInterface $paymentRepository, private PaymentStateResolverInterface $paymentStateResolver, - private LoggerInterface $logger + private LoggerInterface $logger, ) { parent::__construct(); } diff --git a/src/Command/CaptureAuthorizedPaymentCommand.php b/src/Command/CaptureAuthorizedPaymentCommand.php index 1e1a9a56..b2afec29 100644 --- a/src/Command/CaptureAuthorizedPaymentCommand.php +++ b/src/Command/CaptureAuthorizedPaymentCommand.php @@ -17,6 +17,8 @@ #[AsCommand(name: 'payplug:capture-authorized-payments', description: 'Capture payplug authorized payments older than X days (default 6)')] class CaptureAuthorizedPaymentCommand extends Command { + public $stateMachineFactory; + public function __construct( // private Factory $stateMachineFactory, private PaymentRepositoryInterface $paymentRepository, @@ -35,14 +37,14 @@ protected function configure(): void protected function execute(InputInterface $input, OutputInterface $output): int { - $days = \filter_var($input->getOption('days'), FILTER_VALIDATE_INT); + $days = \filter_var($input->getOption('days'), \FILTER_VALIDATE_INT); if (false === $days) { throw new \InvalidArgumentException('Invalid number of days provided.'); } $payments = $this->paymentRepository->findAllAuthorizedOlderThanDays($days); - if (\count($payments) === 0) { + if ($payments === []) { $this->logger->debug('[Payplug] No authorized payments found.'); } @@ -61,6 +63,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int 'paymentId' => $payment->getId(), 'exception' => $e->getMessage(), ]); + continue; } diff --git a/src/Const/Permission.php b/src/Const/Permission.php index 69970721..6e85236a 100644 --- a/src/Const/Permission.php +++ b/src/Const/Permission.php @@ -10,10 +10,15 @@ final class Permission { public const USE_LIVE_MODE = 'use_live_mode'; + public const CAN_SAVE_CARD = 'can_save_cards'; + public const CAN_CREATE_DEFERRED_PAYMENT = 'can_create_deferred_payment'; + public const CAN_USE_INTEGRATED_PAYMENTS = 'can_use_integrated_payments'; + public const CAN_CREATE_INSTALLMENT_PLAN = 'can_create_installment_plan'; + public const CAN_USE_ONEY = 'can_use_oney'; public static function getAll(): array diff --git a/src/Controller/AbstractOneyController.php b/src/Controller/AbstractOneyController.php index 88a58e27..513bc947 100644 --- a/src/Controller/AbstractOneyController.php +++ b/src/Controller/AbstractOneyController.php @@ -33,7 +33,7 @@ public function __construct( protected FactoryInterface $orderItemFactory, protected OrderModifierInterface $orderModifier, protected OrderItemQuantityModifierInterface $itemQuantityModifier, - protected OneyRulesExtension $oneyRulesExtension + protected OneyRulesExtension $oneyRulesExtension, ) { } @@ -42,7 +42,7 @@ protected function createTempCart( int $quantity, ChannelInterface $channel, string $localeCode, - string $currencyCode + string $currencyCode, ): OrderInterface { /** @var OrderInterface $tempCart */ $tempCart = $this->orderFactory->createNew(); diff --git a/src/Controller/CardController.php b/src/Controller/CardController.php index 69f4efad..5467564f 100644 --- a/src/Controller/CardController.php +++ b/src/Controller/CardController.php @@ -28,7 +28,7 @@ public function __construct( #[Autowire('@payplug_sylius_payplug_plugin.api_client.payplug')] private PayPlugApiClientInterface $payPlugApiClient, private RequestStack $requestStack, - private ManagerRegistry $managerRegistry + private ManagerRegistry $managerRegistry, ) { } @@ -62,7 +62,7 @@ public function deleteAction(int $id): Response return $this->redirectToRoute('payplug_sylius_card_account_index'); } - if (true === $this->isCardExpired($card)) { + if ($this->isCardExpired($card)) { $this->removeCard($card); return $this->redirectToRoute('payplug_sylius_card_account_index'); @@ -72,7 +72,7 @@ public function deleteAction(int $id): Response try { $this->payPlugApiClient->deleteCard($cardToken); - } catch (NotFoundException $e) { + } catch (NotFoundException) { $this->requestStack->getSession()->getFlashBag()->add('error', $this->translator->trans('payplug_sylius_payplug_plugin.ui.account.saved_cards.deleted_error')); return $this->redirectToRoute('payplug_sylius_card_account_index'); @@ -98,13 +98,6 @@ private function isCardExpired(Card $card): bool $currentYear = $now->format('Y'); $expirationYear = (string) $card->getExpirationYear(); - if ( - ($currentYear < $expirationYear) || - ($currentYear === $expirationYear && $now->format('n') <= (string) $card->getExpirationMonth()) - ) { - return false; - } - - return true; + return $currentYear >= $expirationYear && !($currentYear === $expirationYear && $now->format('n') <= (string) $card->getExpirationMonth()); } } diff --git a/src/Controller/CompleteInfoController.php b/src/Controller/CompleteInfoController.php index 44541cac..a0d9e48d 100644 --- a/src/Controller/CompleteInfoController.php +++ b/src/Controller/CompleteInfoController.php @@ -23,28 +23,17 @@ #[AsController] final class CompleteInfoController extends AbstractController { - /** @var \PayPlug\SyliusPayPlugPlugin\Validator\OneyInvalidDataRetriever */ - private $invalidDataRetriever; - - /** @var \Sylius\Component\Resource\Repository\RepositoryInterface */ - private $customerRepository; - - private RepositoryInterface $orderRepository; - public function __construct( - OneyInvalidDataRetriever $invalidDataRetriever, - RepositoryInterface $customerRepository, - RepositoryInterface $orderRepository + private OneyInvalidDataRetriever $invalidDataRetriever, + private RepositoryInterface $customerRepository, + private RepositoryInterface $orderRepository, ) { - $this->invalidDataRetriever = $invalidDataRetriever; - $this->customerRepository = $customerRepository; - $this->orderRepository = $orderRepository; } public function __invoke( Request $request, CartContextInterface $cartContext, - EntityManagerInterface $entityManager + EntityManagerInterface $entityManager, ): Response { $order = $cartContext->getCart(); $tokenValue = $request->get('tokenValue'); @@ -82,7 +71,7 @@ public function __invoke( } return $this->render('@PayPlugSyliusPayPlugPlugin/form/complete_info_popin.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, ]); } diff --git a/src/Controller/IntegratedPaymentController.php b/src/Controller/IntegratedPaymentController.php index 0c26201b..1ddd7ff4 100644 --- a/src/Controller/IntegratedPaymentController.php +++ b/src/Controller/IntegratedPaymentController.php @@ -26,36 +26,18 @@ #[AsController] final class IntegratedPaymentController extends AbstractController { - private CartContextInterface $cartContext; - /** - * @var RepositoryInterface<\Sylius\Component\Core\Model\PaymentMethodInterface> - */ - private RepositoryInterface $paymentMethodRepository; - private OrderRepositoryInterface $orderRepository; - private PayPlugPaymentDataCreator $paymentDataCreator; - private PayPlugApiClientFactory $apiClientFactory; - private EntityManagerInterface $entityManager; - private LoggerInterface $logger; - /** * @param RepositoryInterface<\Sylius\Component\Core\Model\PaymentMethodInterface> $paymentMethodRepository */ public function __construct( - CartContextInterface $cartContext, - RepositoryInterface $paymentMethodRepository, - OrderRepositoryInterface $orderRepository, - PayPlugPaymentDataCreator $paymentDataCreator, - PayPlugApiClientFactory $apiClientFactory, - EntityManagerInterface $entityManager, - LoggerInterface $logger + private CartContextInterface $cartContext, + private RepositoryInterface $paymentMethodRepository, + private OrderRepositoryInterface $orderRepository, + private PayPlugPaymentDataCreator $paymentDataCreator, + private PayPlugApiClientFactory $apiClientFactory, + private EntityManagerInterface $entityManager, + private LoggerInterface $logger, ) { - $this->cartContext = $cartContext; - $this->paymentMethodRepository = $paymentMethodRepository; - $this->orderRepository = $orderRepository; - $this->paymentDataCreator = $paymentDataCreator; - $this->apiClientFactory = $apiClientFactory; - $this->entityManager = $entityManager; - $this->logger = $logger; } /** @@ -77,7 +59,7 @@ public function initPaymentAction(Request $request, int $paymentMethodId): Respo if (\is_string($orderToken = $request->query->get('orderToken'))) { $order = $this->orderRepository->findOneByTokenValue($orderToken); } - if (null === $order) { + if (!$order instanceof \Sylius\Component\Order\Model\OrderInterface) { $order = $this->cartContext->getCart(); } if (!$order instanceof OrderInterface) { diff --git a/src/Controller/IpnAction.php b/src/Controller/IpnAction.php index 16ac87ea..cf1d2d3e 100644 --- a/src/Controller/IpnAction.php +++ b/src/Controller/IpnAction.php @@ -29,13 +29,15 @@ #[AsController] class IpnAction { + private PayPlugApiClientInterface $payPlugApiClient; + public function __construct( private LoggerInterface $logger, private PaymentNotificationHandler $paymentNotificationHandler, private RefundNotificationHandler $refundNotificationHandler, private PayPlugApiClientFactoryInterface $apiClientFactory, private PaymentRepositoryInterface $paymentRepository, - private EntityManagerInterface $entityManager + private EntityManagerInterface $entityManager, ) { } diff --git a/src/Controller/OneClickAction.php b/src/Controller/OneClickAction.php index dc585d6c..51a4b9ae 100644 --- a/src/Controller/OneClickAction.php +++ b/src/Controller/OneClickAction.php @@ -30,7 +30,7 @@ class OneClickAction extends AbstractController implements GatewayAwareInterface public function __construct( private PaymentRepositoryInterface $paymentRepository, private Payum $payum, - private PayPlugApiClientFactory $payPlugApiClientFactory + private PayPlugApiClientFactory $payPlugApiClientFactory, ) { } @@ -51,7 +51,7 @@ public function __invoke(Request $request): Response $paymentGateway->getGatewayName(), $payment, 'sylius_shop_order_thank_you', - [] + [], ); $secretKey = $paymentGateway->getConfig()['secretKey']; @@ -64,7 +64,8 @@ public function __invoke(Request $request): Response } //if both fields authorization and authorized_at are present and filled, the authorization was successful - if ($resource->__isset('authorization') && + if ( + $resource->__isset('authorization') && $resource->__isset('authorized_at') && null !== $resource->__get('authorization') && null !== $resource->__get('authorized_at') diff --git a/src/Controller/OneyIsProductEligible.php b/src/Controller/OneyIsProductEligible.php index 1a5298c5..2861d639 100644 --- a/src/Controller/OneyIsProductEligible.php +++ b/src/Controller/OneyIsProductEligible.php @@ -35,7 +35,7 @@ public function __invoke(Request $request): JsonResponse private function isProductEligible( OrderInterface $cart, string $productVariantCode, - int $quantity + int $quantity, ): bool { $productVariant = $this->productVariantRepository->findOneBy(['code' => $productVariantCode]); Assert::isInstanceOf($productVariant, ProductVariantInterface::class); @@ -51,7 +51,7 @@ private function isProductEligible( $quantity, $channel, $cart->getLocaleCode(), - $cart->getCurrencyCode() + $cart->getCurrencyCode(), ); return $this->oneyRulesExtension->isCartEligible($tempCart); diff --git a/src/Controller/OneySimulationPopin.php b/src/Controller/OneySimulationPopin.php index 54b925fb..a3af8572 100644 --- a/src/Controller/OneySimulationPopin.php +++ b/src/Controller/OneySimulationPopin.php @@ -34,7 +34,7 @@ public function __invoke(Request $request): Response [ 'data' => $simulationData, 'ineligibilityData' => $this->oneyRulesExtension->getReasonsOfIneligibility($cart), - ] + ], ); } @@ -44,7 +44,7 @@ public function __invoke(Request $request): Response private function renderSimulateForProductVariant( OrderInterface $cart, string $productVariantCode, - int $quantity + int $quantity, ): Response { $productVariant = $this->productVariantRepository->findOneBy(['code' => $productVariantCode]); Assert::isInstanceOf($productVariant, ProductVariantInterface::class); @@ -60,7 +60,7 @@ private function renderSimulateForProductVariant( $quantity, $channel, $cart->getLocaleCode(), - $cart->getCurrencyCode() + $cart->getCurrencyCode(), ); $simulationData = $this->oneySimulationDataProvider->getForCart($tempCart); @@ -70,7 +70,7 @@ private function renderSimulateForProductVariant( [ 'data' => $simulationData, 'ineligibilityData' => $this->oneyRulesExtension->getReasonsOfIneligibility($tempCart), - ] + ], ); } } diff --git a/src/Controller/OrderController.php b/src/Controller/OrderController.php index 7dd535df..00d6b292 100644 --- a/src/Controller/OrderController.php +++ b/src/Controller/OrderController.php @@ -45,7 +45,10 @@ #[AsController] final class OrderController extends BaseOrderController { + public $stateMachineFactory; + private const APPLE_ERROR_RESPONSE_CODE = 0; + private const APPLE_SUCCESS_RESPONSE_CODE = 1; public function __construct( @@ -68,7 +71,7 @@ public function __construct( ResourceDeleteHandlerInterface $resourceDeleteHandler, private ApplePayPaymentProvider $applePayPaymentProvider, private LockFactory $lockFactory, - private LoggerInterface $logger + private LoggerInterface $logger, ) { parent::__construct( $metadata, @@ -87,7 +90,7 @@ public function __construct( $eventDispatcher, $stateMachine, $resourceUpdateHandler, - $resourceDeleteHandler + $resourceDeleteHandler, ); } @@ -124,7 +127,7 @@ public function initiateApplePaySessionAction(Request $request): Response $postEventResponse = $postEvent->getResponse(); - if (null !== $postEventResponse) { + if ($postEventResponse instanceof \Symfony\Component\HttpFoundation\Response) { return $postEventResponse; } @@ -132,7 +135,7 @@ public function initiateApplePaySessionAction(Request $request): Response $initializeEventResponse = $initializeEvent->getResponse(); - if (null !== $initializeEventResponse) { + if ($initializeEventResponse instanceof \Symfony\Component\HttpFoundation\Response) { return $initializeEventResponse; } @@ -159,7 +162,7 @@ public function initiateApplePaySessionAction(Request $request): Response ]); return new JsonResponse([], Response::HTTP_BAD_REQUEST); - } catch (\Exception $exception) { + } catch (\Exception) { try { $this->applePayPaymentProvider->cancel($resource); } catch (\Throwable $throwable) { @@ -217,7 +220,7 @@ public function confirmApplePayPaymentAction(Request $request): Response if (PaymentInterface::STATE_COMPLETED !== $lastPayment->getState()) { throw new PaymentNotCompletedException(); } - } catch (\Exception|PaymentNotCompletedException $exception) { + } catch (\Exception | PaymentNotCompletedException $exception) { try { $this->applePayPaymentProvider->cancel($resource); } catch (\Throwable $throwable) { @@ -246,7 +249,7 @@ public function confirmApplePayPaymentAction(Request $request): Response $postEventResponse = $postEvent->getResponse(); - if (null !== $postEventResponse) { + if ($postEventResponse instanceof \Symfony\Component\HttpFoundation\Response) { return $postEventResponse; } @@ -254,7 +257,7 @@ public function confirmApplePayPaymentAction(Request $request): Response $initializeEventResponse = $initializeEvent->getResponse(); - if (null !== $initializeEventResponse) { + if ($initializeEventResponse instanceof \Symfony\Component\HttpFoundation\Response) { return $initializeEventResponse; } @@ -292,7 +295,7 @@ public function cancelApplePaySessionAction(Request $request): Response /** @var OrderInterface $resource */ $resource = $this->findOr404($configuration); - $lock = $this->lockFactory->createLock('apple_pay_cancel'.$resource->getId()); + $lock = $this->lockFactory->createLock('apple_pay_cancel' . $resource->getId()); $lock->acquire(true); /** @var ResourceControllerEvent $event */ @@ -318,7 +321,7 @@ public function cancelApplePaySessionAction(Request $request): Response $postEventResponse = $postEvent->getResponse(); - if (null !== $postEventResponse) { + if ($postEventResponse instanceof \Symfony\Component\HttpFoundation\Response) { return $postEventResponse; } @@ -326,7 +329,7 @@ public function cancelApplePaySessionAction(Request $request): Response $initializeEventResponse = $initializeEvent->getResponse(); - if (null !== $initializeEventResponse) { + if ($initializeEventResponse instanceof \Symfony\Component\HttpFoundation\Response) { return $initializeEventResponse; } diff --git a/src/Creator/PayPlugPaymentDataCreator.php b/src/Creator/PayPlugPaymentDataCreator.php index ab5d2935..2bd7db90 100644 --- a/src/Creator/PayPlugPaymentDataCreator.php +++ b/src/Creator/PayPlugPaymentDataCreator.php @@ -25,37 +25,29 @@ use Sylius\Component\Core\Model\PaymentInterface; use Sylius\Component\Core\Model\PaymentMethodInterface; use Sylius\Component\Core\Model\Shipment; -use Sylius\Component\Core\Model\ShipmentInterface; use Sylius\Component\Resource\Repository\RepositoryInterface; use Symfony\Component\HttpFoundation\RequestStack; class PayPlugPaymentDataCreator { private const DELIVERY_TYPE_BILLING = 'BILLING'; + private const DELIVERY_TYPE_NEW = 'NEW'; - private const PAYPLUG_CARD_ID_OTHER = 'other'; - private CanSaveCardCheckerInterface $canSaveCardChecker; - private RepositoryInterface $payplugCardRepository; - private RequestStack $requestStack; - private PayplugFeatureChecker $payplugFeatureChecker; + private const PAYPLUG_CARD_ID_OTHER = 'other'; public function __construct( - CanSaveCardCheckerInterface $canSaveCard, - RepositoryInterface $payplugCardRepository, - RequestStack $requestStack, - PayplugFeatureChecker $payplugFeatureChecker, + private CanSaveCardCheckerInterface $canSaveCardChecker, + private RepositoryInterface $payplugCardRepository, + private RequestStack $requestStack, + private PayplugFeatureChecker $payplugFeatureChecker, ) { - $this->canSaveCardChecker = $canSaveCard; - $this->payplugCardRepository = $payplugCardRepository; - $this->requestStack = $requestStack; - $this->payplugFeatureChecker = $payplugFeatureChecker; } public function create( PaymentInterface $payment, string $gatewayFactoryName, - array $context = [] + array $context = [], ): ArrayObject { /** @var OrderInterface $order */ $order = $payment->getOrder(); @@ -90,8 +82,10 @@ public function create( $paymentMethod = $payment->getMethod(); - if (PayPlugGatewayFactory::FACTORY_NAME === $gatewayFactoryName && - $paymentMethod instanceof PaymentMethodInterface) { + if ( + PayPlugGatewayFactory::FACTORY_NAME === $gatewayFactoryName && + $paymentMethod instanceof PaymentMethodInterface + ) { $details['allow_save_card'] = false; $details = $this->alterPayPlugDetailsForOneClick($paymentMethod, $details); $details = $this->alterPayPlugDetailsForDeferredCapture($paymentMethod, $details); @@ -155,7 +149,7 @@ private function formatLanguageCode(?string $languageCode): ?string private function loadPhoneNumbers( ?array $phoneData, ?string &$mobilePhone = null, - ?string &$landingPhone = null + ?string &$landingPhone = null, ): void { if (null === $phoneData) { return; @@ -175,12 +169,12 @@ private function addBillingInfo( AddressInterface $billing, CustomerInterface $customer, OrderInterface $order, - ArrayObject &$details + ArrayObject &$details, ): void { //Sylius does not require any phone number so we have to considere it null $billingPhone = null !== $billing->getPhoneNumber() ? $this->formatNumber( $billing->getPhoneNumber(), - $billing->getCountryCode() + $billing->getCountryCode(), ) : null; $this->loadPhoneNumbers($billingPhone, $billingMobilePhone, $billingLandingPhone); @@ -207,11 +201,11 @@ private function addShippingInfo( CustomerInterface $customer, OrderInterface $order, string $deliveryType, - ArrayObject &$details + ArrayObject &$details, ): void { $shippingPhone = null !== $shipping->getPhoneNumber() ? $this->formatNumber( $shipping->getPhoneNumber(), - $shipping->getCountryCode() + $shipping->getCountryCode(), ) : null; $this->loadPhoneNumbers($shippingPhone, $shippingMobilePhone, $shippingLandingPhone); @@ -234,8 +228,10 @@ private function addShippingInfo( ]; } - private function alterPayPlugDetailsForOneClick(PaymentMethodInterface $paymentMethod, ArrayObject $details): ArrayObject - { + private function alterPayPlugDetailsForOneClick( + PaymentMethodInterface $paymentMethod, + ArrayObject $details, + ): ArrayObject { if (!$this->canSaveCardChecker->isAllowed($paymentMethod)) { return $details; } @@ -243,9 +239,11 @@ private function alterPayPlugDetailsForOneClick(PaymentMethodInterface $paymentM /** @var string|null $cardId */ $cardId = $this->requestStack->getSession()->get('payplug_payment_method'); - if ((null === $cardId || self::PAYPLUG_CARD_ID_OTHER === $cardId) && $this->canSaveCardChecker->isAllowed( - $paymentMethod - )) { + if ( + (null === $cardId || self::PAYPLUG_CARD_ID_OTHER === $cardId) && $this->canSaveCardChecker->isAllowed( + $paymentMethod, + ) + ) { $details['allow_save_card'] = true; return $details; @@ -267,8 +265,10 @@ private function alterPayPlugDetailsForOneClick(PaymentMethodInterface $paymentM return $details; } - private function alterPayPlugDetailsForDeferredCapture(PaymentMethodInterface $paymentMethod, ArrayObject $details): ArrayObject - { + private function alterPayPlugDetailsForDeferredCapture( + PaymentMethodInterface $paymentMethod, + ArrayObject $details, + ): ArrayObject { if (!$this->payplugFeatureChecker->isDeferredCaptureEnabled($paymentMethod)) { return $details; } @@ -307,7 +307,7 @@ private function getCartContext(OrderInterface $order): array $shipment = $order->getShipments()->current(); $expectedDeliveryDate = (new DateTime())->add(new DateInterval('P7D'))->format('Y-m-d'); - $deliveryType = $this->retrieveDeliveryType($shipment); + $deliveryType = $this->retrieveDeliveryType(); $data = []; foreach ($order->getItems() as $orderItem) { @@ -318,7 +318,7 @@ private function getCartContext(OrderInterface $order): array 'merchant_item_id' => (null !== $orderItem->getVariant()) ? $orderItem->getVariant()->getCode( ) : 'none', 'brand' => $orderItem->getProductName(), - 'name' => $orderItem->getProductName().' '.$orderItem->getVariantName(), + 'name' => $orderItem->getProductName() . ' ' . $orderItem->getVariantName(), 'total_amount' => $orderItem->getTotal(), 'price' => $orderItem->getUnitPrice(), 'quantity' => $orderItem->getQuantity(), @@ -331,7 +331,7 @@ private function getCartContext(OrderInterface $order): array /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - private function retrieveDeliveryType(ShipmentInterface $shipment): string + private function retrieveDeliveryType(): string { // Possible delivery type : [storepickup, networkpickup, travelpickup, carrier, edelivery] return 'storepickup'; diff --git a/src/Creator/RefundUnitsCommandCreatorDecorator.php b/src/Creator/RefundUnitsCommandCreatorDecorator.php index 9cadccdf..498e38dd 100644 --- a/src/Creator/RefundUnitsCommandCreatorDecorator.php +++ b/src/Creator/RefundUnitsCommandCreatorDecorator.php @@ -18,9 +18,7 @@ use Sylius\RefundPlugin\Converter\Request\RequestToRefundUnitsConverterInterface; use Sylius\RefundPlugin\Creator\RequestCommandCreatorInterface; use Sylius\RefundPlugin\Exception\InvalidRefundAmount; -use Sylius\RefundPlugin\Model\OrderItemUnitRefund; use Sylius\RefundPlugin\Model\RefundType; -use Sylius\RefundPlugin\Model\ShipmentRefund; use Sylius\RefundPlugin\Model\UnitRefundInterface; use Symfony\Component\DependencyInjection\Attribute\AsDecorator; use Symfony\Component\DependencyInjection\Attribute\Autowire; @@ -42,7 +40,7 @@ public function __construct( private PaymentMethodRepositoryInterface $paymentMethodRepository, private OrderRepositoryInterface $orderRepository, private TranslatorInterface $translator, - private PayPlugApiClientInterface $oneyClient + private PayPlugApiClientInterface $oneyClient, ) { } @@ -56,7 +54,6 @@ public function fromRequest(Request $request): RefundUnits $request->request->has('sylius_refund_units') ? $request->request->all()['sylius_refund_units'] : [], /* @phpstan-ignore-next-line */ RefundType::orderItemUnit(), - OrderItemUnitRefund::class, ); /** @phpstan-ignore-next-line */ @@ -64,7 +61,6 @@ public function fromRequest(Request $request): RefundUnits $request->request->has('sylius_refund_shipments') ? $request->request->all()['sylius_refund_shipments'] : [], /* @phpstan-ignore-next-line */ RefundType::shipment(), - ShipmentRefund::class, ); $units = array_merge($units, $shipments); @@ -72,7 +68,7 @@ public function fromRequest(Request $request): RefundUnits $units = $this->requestToRefundUnitsConverter->convert($request); } - if (0 === count($units)) { + if ([] === $units) { throw InvalidRefundAmount::withValidationConstraint('sylius_refund.at_least_one_unit_should_be_selected_to_refund'); } @@ -85,8 +81,10 @@ public function fromRequest(Request $request): RefundUnits /** @var GatewayConfigInterface $gateway */ $gateway = $paymentMethod->getGatewayConfig(); - if (PayPlugGatewayFactory::FACTORY_NAME !== $gateway->getFactoryName() && - OneyGatewayFactory::FACTORY_NAME !== $gateway->getFactoryName()) { + if ( + PayPlugGatewayFactory::FACTORY_NAME !== $gateway->getFactoryName() && + OneyGatewayFactory::FACTORY_NAME !== $gateway->getFactoryName() + ) { return $this->decorated->fromRequest($request); /** @phpstan-ignore-line */ } @@ -135,8 +133,10 @@ private function canOneyRefundBeMade(OrderInterface $order): void $now = new \DateTime(); - if ($now->getTimestamp() < $data->refundable_until && - $now->getTimestamp() > $data->refundable_after) { + if ( + $now->getTimestamp() < $data->refundable_until && + $now->getTimestamp() > $data->refundable_after + ) { return; } diff --git a/src/Entity/Card.php b/src/Entity/Card.php index ac7c631a..147bdaeb 100644 --- a/src/Entity/Card.php +++ b/src/Entity/Card.php @@ -12,6 +12,7 @@ /** * @ORM\Entity() + * * @ORM\Table("payplug_cards") */ #[ORM\Entity] @@ -20,8 +21,11 @@ class Card implements ResourceInterface { /** * @var int + * * @ORM\Id() + * * @ORM\GeneratedValue() + * * @ORM\Column(type="integer") */ #[ORM\Id] @@ -31,6 +35,7 @@ class Card implements ResourceInterface /** * @var string + * * @ORM\Column(name="external_id", type="string", nullable=false) */ #[ORM\Column(name: 'external_id', type: Types::STRING, nullable: false)] @@ -38,6 +43,7 @@ class Card implements ResourceInterface /** * @var string + * * @ORM\Column(name="last4", type="string") */ #[ORM\Column(name: 'last4', type: Types::STRING)] @@ -45,6 +51,7 @@ class Card implements ResourceInterface /** * @var string + * * @ORM\Column(name="country", type="string") */ #[ORM\Column(name: 'country', type: Types::STRING)] @@ -52,6 +59,7 @@ class Card implements ResourceInterface /** * @var int + * * @ORM\Column(name="exp_month", type="integer") */ #[ORM\Column(name: 'exp_month', type: Types::INTEGER)] @@ -59,6 +67,7 @@ class Card implements ResourceInterface /** * @var int + * * @ORM\Column(name="exp_year", type="integer") */ #[ORM\Column(name: 'exp_year', type: Types::INTEGER)] @@ -66,6 +75,7 @@ class Card implements ResourceInterface /** * @var string + * * @ORM\Column(name="brand", type="string") */ #[ORM\Column(name: 'brand', type: Types::STRING)] @@ -73,6 +83,7 @@ class Card implements ResourceInterface /** * @var bool + * * @ORM\Column(name="is_live", type="boolean") */ #[ORM\Column(name: 'is_live', type: Types::BOOLEAN)] @@ -80,7 +91,9 @@ class Card implements ResourceInterface /** * @var CustomerInterface + * * @ORM\ManyToOne(targetEntity=\Sylius\Component\Customer\Model\CustomerInterface::class, inversedBy="cards") + * * @ORM\JoinColumn(nullable=false) */ #[ORM\ManyToOne(targetEntity: CustomerInterface::class, inversedBy: 'cards')] @@ -89,7 +102,9 @@ class Card implements ResourceInterface /** * @var \Sylius\Component\Core\Model\PaymentMethodInterface + * * @ORM\ManyToOne(targetEntity=\Sylius\Component\Core\Model\PaymentMethodInterface::class, inversedBy="cards") + * * @ORM\JoinColumn(nullable=false) */ #[ORM\ManyToOne(targetEntity: PaymentMethodInterface::class, inversedBy: 'cards')] diff --git a/src/Entity/RefundHistory.php b/src/Entity/RefundHistory.php index 9317ee75..6928ee08 100644 --- a/src/Entity/RefundHistory.php +++ b/src/Entity/RefundHistory.php @@ -16,6 +16,7 @@ /** * @ORM\Entity() + * * @ORM\Table("payplug_refund_history") */ #[ORM\Entity] @@ -24,8 +25,11 @@ class RefundHistory implements ResourceInterface { /** * @var int + * * @ORM\Id() + * * @ORM\GeneratedValue() + * * @ORM\Column(type="integer") */ #[ORM\Id] @@ -35,7 +39,9 @@ class RefundHistory implements ResourceInterface /** * @var RefundPayment|null + * * @ORM\OneToOne(targetEntity="Sylius\RefundPlugin\Entity\RefundPayment") + * * @ORM\JoinColumn(name="refund_payment_id", nullable=true) */ #[ORM\OneToOne(targetEntity: RefundPayment::class)] @@ -44,6 +50,7 @@ class RefundHistory implements ResourceInterface /** * @var string|null + * * @ORM\Column(type="string", nullable=true) */ #[ORM\Column(type: Types::STRING, nullable: true)] @@ -51,7 +58,9 @@ class RefundHistory implements ResourceInterface /** * @var PaymentInterface|null + * * @ORM\ManyToOne(targetEntity="\Sylius\Component\Core\Model\PaymentInterface", inversedBy="refundHistories") + * * @ORM\JoinColumn(name="payment_id", referencedColumnName="id", nullable=true, onDelete="SET NULL") */ #[ORM\ManyToOne(targetEntity: PaymentInterface::class, inversedBy: 'refundHistories')] @@ -60,6 +69,7 @@ class RefundHistory implements ResourceInterface /** * @var int + * * @ORM\Column(type="integer", nullable=true) */ #[ORM\Column(type: Types::INTEGER, nullable: true)] @@ -67,6 +77,7 @@ class RefundHistory implements ResourceInterface /** * @var bool + * * @ORM\Column(type="boolean") */ #[ORM\Column(type: Types::BOOLEAN)] @@ -74,6 +85,7 @@ class RefundHistory implements ResourceInterface /** * @var DateTimeInterface + * * @ORM\Column(type="datetime") */ #[ORM\Column(type: Types::DATETIME_MUTABLE)] diff --git a/src/Entity/Traits/CustomerTrait.php b/src/Entity/Traits/CustomerTrait.php index 20609c82..a445f6f5 100644 --- a/src/Entity/Traits/CustomerTrait.php +++ b/src/Entity/Traits/CustomerTrait.php @@ -13,6 +13,7 @@ trait CustomerTrait { /** * @ORM\OneToMany(targetEntity=Card::class, mappedBy="customer", orphanRemoval=true) + * * @ORM\OrderBy({"id" = "DESC"}) */ #[ORM\OneToMany(targetEntity: Card::class, mappedBy: 'customer', orphanRemoval: true)] @@ -26,8 +27,10 @@ public function getCards(): Collection { return $this->cards->filter(function (Card $card): bool { $secretKeyPrefix = \substr($card->getPaymentMethod()->getGatewayConfig()->getConfig()['secretKey'], 0, 7); - if (($card->isLive() && PayPlugApiClientInterface::LIVE_KEY_PREFIX === $secretKeyPrefix) || - (!$card->isLive() && PayPlugApiClientInterface::TEST_KEY_PREFIX === $secretKeyPrefix)) { + if ( + ($card->isLive() && PayPlugApiClientInterface::LIVE_KEY_PREFIX === $secretKeyPrefix) || + (!$card->isLive() && PayPlugApiClientInterface::TEST_KEY_PREFIX === $secretKeyPrefix) + ) { return true; } diff --git a/src/Entity/Traits/PaymentMethodTrait.php b/src/Entity/Traits/PaymentMethodTrait.php index f5c2d819..2ba4c6e1 100644 --- a/src/Entity/Traits/PaymentMethodTrait.php +++ b/src/Entity/Traits/PaymentMethodTrait.php @@ -11,9 +11,7 @@ trait PaymentMethodTrait { - /** - * @ORM\OneToMany(targetEntity=Card::class, mappedBy="paymentMethod", orphanRemoval=true) - */ + /** @ORM\OneToMany(targetEntity=Card::class, mappedBy="paymentMethod", orphanRemoval=true) */ #[ORM\OneToMany(targetEntity: Card::class, mappedBy: 'paymentMethod', orphanRemoval: true)] protected $cards; @@ -24,8 +22,10 @@ public function getCards(): Collection { return $this->cards->filter(function (Card $card): bool { $secretKeyPrefix = \substr($card->getPaymentMethod()->getGatewayConfig()->getConfig()['secretKey'], 0, 7); - if (($card->isLive() && PayPlugApiClientInterface::LIVE_KEY_PREFIX === $secretKeyPrefix) || - (!$card->isLive() && PayPlugApiClientInterface::TEST_KEY_PREFIX === $secretKeyPrefix)) { + if ( + ($card->isLive() && PayPlugApiClientInterface::LIVE_KEY_PREFIX === $secretKeyPrefix) || + (!$card->isLive() && PayPlugApiClientInterface::TEST_KEY_PREFIX === $secretKeyPrefix) + ) { return true; } diff --git a/src/Entity/Traits/PaymentTrait.php b/src/Entity/Traits/PaymentTrait.php index 0952f350..16bd7acb 100644 --- a/src/Entity/Traits/PaymentTrait.php +++ b/src/Entity/Traits/PaymentTrait.php @@ -9,9 +9,7 @@ trait PaymentTrait { - /** - * @ORM\OneToMany(targetEntity=RefundHistory::class, mappedBy="payment", orphanRemoval=true) - */ + /** @ORM\OneToMany(targetEntity=RefundHistory::class, mappedBy="payment", orphanRemoval=true) */ #[ORM\OneToMany(targetEntity: RefundHistory::class, mappedBy: 'payment', orphanRemoval: true)] protected $refundHistories; } diff --git a/src/EventSubscriber/DisplayOneyGatewayFormEventSubscriber.php b/src/EventSubscriber/DisplayOneyGatewayFormEventSubscriber.php index 7749d819..fd9bce68 100644 --- a/src/EventSubscriber/DisplayOneyGatewayFormEventSubscriber.php +++ b/src/EventSubscriber/DisplayOneyGatewayFormEventSubscriber.php @@ -13,22 +13,11 @@ final class DisplayOneyGatewayFormEventSubscriber implements EventSubscriberInterface { - /** @var \Sylius\Component\Resource\Repository\RepositoryInterface */ - private $paymentMethodRepository; - - /** @var \PayPlug\SyliusPayPlugPlugin\Checker\OneyCheckerInterface */ - private $oneyChecker; - - private RequestStack $requestStack; - public function __construct( - RepositoryInterface $paymentMethodRepository, - OneyCheckerInterface $oneyChecker, - RequestStack $requestStack + private RepositoryInterface $paymentMethodRepository, + private OneyCheckerInterface $oneyChecker, + private RequestStack $requestStack, ) { - $this->paymentMethodRepository = $paymentMethodRepository; - $this->oneyChecker = $oneyChecker; - $this->requestStack = $requestStack; } public static function getSubscribedEvents(): array @@ -50,13 +39,15 @@ public function handle(KernelEvent $event): void return; } - if (false === $subject->isEnabled() || + if ( + false === $subject->isEnabled() || null === $subject->getGatewayConfig() || - OneyGatewayFactory::FACTORY_NAME !== $subject->getGatewayConfig()->getFactoryName()) { + OneyGatewayFactory::FACTORY_NAME !== $subject->getGatewayConfig()->getFactoryName() + ) { return; } - if (true === $this->oneyChecker->isEnabled()) { + if ($this->oneyChecker->isEnabled()) { // Oney still enabled, do nothing return; } diff --git a/src/EventSubscriber/PostPaymentSelectEventSubscriber.php b/src/EventSubscriber/PostPaymentSelectEventSubscriber.php index c33946b4..4b8e2e68 100644 --- a/src/EventSubscriber/PostPaymentSelectEventSubscriber.php +++ b/src/EventSubscriber/PostPaymentSelectEventSubscriber.php @@ -5,8 +5,6 @@ namespace PayPlug\SyliusPayPlugPlugin\EventSubscriber; use Doctrine\ORM\EntityManagerInterface; -use PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientInterface; -use SM\Factory\FactoryInterface; use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\Model\PaymentInterface; @@ -20,7 +18,10 @@ final class PostPaymentSelectEventSubscriber implements EventSubscriberInterface { + public $stateMachineFactory; + private const CHECKOUT_ROUTE = 'sylius_shop_checkout_select_payment'; + private const UPDATE_ORDER_PAYMENT_ROUTE = 'sylius_shop_order_show'; private const TOKEN_FIELD = 'payplug_integrated_payment_token'; @@ -63,10 +64,11 @@ public function alterRequestConfigurationForIntegratedPayment(RequestEvent $even $request->attributes->set('_sylius', $syliusRequestConfig); } + public function handle(ResourceControllerEvent $resourceControllerEvent): void { $request = $this->requestStack->getCurrentRequest(); - if (null === $request) { + if (!$request instanceof \Symfony\Component\HttpFoundation\Request) { return; } @@ -83,7 +85,6 @@ public function handle(ResourceControllerEvent $resourceControllerEvent): void if (!$this->hasToken($request)) { return; - } $this->handleToken($resourceControllerEvent, $request, $lastPayment); } @@ -100,7 +101,7 @@ private function handleToken( [ 'payment_id' => $token, 'status' => PaymentInterface::STATE_PROCESSING, - ] + ], )); $resource = $resourceControllerEvent->getSubject(); diff --git a/src/Form/Extension/PaymentTypeExtension.php b/src/Form/Extension/PaymentTypeExtension.php index 958e0bdf..b256078a 100644 --- a/src/Form/Extension/PaymentTypeExtension.php +++ b/src/Form/Extension/PaymentTypeExtension.php @@ -23,26 +23,12 @@ final class PaymentTypeExtension extends AbstractTypeExtension { - /** @var \Symfony\Contracts\Translation\TranslatorInterface */ - private $translator; - - /** @var \PayPlug\SyliusPayPlugPlugin\Checker\OneyOrderChecker */ - private $orderChecker; - - private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider; - - private RequestStack $requestStack; - public function __construct( - RequestStack $requestStack, - TranslatorInterface $translator, - OneyOrderChecker $orderChecker, - OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider + private RequestStack $requestStack, + private TranslatorInterface $translator, + private OneyOrderChecker $orderChecker, + private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider, ) { - $this->requestStack = $requestStack; - $this->translator = $translator; - $this->orderChecker = $orderChecker; - $this->oneySupportedPaymentChoiceProvider = $oneySupportedPaymentChoiceProvider; } /** @@ -50,7 +36,7 @@ public function __construct( */ public function buildForm( FormBuilderInterface $builder, - array $options + array $options, ): void { $builder ->add('oney_payment_choice', ChoiceType::class, [ @@ -79,8 +65,10 @@ public function buildForm( return; } - if (PayPlugGatewayFactory::FACTORY_NAME === $paymentMethod->getGatewayConfig()->getFactoryName() && - (false === $event->getForm()->has('payplug_card_choice') || null === $event->getForm()->get('payplug_card_choice')->getData())) { + if ( + PayPlugGatewayFactory::FACTORY_NAME === $paymentMethod->getGatewayConfig()->getFactoryName() && + (false === $event->getForm()->has('payplug_card_choice') || null === $event->getForm()->get('payplug_card_choice')->getData()) + ) { return; } @@ -91,8 +79,10 @@ public function buildForm( return; } - if (OneyGatewayFactory::FACTORY_NAME !== $paymentMethod->getGatewayConfig()->getFactoryName() || - false === $event->getForm()->has('oney_payment_choice')) { + if ( + OneyGatewayFactory::FACTORY_NAME !== $paymentMethod->getGatewayConfig()->getFactoryName() || + false === $event->getForm()->has('oney_payment_choice') + ) { return; } @@ -106,12 +96,12 @@ public function buildForm( $errors = []; if (!$this->orderChecker->isOrderInfoCorrect($order)) { $errors[] = new FormError( - $this->translator->trans('payplug_sylius_payplug_plugin.form.oney_error') + $this->translator->trans('payplug_sylius_payplug_plugin.form.oney_error'), ); } // Possible other checks here - if (\count($errors) > 0) { + if ($errors !== []) { \array_walk($errors, static function (FormError $error) use ($event): void { $event->getForm()->get('method')->addError($error); }); diff --git a/src/Gateway/AbstractGatewayFactory.php b/src/Gateway/AbstractGatewayFactory.php index ed40c9b7..8d7f4d11 100644 --- a/src/Gateway/AbstractGatewayFactory.php +++ b/src/Gateway/AbstractGatewayFactory.php @@ -25,7 +25,7 @@ protected function populateConfig(ArrayObject $config): void 'payum.http_client' => '@payplug_sylius_payplug_plugin.api_client.payplug', ]); - if (false !== (bool) $config['payum.api']) { + if ((bool) $config['payum.api']) { return; } diff --git a/src/Gateway/Form/Extension/PayPlugGatewayConfigurationTypeExtension.php b/src/Gateway/Form/Extension/PayPlugGatewayConfigurationTypeExtension.php index dd370b6d..3853b5b1 100644 --- a/src/Gateway/Form/Extension/PayPlugGatewayConfigurationTypeExtension.php +++ b/src/Gateway/Form/Extension/PayPlugGatewayConfigurationTypeExtension.php @@ -18,11 +18,8 @@ final class PayPlugGatewayConfigurationTypeExtension extends AbstractTypeExtension { - private TranslatorInterface $translator; - - public function __construct(TranslatorInterface $translator) + public function __construct(private TranslatorInterface $translator) { - $this->translator = $translator; } /** diff --git a/src/Gateway/Form/Type/AbstractGatewayConfigurationType.php b/src/Gateway/Form/Type/AbstractGatewayConfigurationType.php index d8871100..bd38092c 100644 --- a/src/Gateway/Form/Type/AbstractGatewayConfigurationType.php +++ b/src/Gateway/Form/Type/AbstractGatewayConfigurationType.php @@ -26,10 +26,6 @@ class AbstractGatewayConfigurationType extends AbstractType { public const VALIDATION_GROUPS = ['Default', 'sylius']; - protected TranslatorInterface $translator; - - protected RequestStack $requestStack; - protected string $noTestKeyMessage = ''; protected string $noAccessMessage = ''; @@ -40,16 +36,11 @@ class AbstractGatewayConfigurationType extends AbstractType protected string $gatewayBaseCurrencyCode = 'EUR'; - private RepositoryInterface $gatewayConfigRepository; - public function __construct( - TranslatorInterface $translator, - RepositoryInterface $gatewayConfigRepository, - RequestStack $requestStack + protected TranslatorInterface $translator, + private RepositoryInterface $gatewayConfigRepository, + protected RequestStack $requestStack, ) { - $this->translator = $translator; - $this->gatewayConfigRepository = $gatewayConfigRepository; - $this->requestStack = $requestStack; } /** @@ -79,7 +70,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void $this->checkCreationRequirements( $this->gatewayFactoryTitle, $this->gatewayFactoryName, - $event->getForm() + $event->getForm(), ); /** @phpstan-ignore-next-line */ @@ -101,7 +92,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void [ '#channel_code#' => $dataFormChannel->getCode(), '#payment_method#' => $this->gatewayFactoryTitle, - ] + ], ); $formChannels->get((string) $key)->addError(new FormError($message)); $this->requestStack->getSession()->getFlashBag()->add('error', $message); @@ -121,7 +112,7 @@ private function canBeCreated(string $factoryName): bool private function checkCreationRequirements( string $factoryTitle, string $factoryName, - FormInterface $form + FormInterface $form, ): void { /** @phpstan-ignore-next-line */ $paymentMethod = $form->getParent()->getParent()->getData(); diff --git a/src/Gateway/PayPlugGatewayFactory.php b/src/Gateway/PayPlugGatewayFactory.php index f078acb9..a6aa1f7a 100644 --- a/src/Gateway/PayPlugGatewayFactory.php +++ b/src/Gateway/PayPlugGatewayFactory.php @@ -7,11 +7,14 @@ final class PayPlugGatewayFactory extends AbstractGatewayFactory { public const FACTORY_NAME = 'payplug'; + public const FACTORY_TITLE = 'PayPlug'; // Custom gateway configuration keys public const ONE_CLICK = 'oneClick'; + public const INTEGRATED_PAYMENT = 'integratedPayment'; + public const DEFERRED_CAPTURE = 'deferredCapture'; public const AUTHORIZED_CURRENCIES = [ diff --git a/src/Gateway/Validator/Constraints/IsCanSaveCardsValidator.php b/src/Gateway/Validator/Constraints/IsCanSaveCardsValidator.php index d520d65a..0923aa9b 100644 --- a/src/Gateway/Validator/Constraints/IsCanSaveCardsValidator.php +++ b/src/Gateway/Validator/Constraints/IsCanSaveCardsValidator.php @@ -15,16 +15,13 @@ /** * @Annotation + * * @deprecated Use PayplugPermission constraint instead */ final class IsCanSaveCardsValidator extends ConstraintValidator { - /** @var PayPlugApiClientFactory */ - private $apiClientFactory; - - public function __construct(PayPlugApiClientFactory $apiClientFactory) + public function __construct(private PayPlugApiClientFactory $apiClientFactory) { - $this->apiClientFactory = $apiClientFactory; } public function validate($value, Constraint $constraint): void @@ -42,7 +39,7 @@ public function validate($value, Constraint $constraint): void $secretKey = $this->context->getRoot()->getData()->getGatewayConfig()->getConfig()['secretKey']; try { - if (true === $value) { + if ($value) { $checker = new PermissionCanSaveCardsChecker($this->apiClientFactory->create(PayPlugGatewayFactory::FACTORY_NAME, $secretKey)); if (false === $checker->isEnabled()) { $this->context->buildViolation($constraint->message)->addViolation(); @@ -50,7 +47,7 @@ public function validate($value, Constraint $constraint): void } return; - } catch (UnauthorizedException|\LogicException $exception) { + } catch (UnauthorizedException | \LogicException) { return; } } diff --git a/src/Gateway/Validator/Constraints/IsCanSavePaymentMethodValidator.php b/src/Gateway/Validator/Constraints/IsCanSavePaymentMethodValidator.php index bd3c67b0..0f591c8b 100644 --- a/src/Gateway/Validator/Constraints/IsCanSavePaymentMethodValidator.php +++ b/src/Gateway/Validator/Constraints/IsCanSavePaymentMethodValidator.php @@ -19,13 +19,10 @@ */ final class IsCanSavePaymentMethodValidator extends ConstraintValidator { - private PayPlugApiClientFactory $apiClientFactory; - private const GATEWAYS_SKIP = [PayPlugGatewayFactory::FACTORY_NAME, OneyGatewayFactory::FACTORY_NAME]; - public function __construct(PayPlugApiClientFactory $apiClientFactory) + public function __construct(private PayPlugApiClientFactory $apiClientFactory) { - $this->apiClientFactory = $apiClientFactory; } public function validate($value, Constraint $constraint): void @@ -60,7 +57,7 @@ public function validate($value, Constraint $constraint): void } return; - } catch (UnauthorizedException|\LogicException $exception) { + } catch (UnauthorizedException | \LogicException) { return; } } diff --git a/src/Gateway/Validator/Constraints/IsOneyEnabledValidator.php b/src/Gateway/Validator/Constraints/IsOneyEnabledValidator.php index c8a2595d..8df285d1 100644 --- a/src/Gateway/Validator/Constraints/IsOneyEnabledValidator.php +++ b/src/Gateway/Validator/Constraints/IsOneyEnabledValidator.php @@ -19,12 +19,8 @@ final class IsOneyEnabledValidator extends ConstraintValidator { - /** @var PayPlugApiClientFactory */ - private $apiClientFactory; - - public function __construct(PayPlugApiClientFactory $apiClientFactory) + public function __construct(private PayPlugApiClientFactory $apiClientFactory) { - $this->apiClientFactory = $apiClientFactory; } public function validate($value, Constraint $constraint): void @@ -66,7 +62,7 @@ public function validate($value, Constraint $constraint): void $this->context->buildViolation($constraint->message) ->addViolation(); } - } catch (UnauthorizedException $exception) { + } catch (UnauthorizedException) { // do nothing, this should be handle by IsPayPlugSecretKeyValid Constraint return; } diff --git a/src/Gateway/Validator/Constraints/IsPayPlugSecretKeyValidator.php b/src/Gateway/Validator/Constraints/IsPayPlugSecretKeyValidator.php index 1ad9df0f..61007bba 100644 --- a/src/Gateway/Validator/Constraints/IsPayPlugSecretKeyValidator.php +++ b/src/Gateway/Validator/Constraints/IsPayPlugSecretKeyValidator.php @@ -17,12 +17,8 @@ */ final class IsPayPlugSecretKeyValidator extends ConstraintValidator { - /** @var PayPlugApiClientFactory */ - private $apiClientFactory; - - public function __construct(PayPlugApiClientFactory $apiClientFactory) + public function __construct(private PayPlugApiClientFactory $apiClientFactory) { - $this->apiClientFactory = $apiClientFactory; } public function validate($value, Constraint $constraint): void @@ -42,7 +38,7 @@ public function validate($value, Constraint $constraint): void \Payplug\Authentication::getPermissions(); $apiClient = $this->apiClientFactory->create(PayPlugGatewayFactory::FACTORY_NAME, $value); $apiClient->getAccount(true); - } catch (UnauthorizedException $exception) { + } catch (UnauthorizedException) { $this->context->buildViolation($constraint->message) ->addViolation(); } diff --git a/src/Gateway/Validator/Constraints/PayplugPermission.php b/src/Gateway/Validator/Constraints/PayplugPermission.php index 90346e24..dc57db67 100644 --- a/src/Gateway/Validator/Constraints/PayplugPermission.php +++ b/src/Gateway/Validator/Constraints/PayplugPermission.php @@ -1,5 +1,7 @@ apiClientFactory = $apiClientFactory; } public function validate(mixed $value, Constraint $constraint): void @@ -53,7 +49,7 @@ public function validate(mixed $value, Constraint $constraint): void } return; - } catch (UnauthorizedException|\LogicException $exception) { + } catch (UnauthorizedException | \LogicException) { return; } } diff --git a/src/Handler/PaymentNotificationHandler.php b/src/Handler/PaymentNotificationHandler.php index 2cf315b6..edb322ba 100644 --- a/src/Handler/PaymentNotificationHandler.php +++ b/src/Handler/PaymentNotificationHandler.php @@ -32,17 +32,20 @@ public function __construct( private CustomerRepositoryInterface $customerRepository, private EntityManagerInterface $entityManager, private LockFactory $lockFactory, - private RequestStack $requestStack + private RequestStack $requestStack, ) { } - public function treat(PaymentInterface $payment, IVerifiableAPIResource $paymentResource, \ArrayObject $details): void - { + public function treat( + PaymentInterface $payment, + IVerifiableAPIResource $paymentResource, + \ArrayObject $details, + ): void { if (!$paymentResource instanceof Payment) { return; } - $lock = $this->lockFactory->createLock('payment_'.$paymentResource->id); + $lock = $this->lockFactory->createLock('payment_' . $paymentResource->id); $lock->acquire(true); $this->entityManager->refresh($payment); @@ -121,9 +124,11 @@ private function saveCard(PaymentInterface $payment, IVerifiableAPIResource $pay return; } - if (!$paymentResource->__isset('card') || + if ( + !$paymentResource->__isset('card') || null === $paymentResource->__get('card') || - (null !== $paymentResource->__get('card') && null === $paymentResource->__get('card')->id)) { + (null !== $paymentResource->__get('card') && null === $paymentResource->__get('card')->id) + ) { return; } @@ -170,22 +175,18 @@ private function isResourceIsAuthorized(IVerifiableAPIResource $paymentResource) } // Oney is reviewing the payer’s file - if ($paymentResource->__isset('payment_method') && + if ( + $paymentResource->__isset('payment_method') && null !== $paymentResource->__get('payment_method') && \array_key_exists('is_pending', $paymentResource->__get('payment_method')) && - true === $paymentResource->__get('payment_method')['is_pending']) { + true === $paymentResource->__get('payment_method')['is_pending'] + ) { return true; } $now = new DateTimeImmutable(); - if ($paymentResource->__isset('authorization') && - $paymentResource->__get('authorization') instanceof PaymentAuthorization && - null !== $paymentResource->__get('authorization')->__get('expires_at') && - $now < $now->setTimestamp($paymentResource->__get('authorization')->__get('expires_at'))) { - return true; - } - return false; + return $paymentResource->__isset('authorization') && $paymentResource->__get('authorization') instanceof PaymentAuthorization && null !== $paymentResource->__get('authorization')->__get('expires_at') && $now < $now->setTimestamp($paymentResource->__get('authorization')->__get('expires_at')); } private function isRefusedOneyPayment(IVerifiableAPIResource $paymentResource): bool @@ -195,16 +196,6 @@ private function isRefusedOneyPayment(IVerifiableAPIResource $paymentResource): } // Oney has reviewed the payer’s file and refused it - if (!$paymentResource->is_paid && - $paymentResource->__isset('payment_method') && - null !== $paymentResource->__get('payment_method') && - \array_key_exists('is_pending', $paymentResource->__get('payment_method')) && - false === $paymentResource->__get('payment_method')['is_pending'] && - \in_array($paymentResource->__get('payment_method')['type'], OneyGatewayFactory::PAYMENT_CHOICES, true) - ) { - return true; - } - - return false; + return !$paymentResource->is_paid && $paymentResource->__isset('payment_method') && null !== $paymentResource->__get('payment_method') && \array_key_exists('is_pending', $paymentResource->__get('payment_method')) && false === $paymentResource->__get('payment_method')['is_pending'] && \in_array($paymentResource->__get('payment_method')['type'], OneyGatewayFactory::PAYMENT_CHOICES, true); } } diff --git a/src/Handler/RefundNotificationHandler.php b/src/Handler/RefundNotificationHandler.php index 5a477a1c..18d3c173 100644 --- a/src/Handler/RefundNotificationHandler.php +++ b/src/Handler/RefundNotificationHandler.php @@ -18,12 +18,15 @@ class RefundNotificationHandler public function __construct( private RefundHistoryRepositoryInterface $payplugRefundHistoryRepository, private RefundPaymentHandlerInterface $refundPaymentHandler, - private MessageBusInterface $commandBus + private MessageBusInterface $commandBus, ) { } - public function treat(PaymentInterface $payment, IVerifiableAPIResource $refundResource, \ArrayObject $details): void - { + public function treat( + PaymentInterface $payment, + IVerifiableAPIResource $refundResource, + \ArrayObject $details, + ): void { if (!$refundResource instanceof Refund) { return; } diff --git a/src/MessageHandler/RefundPaymentGeneratedHandler.php b/src/MessageHandler/RefundPaymentGeneratedHandler.php index 73599004..5cc222e2 100644 --- a/src/MessageHandler/RefundPaymentGeneratedHandler.php +++ b/src/MessageHandler/RefundPaymentGeneratedHandler.php @@ -18,7 +18,6 @@ use PayPlug\SyliusPayPlugPlugin\Repository\RefundHistoryRepositoryInterface; use Payum\Core\Model\GatewayConfigInterface; use Psr\Log\LoggerInterface; -use SM\Factory\FactoryInterface; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\Model\PaymentInterface; use Sylius\Component\Core\Model\PaymentMethodInterface; @@ -36,6 +35,8 @@ final class RefundPaymentGeneratedHandler { + public $stateMachineFactory; + public function __construct( private EntityManagerInterface $entityManager, private PaymentRepositoryInterface $paymentRepository, @@ -46,7 +47,7 @@ public function __construct( private LoggerInterface $logger, private RequestStack $requestStack, private OrderRepositoryInterface $orderRepository, - private TranslatorInterface $translator + private TranslatorInterface $translator, ) { } @@ -76,9 +77,10 @@ public function __invoke(RefundPaymentGenerated $message): void } $refundHistory = $this->payplugRefundHistoryRepository->findLastRefundForPayment($payment); - if ($refundHistory instanceof RefundHistory && + if ( + $refundHistory instanceof RefundHistory && null !== $refundHistory->getExternalId() && - null === $refundHistory->getRefundPayment() + !$refundHistory->getRefundPayment() instanceof \Sylius\RefundPlugin\Entity\RefundPayment ) { /** @var RefundPayment $refundPayment */ $refundPayment = $this->refundPaymentRepository->find($message->id()); @@ -136,7 +138,7 @@ private function hasLessThanFortyEightHoursTransaction(PaymentInterface $payment return $this->isLessThanFortyEightHours( $order->getLastPayment()->getCreatedAt(), - $now + $now, ); } @@ -146,7 +148,7 @@ private function hasLessThanFortyEightHoursTransaction(PaymentInterface $payment return $this->isLessThanFortyEightHours( $refundHistory->getCreatedAt(), - $now + $now, ); } @@ -161,13 +163,15 @@ private function isLessThanFortyEightHours(DateTimeInterface $from, DateTimeInte private function checkOneyRequirements( PaymentInterface $payment, - RefundPaymentGenerated $message + RefundPaymentGenerated $message, ): void { Assert::isInstanceOf($payment->getMethod(), PaymentMethodInterface::class); Assert::isInstanceOf($payment->getMethod()->getGatewayConfig(), GatewayConfigInterface::class); - if (OneyGatewayFactory::FACTORY_NAME === $payment->getMethod()->getGatewayConfig()->getFactoryName() && - $this->hasLessThanFortyEightHoursTransaction($payment, $message->orderNumber())) { + if ( + OneyGatewayFactory::FACTORY_NAME === $payment->getMethod()->getGatewayConfig()->getFactoryName() && + $this->hasLessThanFortyEightHoursTransaction($payment, $message->orderNumber()) + ) { throw InvalidRefundAmount::withValidationConstraint($this->translator->trans('payplug_sylius_payplug_plugin.ui.oney_transaction_less_than_forty_eight_hours')); } } diff --git a/src/Model/OneyCompleteInfoDTO.php b/src/Model/OneyCompleteInfoDTO.php index 9638c3ab..6d50a266 100644 --- a/src/Model/OneyCompleteInfoDTO.php +++ b/src/Model/OneyCompleteInfoDTO.php @@ -14,18 +14,14 @@ final class OneyCompleteInfoDTO /** @var string */ public $phone; - /** - * @var string - * @Assert\Email - */ + /** @var string */ + #[Assert\Email] public $email; /** @var string */ public $countryCode; - /** - * @Assert\Callback - */ + #[Assert\Callback] public function validatePhoneNumber(ExecutionContextInterface $context): void { if (null === $this->phone) { @@ -35,11 +31,13 @@ public function validatePhoneNumber(ExecutionContextInterface $context): void try { $phoneNumberUtil = PhoneNumberUtil::getInstance(); $parsedNumber = $phoneNumberUtil->parse($this->phone, $this->countryCode); - if (!$phoneNumberUtil->isValidNumber($parsedNumber) || - PhoneNumberType::MOBILE !== $phoneNumberUtil->getNumberType($parsedNumber)) { + if ( + !$phoneNumberUtil->isValidNumber($parsedNumber) || + PhoneNumberType::MOBILE !== $phoneNumberUtil->getNumberType($parsedNumber) + ) { throw new \InvalidArgumentException('Not a valid mobile phone number'); } - } catch (\Throwable $throwable) { + } catch (\Throwable) { $context->buildViolation('payplug_sylius_payplug_plugin.oney.not_valid_phone_number') ->atPath('phone') ->addViolation(); diff --git a/src/PayPlugSyliusPayPlugPlugin.php b/src/PayPlugSyliusPayPlugPlugin.php index e7dcbfa9..b6730ff9 100644 --- a/src/PayPlugSyliusPayPlugPlugin.php +++ b/src/PayPlugSyliusPayPlugPlugin.php @@ -9,10 +9,10 @@ final class PayPlugSyliusPayPlugPlugin extends Bundle { - public const VERSION = '1.11.0'; - use SyliusPluginTrait; + public const VERSION = '1.11.0'; + public function getPath(): string { return \dirname(__DIR__); diff --git a/src/PaymentProcessing/AbortPaymentProcessor.php b/src/PaymentProcessing/AbortPaymentProcessor.php index 711f702c..d4e24ef3 100644 --- a/src/PaymentProcessing/AbortPaymentProcessor.php +++ b/src/PaymentProcessing/AbortPaymentProcessor.php @@ -15,7 +15,7 @@ class AbortPaymentProcessor { public function __construct( #[Autowire('@payplug_sylius_payplug_plugin.api_client.payplug')] - private PayPlugApiClientInterface $payPlugApiClient + private PayPlugApiClientInterface $payPlugApiClient, ) { } @@ -27,7 +27,7 @@ public function process(PaymentInterface $payment): void // and go to the order history in another tab to click on pay again, then fail the transaction // and go back on the first PayPlug payment page and succeed it, it stays failed as its first payment model is already failed $this->payPlugApiClient->abortPayment($payment->getDetails()['payment_id']); - } catch (HttpException $httpException) { + } catch (HttpException) { } } } diff --git a/src/PaymentProcessing/CaptureAuthorizedPaymentProcessor.php b/src/PaymentProcessing/CaptureAuthorizedPaymentProcessor.php index 186fed60..62dab965 100644 --- a/src/PaymentProcessing/CaptureAuthorizedPaymentProcessor.php +++ b/src/PaymentProcessing/CaptureAuthorizedPaymentProcessor.php @@ -14,15 +14,10 @@ final class CaptureAuthorizedPaymentProcessor { - private PayPlugApiClientFactory $apiClientFactory; - private PaymentNotificationHandler $paymentNotificationHandler; - public function __construct( - PayPlugApiClientFactory $apiClientFactory, - PaymentNotificationHandler $paymentNotificationHandler + private PayPlugApiClientFactory $apiClientFactory, + private PaymentNotificationHandler $paymentNotificationHandler, ) { - $this->apiClientFactory = $apiClientFactory; - $this->paymentNotificationHandler = $paymentNotificationHandler; } public function process(PaymentInterface $payment): void diff --git a/src/PaymentProcessing/RefundPaymentHandler.php b/src/PaymentProcessing/RefundPaymentHandler.php index 5b4323eb..4a8875d0 100644 --- a/src/PaymentProcessing/RefundPaymentHandler.php +++ b/src/PaymentProcessing/RefundPaymentHandler.php @@ -29,7 +29,7 @@ public function __construct( private UnitRefundTotalCalculatorInterface $unitRefundTotalCalculator, private RemainingTotalProviderInterface $remainingTotalProvider, private ObjectRepository $refundPaymentRepository, - private RefundPaymentCompletedStateApplierInterface $refundPaymentCompletedStateApplier + private RefundPaymentCompletedStateApplierInterface $refundPaymentCompletedStateApplier, ) { } @@ -57,7 +57,7 @@ public function fromRequest(Refund $refund, PaymentInterface $payment): RefundUn $this->parseIdsToUnitRefunds($items, RefundType::orderItemUnit(), OrderItemUnitRefund::class), $this->parseIdsToUnitRefunds($shipments, RefundType::shipment(), ShipmentRefund::class), $payment->getMethod()->getId(), - '' + '', ); } @@ -119,7 +119,7 @@ private function getItemsRemainingPrice(?OrderInterface $order): array foreach ($orderItem->getUnits() as $itemUnit) { $items[$itemUnit->getId()] = $this->remainingTotalProvider->getTotalLeftToRefund( $itemUnit->getId(), - RefundType::orderItemUnit() + RefundType::orderItemUnit(), ); } } @@ -137,7 +137,7 @@ private function getShippingRemainingPrice(?OrderInterface $order): array foreach ($order->getAdjustments(AdjustmentInterface::SHIPPING_ADJUSTMENT) as $shipment) { $items[$shipment->getId()] = $this->remainingTotalProvider->getTotalLeftToRefund( $shipment->getId(), - RefundType::shipment() + RefundType::shipment(), ); } diff --git a/src/PaymentProcessing/RefundPaymentProcessor.php b/src/PaymentProcessing/RefundPaymentProcessor.php index 7fd60e19..cd30e9c8 100644 --- a/src/PaymentProcessing/RefundPaymentProcessor.php +++ b/src/PaymentProcessing/RefundPaymentProcessor.php @@ -28,6 +28,8 @@ #[Autoconfigure(public: true)] final class RefundPaymentProcessor implements PaymentProcessorInterface { + public $payPlugApiClient; + public function __construct( private RequestStack $requestStack, #[Autowire('@monolog.logger.payum')] @@ -35,7 +37,7 @@ public function __construct( private TranslatorInterface $translator, private RepositoryInterface $refundPaymentRepository, private RefundHistoryRepositoryInterface $payplugRefundHistoryRepository, - private PayPlugApiClientFactoryInterface $apiClientFactory + private PayPlugApiClientFactoryInterface $apiClientFactory, ) { } @@ -114,7 +116,7 @@ private function prepare(PaymentInterface $payment): void if (!isset($details['payment_id'])) { $this->requestStack->getSession()->getFlashBag()->add( 'info', - $this->translator->trans('payplug_sylius_payplug_plugin.ui.payment_refund_locally') + $this->translator->trans('payplug_sylius_payplug_plugin.ui.payment_refund_locally'), ); return; diff --git a/src/Processor/OrderPaymentProcessor.php b/src/Processor/OrderPaymentProcessor.php index 51370da0..716afe6b 100644 --- a/src/Processor/OrderPaymentProcessor.php +++ b/src/Processor/OrderPaymentProcessor.php @@ -18,6 +18,8 @@ #[AsDecorator('sylius.order_processing.order_payment_processor.checkout')] final class OrderPaymentProcessor implements OrderProcessorInterface { + public $stateMachineFactory; + public function __construct( #[AutowireDecorated] private OrderProcessorInterface $baseOrderPaymentProcessor, diff --git a/src/Provider/AbstractSupportedRefundPaymentMethodsProvider.php b/src/Provider/AbstractSupportedRefundPaymentMethodsProvider.php index 822d5aee..688bd2f4 100644 --- a/src/Provider/AbstractSupportedRefundPaymentMethodsProvider.php +++ b/src/Provider/AbstractSupportedRefundPaymentMethodsProvider.php @@ -17,22 +17,13 @@ abstract class AbstractSupportedRefundPaymentMethodsProvider { - protected RefundPaymentMethodsProviderInterface $decorated; - - protected RequestStack $requestStack; - - protected OrderRepositoryInterface $orderRepository; - protected string $gatewayFactoryName = ''; public function __construct( - RefundPaymentMethodsProviderInterface $decorated, - RequestStack $requestStack, - OrderRepositoryInterface $orderRepository + protected RefundPaymentMethodsProviderInterface $decorated, + protected RequestStack $requestStack, + protected OrderRepositoryInterface $orderRepository, ) { - $this->decorated = $decorated; - $this->requestStack = $requestStack; - $this->orderRepository = $orderRepository; } public function findForChannel(ChannelInterface $channel): array @@ -119,10 +110,6 @@ protected function isPayplugPayment(OrderInterface $order): bool return false; } - if ($this->gatewayFactoryName !== $gatewayConfig->getFactoryName()) { - return false; - } - - return true; + return $this->gatewayFactoryName === $gatewayConfig->getFactoryName(); } } diff --git a/src/Provider/ApplePayOrderProvider.php b/src/Provider/ApplePayOrderProvider.php index 43a90c96..abeef1c7 100644 --- a/src/Provider/ApplePayOrderProvider.php +++ b/src/Provider/ApplePayOrderProvider.php @@ -10,11 +10,8 @@ class ApplePayOrderProvider { - private RequestStack $requestStack; - - public function __construct(RequestStack $requestStack) + public function __construct(private RequestStack $requestStack) { - $this->requestStack = $requestStack; } public function getCurrentCart(): ?int diff --git a/src/Provider/OneySimulation/CachedSimulationDataProvider.php b/src/Provider/OneySimulation/CachedSimulationDataProvider.php index e5988c57..c0b5f4ca 100644 --- a/src/Provider/OneySimulation/CachedSimulationDataProvider.php +++ b/src/Provider/OneySimulation/CachedSimulationDataProvider.php @@ -18,7 +18,7 @@ public function __construct( #[AutowireDecorated] private OneySimulationDataProviderInterface $decorated, private CacheInterface $cache, - private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider + private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider, ) { } diff --git a/src/Provider/OneySimulation/OneySimulationDataProvider.php b/src/Provider/OneySimulation/OneySimulationDataProvider.php index 8cfb5e13..7408ad28 100644 --- a/src/Provider/OneySimulation/OneySimulationDataProvider.php +++ b/src/Provider/OneySimulation/OneySimulationDataProvider.php @@ -17,7 +17,7 @@ public function __construct( private PayPlugApiClientInterface $oneyClient, #[Autowire('@monolog.logger.payum')] private LoggerInterface $logger, - private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider + private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider, ) { } @@ -45,9 +45,9 @@ public function getForCart(OrderInterface $cart): array 'min_amount' => $accountData['configuration']['oney']['min_amounts'][$currency], 'max_amount' => $accountData['configuration']['oney']['max_amounts'][$currency], ], - $simulationData + $simulationData, ); - } catch (\Exception $exception) { + } catch (\Exception) { return []; } } diff --git a/src/Provider/OneySupportedPaymentChoiceProvider.php b/src/Provider/OneySupportedPaymentChoiceProvider.php index 7f59a951..0c05947c 100644 --- a/src/Provider/OneySupportedPaymentChoiceProvider.php +++ b/src/Provider/OneySupportedPaymentChoiceProvider.php @@ -11,11 +11,8 @@ class OneySupportedPaymentChoiceProvider { - private PaymentMethodRepositoryInterface $paymentMethodRepository; - - public function __construct(PaymentMethodRepositoryInterface $paymentMethodRepository) + public function __construct(private PaymentMethodRepositoryInterface $paymentMethodRepository) { - $this->paymentMethodRepository = $paymentMethodRepository; } public function getSupportedPaymentChoices(bool $useOneyPrefix = false): array @@ -29,12 +26,8 @@ public function getSupportedPaymentChoices(bool $useOneyPrefix = false): array return $values; } - $values = array_map(function ($data): string { - return 'oney_'.$data; - }, $values); - - return $values; - } catch (\Exception $exception) { + return array_map(fn ($data): string => 'oney_' . $data, $values); + } catch (\Exception) { return []; } } diff --git a/src/Provider/Payment/ApplePayPaymentProvider.php b/src/Provider/Payment/ApplePayPaymentProvider.php index e8159c19..06dc6e99 100644 --- a/src/Provider/Payment/ApplePayPaymentProvider.php +++ b/src/Provider/Payment/ApplePayPaymentProvider.php @@ -15,7 +15,6 @@ use PayPlug\SyliusPayPlugPlugin\Exception\Payment\PaymentNotCompletedException; use PayPlug\SyliusPayPlugPlugin\Gateway\ApplePayGatewayFactory; use PayPlug\SyliusPayPlugPlugin\Repository\PaymentMethodRepositoryInterface; -use SM\Factory\FactoryInterface as StateMachineFactoryInterface; use SM\StateMachine\StateMachineInterface; use Sylius\Bundle\PayumBundle\Model\GatewayConfigInterface; use Sylius\Component\Core\Model\ChannelInterface; @@ -37,6 +36,8 @@ class ApplePayPaymentProvider { + public $stateMachineFactory; + public function __construct( private PaymentFactoryInterface $paymentFactory, // private StateMachineFactoryInterface $stateMachineFactory; @@ -45,7 +46,7 @@ public function __construct( private PayPlugApiClientInterface $applePayClient, private EntityManagerInterface $entityManager, private OrderTokenAssignerInterface $orderTokenAssigner, - private RouterInterface $router + private RouterInterface $router, ) { } @@ -60,16 +61,14 @@ public function provide(Request $request, OrderInterface $order): PaymentInterfa $state = PaymentInterface::STATE_CART; /** @phpstan-ignore-next-line */ - if ($order->getPayments()->filter(function (PaymentInterface $payment): bool { - return PaymentInterface::STATE_FAILED === $payment->getState() || PaymentInterface::STATE_CANCELLED === $payment->getState(); - })->count() > 0) { + if ($order->getPayments()->filter(fn (PaymentInterface $payment): bool => PaymentInterface::STATE_FAILED === $payment->getState() || PaymentInterface::STATE_CANCELLED === $payment->getState())->count() > 0) { $state = PaymentInterface::STATE_NEW; } - $payment = $this->initApplePaySyliusPaymentState($order, $state); + $payment = $this->initApplePaySyliusPaymentState($order); Assert::notNull($order->getBillingAddress()); - if (null !== $customer = $order->getBillingAddress()->getCustomer()) { + if ($customer = $order->getBillingAddress()->getCustomer() instanceof \Sylius\Component\Customer\Model\CustomerInterface) { $order->setCustomer($customer); } @@ -113,7 +112,7 @@ public function provide(Request $request, OrderInterface $order): PaymentInterfa /** * @throws NotProvidedOrderPaymentException */ - private function initApplePaySyliusPaymentState(OrderInterface $order, string $targetState): PaymentInterface + private function initApplePaySyliusPaymentState(OrderInterface $order): PaymentInterface { Assert::notNull($order->getCurrencyCode()); @@ -131,13 +130,17 @@ private function getPayment(OrderInterface $order): PaymentInterface { $lastPayment = $order->getLastPayment(); - if ($lastPayment instanceof PaymentInterface && - PaymentInterface::STATE_CART === $lastPayment->getState()) { + if ( + $lastPayment instanceof PaymentInterface && + PaymentInterface::STATE_CART === $lastPayment->getState() + ) { return $lastPayment; } - if ($lastPayment instanceof PaymentInterface && OrderInterface::STATE_NEW === $order->getState() && - PaymentInterface::STATE_NEW === $lastPayment->getState()) { + if ( + $lastPayment instanceof PaymentInterface && OrderInterface::STATE_NEW === $order->getState() && + PaymentInterface::STATE_NEW === $lastPayment->getState() + ) { return $lastPayment; } @@ -198,17 +201,6 @@ public function applyRequiredOrderCheckoutTransition(OrderInterface $order, stri } } - private function getLastPayment(OrderInterface $order): ?PaymentInterface - { - $lastCancelledPayment = $order->getLastPayment(PaymentInterface::STATE_CANCELLED); - - if (null !== $lastCancelledPayment) { - return $lastCancelledPayment; - } - - return $order->getLastPayment(PaymentInterface::STATE_FAILED); - } - public function patch(Request $request, OrderInterface $order): PaymentInterface { $lastPayment = $order->getLastPayment(PaymentInterface::STATE_NEW); @@ -265,7 +257,7 @@ public function patch(Request $request, OrderInterface $order): PaymentInterface $lastPayment->setDetails($details); return $lastPayment; - } catch (\Exception $exception) { + } catch (\Exception) { $paymentResource->abort(); $this->applyRequiredPaymentTransition($lastPayment, PaymentInterface::STATE_FAILED); @@ -280,22 +272,18 @@ private function isResourceIsAuthorized(IVerifiableAPIResource $paymentResource) } // Oney is reviewing the payer’s file - if ($paymentResource->__isset('payment_method') && + if ( + $paymentResource->__isset('payment_method') && null !== $paymentResource->__get('payment_method') && \array_key_exists('is_pending', $paymentResource->__get('payment_method')) && - true === $paymentResource->__get('payment_method')['is_pending']) { + true === $paymentResource->__get('payment_method')['is_pending'] + ) { return true; } $now = new DateTimeImmutable(); - if ($paymentResource->__isset('authorization') && - $paymentResource->__get('authorization') instanceof PaymentAuthorization && - null !== $paymentResource->__get('authorization')->__get('expires_at') && - $now < $now->setTimestamp($paymentResource->__get('authorization')->__get('expires_at'))) { - return true; - } - return false; + return $paymentResource->__isset('authorization') && $paymentResource->__get('authorization') instanceof PaymentAuthorization && null !== $paymentResource->__get('authorization')->__get('expires_at') && $now < $now->setTimestamp($paymentResource->__get('authorization')->__get('expires_at')); } public function cancel(OrderInterface $order): void diff --git a/src/Provider/PaymentTokenProvider.php b/src/Provider/PaymentTokenProvider.php index 0e5502ef..622cc87b 100644 --- a/src/Provider/PaymentTokenProvider.php +++ b/src/Provider/PaymentTokenProvider.php @@ -14,9 +14,9 @@ final class PaymentTokenProvider { public function __construct( - Payum $payum, + private Payum $payum, #[Autowire('sylius_shop_order_after_pay')] - string $afterPayRoute + private string $afterPayRoute, ) { } @@ -36,14 +36,14 @@ public function getPaymentToken(PaymentInterface $payment): TokenInterface return $tokenFactory->createAuthorizeToken( $gatewayConfig->getGatewayName(), $payment, - $this->afterPayRoute + $this->afterPayRoute, ); } return $tokenFactory->createCaptureToken( $gatewayConfig->getGatewayName(), $payment, - $this->afterPayRoute + $this->afterPayRoute, ); } } diff --git a/src/Provider/SupportedMethodsProvider.php b/src/Provider/SupportedMethodsProvider.php index 9f0e621b..7c66fc16 100644 --- a/src/Provider/SupportedMethodsProvider.php +++ b/src/Provider/SupportedMethodsProvider.php @@ -15,8 +15,12 @@ public function __construct(private CurrencyContextInterface $currencyContext) { } - public function provide(array $supportedMethods, string $factoryName, array $authorizedCurrencies, int $paymentAmount): array - { + public function provide( + array $supportedMethods, + string $factoryName, + array $authorizedCurrencies, + int $paymentAmount, + ): array { $activeCurrencyCode = $this->currencyContext->getCurrencyCode(); foreach ($supportedMethods as $key => $paymentMethod) { @@ -35,8 +39,9 @@ public function provide(array $supportedMethods, string $factoryName, array $aut continue; } - if ($paymentAmount < $authorizedCurrencies[$activeCurrencyCode]['min_amount'] - || $paymentAmount > $authorizedCurrencies[$activeCurrencyCode]['max_amount'] + if ( + $paymentAmount < $authorizedCurrencies[$activeCurrencyCode]['min_amount'] || + $paymentAmount > $authorizedCurrencies[$activeCurrencyCode]['max_amount'] ) { unset($supportedMethods[$key]); diff --git a/src/Provider/SupportedRefundPaymentMethodsProviderDecorator.php b/src/Provider/SupportedRefundPaymentMethodsProviderDecorator.php index 1547ef3a..f57aee57 100644 --- a/src/Provider/SupportedRefundPaymentMethodsProviderDecorator.php +++ b/src/Provider/SupportedRefundPaymentMethodsProviderDecorator.php @@ -6,7 +6,6 @@ use PayPlug\SyliusPayPlugPlugin\Gateway\PayPlugGatewayFactory; use Payum\Core\Model\GatewayConfigInterface; -use Sylius\Component\Core\Model\ChannelInterface; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\Model\PaymentInterface; use Sylius\Component\Core\Model\PaymentMethodInterface; @@ -27,8 +26,8 @@ public function __construct( RefundPaymentMethodsProviderInterface $decorated, RequestStack $requestStack, OrderRepositoryInterface $orderRepository, - #[Autowire('%sylius_refund.supported_gateways%')] - protected array $supportedRefundGateways + #[Autowire(param: 'sylius_refund.supported_gateways')] + protected array $supportedRefundGateways, ) { parent::__construct($decorated, $requestStack, $orderRepository); } @@ -50,10 +49,12 @@ protected function find(array $paymentMethods, OrderInterface $order): array }); } - if (null !== $order->getLastPayment() && - null !== $order->getLastPayment()->getMethod() && + if ( + $order->getLastPayment() instanceof \Sylius\Component\Core\Model\PaymentInterface && + $order->getLastPayment()->getMethod() instanceof \Sylius\Component\Payment\Model\PaymentMethodInterface && $this->gatewayFactoryName === $order->getLastPayment()->getMethod()->getCode() && - !\in_array($this->gatewayFactoryName, $this->supportedRefundGateways, true)) { + !\in_array($this->gatewayFactoryName, $this->supportedRefundGateways, true) + ) { $this->requestStack->getSession()->getFlashBag()->add('info', 'payplug_sylius_payplug_plugin.ui.payplug_refund_gateway_is_not_activated'); } diff --git a/src/Repository/PaymentRepository.php b/src/Repository/PaymentRepository.php index e9793628..c55fcacc 100644 --- a/src/Repository/PaymentRepository.php +++ b/src/Repository/PaymentRepository.php @@ -22,20 +22,23 @@ public function findAllActiveByGatewayFactoryName(string $gatewayFactoryName): a ->setParameter('stateProcessing', PaymentInterface::STATE_PROCESSING) ->getQuery() ->getResult() - ; + ; } public function findOneByPayPlugPaymentId(string $payplugPaymentId): PaymentInterface { return $this->createQueryBuilder('o') ->where('o.details LIKE :payplugPaymentId') - ->setParameter('payplugPaymentId', '%'.$payplugPaymentId.'%') + ->setParameter('payplugPaymentId', '%' . $payplugPaymentId . '%') ->getQuery() ->setMaxResults(1) ->getSingleResult() ; } + /** + * @return array + */ public function findAllAuthorizedOlderThanDays(int $days, ?string $gatewayFactoryName = null): array { if (null === $gatewayFactoryName) { @@ -45,7 +48,6 @@ public function findAllAuthorizedOlderThanDays(int $days, ?string $gatewayFactor $date = (new \DateTime())->modify(sprintf('-%d days', $days)); - /** @var array */ return $this->createQueryBuilder('o') ->innerJoin('o.method', 'method') ->innerJoin('method.gatewayConfig', 'gatewayConfig') diff --git a/src/Resolver/AmericanExpressPaymentMethodsResolverDecorator.php b/src/Resolver/AmericanExpressPaymentMethodsResolverDecorator.php index 39937e46..923a3eca 100644 --- a/src/Resolver/AmericanExpressPaymentMethodsResolverDecorator.php +++ b/src/Resolver/AmericanExpressPaymentMethodsResolverDecorator.php @@ -19,7 +19,7 @@ final class AmericanExpressPaymentMethodsResolverDecorator implements PaymentMet public function __construct( #[AutowireDecorated] private PaymentMethodsResolverInterface $decorated, - private SupportedMethodsProvider $supportedMethodsProvider + private SupportedMethodsProvider $supportedMethodsProvider, ) { } @@ -32,7 +32,7 @@ public function getSupportedMethods(BasePaymentInterface $subject): array $supportedMethods, AmericanExpressGatewayFactory::FACTORY_NAME, AmericanExpressGatewayFactory::AUTHORIZED_CURRENCIES, - $subject->getAmount() ?? 0 + $subject->getAmount() ?? 0, ); } diff --git a/src/Resolver/ApplePayPaymentMethodsResolverDecorator.php b/src/Resolver/ApplePayPaymentMethodsResolverDecorator.php index 61de27f5..83aaeb29 100644 --- a/src/Resolver/ApplePayPaymentMethodsResolverDecorator.php +++ b/src/Resolver/ApplePayPaymentMethodsResolverDecorator.php @@ -23,7 +23,7 @@ public function __construct( #[AutowireDecorated] private PaymentMethodsResolverInterface $decorated, private SupportedMethodsProvider $supportedMethodsProvider, - private ApplePayCheckerInterface $applePayChecker + private ApplePayCheckerInterface $applePayChecker, ) { } @@ -51,7 +51,7 @@ public function getSupportedMethods(BasePaymentInterface $subject): array $supportedMethods, ApplePayGatewayFactory::FACTORY_NAME, ApplePayGatewayFactory::AUTHORIZED_CURRENCIES, - $subject->getAmount() ?? 0 + $subject->getAmount() ?? 0, ); } diff --git a/src/Resolver/BancontactPaymentMethodsResolverDecorator.php b/src/Resolver/BancontactPaymentMethodsResolverDecorator.php index e16f1a12..22dc0c51 100644 --- a/src/Resolver/BancontactPaymentMethodsResolverDecorator.php +++ b/src/Resolver/BancontactPaymentMethodsResolverDecorator.php @@ -19,7 +19,7 @@ final class BancontactPaymentMethodsResolverDecorator implements PaymentMethodsR public function __construct( #[AutowireDecorated] private PaymentMethodsResolverInterface $decorated, - private SupportedMethodsProvider $supportedMethodsProvider + private SupportedMethodsProvider $supportedMethodsProvider, ) { } @@ -32,7 +32,7 @@ public function getSupportedMethods(BasePaymentInterface $subject): array $supportedMethods, BancontactGatewayFactory::FACTORY_NAME, BancontactGatewayFactory::AUTHORIZED_CURRENCIES, - $subject->getAmount() ?? 0 + $subject->getAmount() ?? 0, ); } diff --git a/src/Resolver/OneyPaymentMethodsResolverDecorator.php b/src/Resolver/OneyPaymentMethodsResolverDecorator.php index 404c25a0..8e4bee24 100644 --- a/src/Resolver/OneyPaymentMethodsResolverDecorator.php +++ b/src/Resolver/OneyPaymentMethodsResolverDecorator.php @@ -24,7 +24,7 @@ public function __construct( #[AutowireDecorated] private PaymentMethodsResolverInterface $decorated, private CurrencyContextInterface $currencyContext, - private OneyCheckerInterface $oneyChecker + private OneyCheckerInterface $oneyChecker, ) { } @@ -56,10 +56,12 @@ public function getSupportedMethods(BasePaymentInterface $subject): array $countryCodeBilling = $order->getBillingAddress()->getCountryCode(); } - if (!$this->oneyChecker->isEnabled() || + if ( + !$this->oneyChecker->isEnabled() || !$this->oneyChecker->isPriceEligible($subject->getAmount() ?? 0, $activeCurrencyCode) || !$this->oneyChecker->isNumberOfProductEligible($order->getItemUnits()->count()) || - !$this->oneyChecker->isCountryEligible($countryCodeShipping, $countryCodeBilling)) { + !$this->oneyChecker->isCountryEligible($countryCodeShipping, $countryCodeBilling) + ) { unset($supportedMethods[$key]); } } diff --git a/src/Resolver/PayPlugPaymentMethodsResolverDecorator.php b/src/Resolver/PayPlugPaymentMethodsResolverDecorator.php index 375193ea..38818645 100644 --- a/src/Resolver/PayPlugPaymentMethodsResolverDecorator.php +++ b/src/Resolver/PayPlugPaymentMethodsResolverDecorator.php @@ -19,7 +19,7 @@ final class PayPlugPaymentMethodsResolverDecorator implements PaymentMethodsReso public function __construct( #[AutowireDecorated] private PaymentMethodsResolverInterface $decorated, - private SupportedMethodsProvider $supportedMethodsProvider + private SupportedMethodsProvider $supportedMethodsProvider, ) { } @@ -32,7 +32,7 @@ public function getSupportedMethods(BasePaymentInterface $subject): array $supportedMethods, PayPlugGatewayFactory::FACTORY_NAME, PayPlugGatewayFactory::AUTHORIZED_CURRENCIES, - $subject->getAmount() ?? 0 + $subject->getAmount() ?? 0, ); } diff --git a/src/Resolver/PaymentStateResolver.php b/src/Resolver/PaymentStateResolver.php index cac7b789..022394db 100644 --- a/src/Resolver/PaymentStateResolver.php +++ b/src/Resolver/PaymentStateResolver.php @@ -18,10 +18,12 @@ final class PaymentStateResolver implements PaymentStateResolverInterface { + public $stateMachineFactory; + public function __construct( #[Autowire('@payplug_sylius_payplug_plugin.api_client.payplug')] private PayPlugApiClientInterface $payPlugApiClient, - private EntityManagerInterface $paymentEntityManager + private EntityManagerInterface $paymentEntityManager, ) { } @@ -30,8 +32,10 @@ public function resolve(PaymentInterface $payment): void /** @var PaymentMethodInterface $paymentMethod */ $paymentMethod = $payment->getMethod(); - if (!$paymentMethod->getGatewayConfig() instanceof GatewayConfigInterface || - PayPlugGatewayFactory::FACTORY_NAME !== $paymentMethod->getGatewayConfig()->getFactoryName()) { + if ( + !$paymentMethod->getGatewayConfig() instanceof GatewayConfigInterface || + PayPlugGatewayFactory::FACTORY_NAME !== $paymentMethod->getGatewayConfig()->getFactoryName() + ) { return; } @@ -79,13 +83,7 @@ private function applyTransition(StateMachineInterface $paymentStateMachine, str private function isAuthorized(Payment $payment): bool { $now = new \DateTimeImmutable(); - if ($payment->__isset('authorization') && - $payment->__get('authorization') instanceof PaymentAuthorization && - null !== $payment->__get('authorization')->__get('expires_at') && - $now < $now->setTimestamp($payment->__get('authorization')->__get('expires_at'))) { - return true; - } - return false; + return $payment->__isset('authorization') && $payment->__get('authorization') instanceof PaymentAuthorization && null !== $payment->__get('authorization')->__get('expires_at') && $now < $now->setTimestamp($payment->__get('authorization')->__get('expires_at')); } } diff --git a/src/Twig/GetCurrentRouteExtension.php b/src/Twig/GetCurrentRouteExtension.php index 455f1833..68adb793 100644 --- a/src/Twig/GetCurrentRouteExtension.php +++ b/src/Twig/GetCurrentRouteExtension.php @@ -15,7 +15,7 @@ final class GetCurrentRouteExtension extends AbstractExtension private $request; public function __construct( - RequestStack $requestStack + RequestStack $requestStack, ) { $this->request = $requestStack->getCurrentRequest(); } @@ -23,7 +23,7 @@ public function __construct( public function getFunctions(): array { return [ - new TwigFunction('payplug_get_current_route', [$this, 'payplugGetCurrentRoute']), + new TwigFunction('payplug_get_current_route', $this->payplugGetCurrentRoute(...)), ]; } diff --git a/src/Twig/GetPayPlugApiUrlExtension.php b/src/Twig/GetPayPlugApiUrlExtension.php index 236308bc..f345cff6 100644 --- a/src/Twig/GetPayPlugApiUrlExtension.php +++ b/src/Twig/GetPayPlugApiUrlExtension.php @@ -12,7 +12,7 @@ final class GetPayPlugApiUrlExtension extends AbstractExtension public function getFunctions(): array { return [ - new TwigFunction('payplug_get_api_url', [$this, 'getApiUrl']), + new TwigFunction('payplug_get_api_url', $this->getApiUrl(...)), ]; } diff --git a/src/Twig/OneyExtension.php b/src/Twig/OneyExtension.php index 4e2c9a7d..e7952400 100644 --- a/src/Twig/OneyExtension.php +++ b/src/Twig/OneyExtension.php @@ -14,34 +14,18 @@ final class OneyExtension extends AbstractExtension { - /** @var \Sylius\Component\Resource\Repository\RepositoryInterface */ - private $gatewayConfigRepository; - - /** @var \Sylius\Component\Resource\Repository\RepositoryInterface */ - private $paymentMethodRepository; - - /** @var \Sylius\Component\Channel\Context\ChannelContextInterface */ - private $channelContext; - - /** @var \PayPlug\SyliusPayPlugPlugin\Checker\OneyChecker */ - private $oneyChecker; - public function __construct( - RepositoryInterface $gatewayConfigRepository, - RepositoryInterface $paymentMethodRepository, - ChannelContextInterface $channelContext, - OneyChecker $oneyChecker + private RepositoryInterface $gatewayConfigRepository, + private RepositoryInterface $paymentMethodRepository, + private ChannelContextInterface $channelContext, + private OneyChecker $oneyChecker, ) { - $this->gatewayConfigRepository = $gatewayConfigRepository; - $this->paymentMethodRepository = $paymentMethodRepository; - $this->channelContext = $channelContext; - $this->oneyChecker = $oneyChecker; } public function getFunctions(): array { return [ - new TwigFunction('is_oney_enabled', [$this, 'isOneyEnabled']), + new TwigFunction('is_oney_enabled', $this->isOneyEnabled(...)), ]; } diff --git a/src/Twig/OneyRulesExtension.php b/src/Twig/OneyRulesExtension.php index 64ff192c..76dea3e4 100644 --- a/src/Twig/OneyRulesExtension.php +++ b/src/Twig/OneyRulesExtension.php @@ -22,52 +22,28 @@ final class OneyRulesExtension extends AbstractExtension { - /** @var CartContextInterface */ - private $cartContext; - - /** @var OneyCheckerInterface */ - private $oneyChecker; - - /** @var PayPlugApiClientInterface */ - private $oneyClient; - - /** @var MoneyFormatterInterface */ - private $moneyFormatter; - - /** @var ProductRepositoryInterface */ - private $productRepository; - - /** @var RequestStack */ - private $requestStack; - public function __construct( - OneyCheckerInterface $oneyChecker, - CartContextInterface $cartContext, - PayPlugApiClientInterface $oneyClient, - MoneyFormatterInterface $moneyFormatter, - ProductRepositoryInterface $productRepository, - RequestStack $requestStack + private OneyCheckerInterface $oneyChecker, + private CartContextInterface $cartContext, + private PayPlugApiClientInterface $oneyClient, + private MoneyFormatterInterface $moneyFormatter, + private ProductRepositoryInterface $productRepository, + private RequestStack $requestStack, ) { - $this->oneyChecker = $oneyChecker; - $this->cartContext = $cartContext; - $this->oneyClient = $oneyClient; - $this->moneyFormatter = $moneyFormatter; - $this->productRepository = $productRepository; - $this->requestStack = $requestStack; } public function getFunctions(): array { return [ - new TwigFunction('oney_cart_eligible', [$this, 'isCartEligible']), - new TwigFunction('oney_product_eligible', [$this, 'isProductEligible']), - new TwigFunction('oney_ineligible_reasons', [$this, 'getReasonsOfIneligibility']), + new TwigFunction('oney_cart_eligible', $this->isCartEligible(...)), + new TwigFunction('oney_product_eligible', $this->isProductEligible(...)), + new TwigFunction('oney_ineligible_reasons', $this->getReasonsOfIneligibility(...)), ]; } public function isCartEligible(?OrderInterface $currentCart = null): bool { - if (null === $currentCart) { + if (!$currentCart instanceof \Sylius\Component\Core\Model\OrderInterface) { /** @var OrderInterface $currentCart */ $currentCart = $this->cartContext->getCart(); } @@ -91,7 +67,7 @@ public function isCartEligible(?OrderInterface $currentCart = null): bool if (null === $currencyCode) { throw new \LogicException('No currency code found'); } - } catch (\Throwable $throwable) { + } catch (\Throwable) { // unable to find currency_code return false; } @@ -104,7 +80,7 @@ public function getReasonsOfIneligibility(?OrderInterface $currentCart = null): $data = []; $transParam = []; - if (null === $currentCart) { + if (!$currentCart instanceof \Sylius\Component\Core\Model\OrderInterface) { /** @var OrderInterface $currentCart */ $currentCart = $this->cartContext->getCart(); } @@ -137,18 +113,18 @@ public function getReasonsOfIneligibility(?OrderInterface $currentCart = null): '%min_amount%' => $this->moneyFormatter->format( $account['configuration']['oney']['min_amounts'][$currencyCode], $currencyCode, - $currentCart->getLocaleCode() + $currentCart->getLocaleCode(), ), ]; $transParam[] = [ '%max_amount%' => $this->moneyFormatter->format( $account['configuration']['oney']['max_amounts'][$currencyCode], $currencyCode, - $currentCart->getLocaleCode() + $currentCart->getLocaleCode(), ), ]; } - } catch (\Throwable $throwable) { + } catch (\Throwable) { // do nothing } @@ -164,7 +140,7 @@ public function isProductEligible(): bool $currentCart = $this->cartContext->getCart(); $request = $this->requestStack->getCurrentRequest(); - if (null === $request || 'sylius_shop_product_show' !== $request->get('_route')) { + if (!$request instanceof \Symfony\Component\HttpFoundation\Request || 'sylius_shop_product_show' !== $request->get('_route')) { return false; } @@ -183,7 +159,7 @@ public function isProductEligible(): bool if (null === $currencyCode) { throw new \LogicException('No currency code found'); } - } catch (\Throwable $throwable) { + } catch (\Throwable) { // unable to find currency_code return false; } @@ -196,7 +172,7 @@ public function isProductEligible(): bool $product = $this->productRepository->findOneByChannelAndSlug( $channel, $currentCart->getLocaleCode(), - $request->get('_route_params')['slug'] + $request->get('_route_params')['slug'], ); Assert::isInstanceOf($product, ProductInterface::class); diff --git a/src/Twig/OneySimulationExtension.php b/src/Twig/OneySimulationExtension.php index 6000a117..45c3a651 100644 --- a/src/Twig/OneySimulationExtension.php +++ b/src/Twig/OneySimulationExtension.php @@ -23,16 +23,16 @@ public function __construct( private OneySimulationDataProviderInterface $oneySimulationDataProvider, private RequestStack $requestStack, private OrderRepositoryInterface $orderRepository, - private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider + private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider, ) { } public function getFunctions(): array { return [ - new TwigFunction('oney_simulation_data', [$this, 'getSimulationData']), - new TwigFunction('oney_supported_choices', [$this, 'getSupportedPaymentChoices']), - new TwigFunction('is_oney_without_fees', [$this, 'isPaymentChoiceWithoutFees']), + new TwigFunction('oney_simulation_data', $this->getSimulationData(...)), + new TwigFunction('oney_supported_choices', $this->getSupportedPaymentChoices(...)), + new TwigFunction('is_oney_without_fees', $this->isPaymentChoiceWithoutFees(...)), ]; } @@ -71,9 +71,9 @@ public function getSupportedPaymentChoices(): array public function isPaymentChoiceWithoutFees(): bool { - return \count(\array_filter( + return \array_filter( $this->getSupportedPaymentChoices(), - fn (string $choice) => \in_array($choice, OneyGatewayFactory::ONEY_WITHOUT_FEES_CHOICES, true) - )) > 0; + fn (string $choice) => \in_array($choice, OneyGatewayFactory::ONEY_WITHOUT_FEES_CHOICES, true), + ) !== []; } } diff --git a/src/Twig/PayPlugExtension.php b/src/Twig/PayPlugExtension.php index d0689c43..9ebfcfc7 100644 --- a/src/Twig/PayPlugExtension.php +++ b/src/Twig/PayPlugExtension.php @@ -12,23 +12,17 @@ final class PayPlugExtension extends AbstractExtension { - /** @var CanSaveCardCheckerInterface */ - private $canSaveCardChecker; - private PayPlugApiClientFactory $apiClientFactory; - public function __construct( - CanSaveCardCheckerInterface $canSaveCardChecker, - PayPlugApiClientFactory $apiClientFactory, + private CanSaveCardCheckerInterface $canSaveCardChecker, + private PayPlugApiClientFactory $apiClientFactory, ) { - $this->canSaveCardChecker = $canSaveCardChecker; - $this->apiClientFactory = $apiClientFactory; } public function getFunctions(): array { return [ - new TwigFunction('is_save_card_enabled', [$this, 'isSaveCardAllowed']), - new TwigFunction('is_payplug_test_mode_enabled', [$this, 'isTest']), + new TwigFunction('is_save_card_enabled', $this->isSaveCardAllowed(...)), + new TwigFunction('is_payplug_test_mode_enabled', $this->isTest(...)), ]; } @@ -41,6 +35,6 @@ public function isTest(PaymentMethodInterface $paymentMethod): bool { $client = $this->apiClientFactory->createForPaymentMethod($paymentMethod); - return ((bool) $client->getAccount()['is_live']) !== true; + return !(bool) $client->getAccount()['is_live']; } } diff --git a/src/Twig/ProductVariantsCodesExtension.php b/src/Twig/ProductVariantsCodesExtension.php index 3dc49e47..df1b6b55 100644 --- a/src/Twig/ProductVariantsCodesExtension.php +++ b/src/Twig/ProductVariantsCodesExtension.php @@ -15,7 +15,7 @@ final class ProductVariantsCodesExtension extends AbstractExtension public function getFunctions(): array { return [ - new TwigFunction('sylius_product_variant_codes', [$this, 'provideVariantsCodes']), + new TwigFunction('sylius_product_variant_codes', $this->provideVariantsCodes(...)), ]; } diff --git a/src/Twig/ShowMeaExtension.php b/src/Twig/ShowMeaExtension.php index 4a1aca72..32cedd51 100644 --- a/src/Twig/ShowMeaExtension.php +++ b/src/Twig/ShowMeaExtension.php @@ -11,25 +11,19 @@ final class ShowMeaExtension extends AbstractExtension { - /** @var PayPlugApiClientInterface */ - private $oneyClient; - - /** @var LocaleContextInterface */ - private $localeContext; - /** @var string */ public $localeCode; - public function __construct(LocaleContextInterface $localeContext, PayPlugApiClientInterface $oneyClient) - { - $this->localeContext = $localeContext; - $this->oneyClient = $oneyClient; + public function __construct( + private LocaleContextInterface $localeContext, + private PayPlugApiClientInterface $oneyClient, + ) { } public function getFunctions(): array { return [ - new TwigFunction('can_show_mea', [$this, 'canShowMEA']), + new TwigFunction('can_show_mea', $this->canShowMEA(...)), ]; } @@ -42,11 +36,7 @@ public function canShowMEA(): bool return false; } - if ($this->getLocaleCode() === $this->oneyClient->getAccount()['country']) { - return true; - } - - return false; + return $this->getLocaleCode() === $this->oneyClient->getAccount()['country']; } private function getLocaleCode(): string diff --git a/src/Validator/OneyInvalidDataRetriever.php b/src/Validator/OneyInvalidDataRetriever.php index 191e8e4d..6ada2326 100644 --- a/src/Validator/OneyInvalidDataRetriever.php +++ b/src/Validator/OneyInvalidDataRetriever.php @@ -70,7 +70,7 @@ private function isPhoneAddressValid(AddressInterface $address): bool } return PhoneNumberType::MOBILE === $this->phoneNumberUtil->getNumberType($parsedNumber); - } catch (\Throwable $throwable) { + } catch (\Throwable) { return false; } } diff --git a/templates/SyliusAdminBundle/Order/Show/_payment.html.twig b/templates/SyliusAdminBundle/Order/Show/_payment.html.twig old mode 100755 new mode 100644 index c63a61b6..eba8c8be --- a/templates/SyliusAdminBundle/Order/Show/_payment.html.twig +++ b/templates/SyliusAdminBundle/Order/Show/_payment.html.twig @@ -15,12 +15,7 @@

- {% if (payment.method.gatewayConfig.factoryName == constant('\\PayPlug\\SyliusPayPlugPlugin\\Gateway\\PayPlugGatewayFactory::FACTORY_NAME') - or payment.method.gatewayConfig.factoryName == constant('\\PayPlug\\SyliusPayPlugPlugin\\Gateway\\OneyGatewayFactory::FACTORY_NAME')) - or payment.method.gatewayConfig.factoryName == constant('\\PayPlug\\SyliusPayPlugPlugin\\Gateway\\BancontactGatewayFactory::FACTORY_NAME') - or payment.method.gatewayConfig.factoryName == constant('\\PayPlug\\SyliusPayPlugPlugin\\Gateway\\ApplePayGatewayFactory::FACTORY_NAME') - or payment.method.gatewayConfig.factoryName == constant('\\PayPlug\\SyliusPayPlugPlugin\\Gateway\\AmericanExpressGatewayFactory::FACTORY_NAME') - and payment.details.payment_id is defined %} + {% if payment.method.gatewayConfig.factoryName in [constant('\\PayPlug\\SyliusPayPlugPlugin\\Gateway\\PayPlugGatewayFactory::FACTORY_NAME'), constant('\\PayPlug\\SyliusPayPlugPlugin\\Gateway\\OneyGatewayFactory::FACTORY_NAME')] or payment.method.gatewayConfig.factoryName == constant('\\PayPlug\\SyliusPayPlugPlugin\\Gateway\\BancontactGatewayFactory::FACTORY_NAME') or payment.method.gatewayConfig.factoryName == constant('\\PayPlug\\SyliusPayPlugPlugin\\Gateway\\ApplePayGatewayFactory::FACTORY_NAME') or payment.method.gatewayConfig.factoryName == constant('\\PayPlug\\SyliusPayPlugPlugin\\Gateway\\AmericanExpressGatewayFactory::FACTORY_NAME') and payment.details.payment_id is defined %}
{{ 'payplug_sylius_payplug_plugin.ui.payplug_id'|trans({'%paymentId%': payment.details.payment_id|default('')}) }} {% if payment.method.gatewayConfig.factoryName == constant('\\PayPlug\\SyliusPayPlugPlugin\\Gateway\\OneyGatewayFactory::FACTORY_NAME') %} diff --git a/tests/Behat/Context/Cli/UpdatePaymentStateContext.php b/tests/Behat/Context/Cli/UpdatePaymentStateContext.php index b030afc0..84137afa 100644 --- a/tests/Behat/Context/Cli/UpdatePaymentStateContext.php +++ b/tests/Behat/Context/Cli/UpdatePaymentStateContext.php @@ -48,7 +48,7 @@ public function __construct( PayPlugApiMocker $payPlugApiMocker, PaymentFactoryInterface $paymentFactory, PaymentRepositoryInterface $paymentRepository, - SharedStorageInterface $sharedStorage + SharedStorageInterface $sharedStorage, ) { $this->kernel = $kernel; $this->payPlugApiMocker = $payPlugApiMocker; diff --git a/tests/Behat/Context/Setup/OrderContext.php b/tests/Behat/Context/Setup/OrderContext.php index d9e7caf2..7e96fe2b 100644 --- a/tests/Behat/Context/Setup/OrderContext.php +++ b/tests/Behat/Context/Setup/OrderContext.php @@ -27,7 +27,7 @@ final class OrderContext implements Context public function __construct( ObjectManager $objectManager, StateMachineFactoryInterface $stateMachineFactory, - RegistryInterface $payum + RegistryInterface $payum, ) { $this->objectManager = $objectManager; $this->stateMachineFactory = $stateMachineFactory; diff --git a/tests/Behat/Context/Setup/PayPlugContext.php b/tests/Behat/Context/Setup/PayPlugContext.php index e8560c93..493e38b6 100644 --- a/tests/Behat/Context/Setup/PayPlugContext.php +++ b/tests/Behat/Context/Setup/PayPlugContext.php @@ -36,7 +36,7 @@ public function __construct( PaymentMethodRepositoryInterface $paymentMethodRepository, ExampleFactoryInterface $paymentMethodExampleFactory, FactoryInterface $paymentMethodTranslationFactory, - ObjectManager $paymentMethodManager + ObjectManager $paymentMethodManager, ) { $this->sharedStorage = $sharedStorage; $this->paymentMethodRepository = $paymentMethodRepository; @@ -48,13 +48,15 @@ public function __construct( /** * @Given the store has a payment method :paymentMethodName with a code :paymentMethodCode and PayPlug payment gateway */ - public function theStoreHasAPaymentMethodWithACodeAndPayPlugPaymentGateway(string $paymentMethodName, string $paymentMethodCode): void - { + public function theStoreHasAPaymentMethodWithACodeAndPayPlugPaymentGateway( + string $paymentMethodName, + string $paymentMethodCode, + ): void { $paymentMethod = $this->createPaymentMethodPayPlug( $paymentMethodName, $paymentMethodCode, PayPlugGatewayFactory::FACTORY_NAME, - 'PayPlug' + 'PayPlug', ); $paymentMethod->getGatewayConfig()->setConfig([ @@ -68,13 +70,15 @@ public function theStoreHasAPaymentMethodWithACodeAndPayPlugPaymentGateway(strin /** * @Given the store has a payment method :paymentMethodName with a code :paymentMethodCode and Oney payment gateway */ - public function theStoreHasAPaymentMethodWithACodeAndOneyPaymentGateway(string $paymentMethodName, string $paymentMethodCode): void - { + public function theStoreHasAPaymentMethodWithACodeAndOneyPaymentGateway( + string $paymentMethodName, + string $paymentMethodCode, + ): void { $paymentMethod = $this->createPaymentMethodPayPlug( $paymentMethodName, $paymentMethodCode, OneyGatewayFactory::FACTORY_NAME, - 'Oney' + 'Oney', ); $paymentMethod->getGatewayConfig()->setConfig([ @@ -88,13 +92,15 @@ public function theStoreHasAPaymentMethodWithACodeAndOneyPaymentGateway(string $ /** * @Given the store has a payment method :paymentMethodName with a code :paymentMethodCode other than PayPlug payment gateway */ - public function theStoreHasAPaymentMethodWithACodeOtherThanPayplugPaymentGateway(string $paymentMethodName, string $paymentMethodCode): void - { + public function theStoreHasAPaymentMethodWithACodeOtherThanPayplugPaymentGateway( + string $paymentMethodName, + string $paymentMethodCode, + ): void { $this->createPaymentMethodPayPlug( $paymentMethodName, $paymentMethodCode, $paymentMethodCode, - '' + '', ); $this->paymentMethodManager->flush(); @@ -106,7 +112,7 @@ private function createPaymentMethodPayPlug( string $factoryName, string $description = '', bool $addForCurrentChannel = true, - int $position = null + int $position = null, ): PaymentMethodInterface { /** @var PaymentMethodInterface $paymentMethod */ $paymentMethod = $this->paymentMethodExampleFactory->create([ diff --git a/tests/Behat/Context/Ui/Admin/ManagingPaymentMethodContext.php b/tests/Behat/Context/Ui/Admin/ManagingPaymentMethodContext.php index 80da429f..0227c28f 100644 --- a/tests/Behat/Context/Ui/Admin/ManagingPaymentMethodContext.php +++ b/tests/Behat/Context/Ui/Admin/ManagingPaymentMethodContext.php @@ -37,7 +37,7 @@ public function iShouldBeNotifiedThatCannotBeBlank(string $fields): void foreach ($fields as $field) { Assert::true($this->createPage->containsErrorWithMessage(sprintf( 'The %s cannot be empty.', - strtolower(trim($field)) + strtolower(trim($field)), ))); } } diff --git a/tests/Behat/Context/Ui/Admin/RefundContext.php b/tests/Behat/Context/Ui/Admin/RefundContext.php index 2cd0c734..59e393cd 100644 --- a/tests/Behat/Context/Ui/Admin/RefundContext.php +++ b/tests/Behat/Context/Ui/Admin/RefundContext.php @@ -49,7 +49,7 @@ public function __construct( NotifyAction $notifyAction, NotificationCheckerInterface $notificationChecker, EntityManagerInterface $entityManager, - RefundHistoryRepositoryInterface $payplugRefundHistoryRepository + RefundHistoryRepositoryInterface $payplugRefundHistoryRepository, ) { $this->payPlugApiMocker = $payPlugApiMocker; $this->managingOrdersContext = $managingOrdersContext; @@ -77,7 +77,7 @@ public function decideToRefundProduct( OrderInterface $order, int $unitNumber, string $productName, - string $paymentMethod + string $paymentMethod, ): void { $this->payPlugApiMocker->mockApiRetrieveNotRefundablePayment(function () use ( $order, @@ -127,7 +127,7 @@ public function iShouldSeeAnErrorMessage(string $errorMessage) { $this->notificationChecker->checkNotification( $errorMessage, - NotificationType::failure() + NotificationType::failure(), ); } @@ -138,7 +138,7 @@ public function iShouldSeeASuccessMessage(string $successMessage) { $this->notificationChecker->checkNotification( $successMessage, - NotificationType::success() + NotificationType::success(), ); } @@ -149,7 +149,7 @@ public function decideToRefundProductAfter48Hours( OrderInterface $order, int $unitNumber, string $productName, - string $paymentMethod + string $paymentMethod, ): void { $this->payPlugApiMocker->mockApiRetrievePayment(function () use ( $order, diff --git a/tests/Behat/Context/Ui/Shop/CheckoutContext.php b/tests/Behat/Context/Ui/Shop/CheckoutContext.php index 20ea7e36..ae35eef1 100644 --- a/tests/Behat/Context/Ui/Shop/CheckoutContext.php +++ b/tests/Behat/Context/Ui/Shop/CheckoutContext.php @@ -31,7 +31,7 @@ public function __construct( CompletePageInterface $summaryPage, ShowPageInterface $orderDetails, PayPlugApiMocker $payPlugApiMocker, - PaymentPageInterface $paymentPage + PaymentPageInterface $paymentPage, ) { $this->summaryPage = $summaryPage; $this->orderDetails = $orderDetails; @@ -40,8 +40,8 @@ public function __construct( } /** - * @When I confirm my order with PayPlug payment * @Given I have confirmed my order with PayPlug payment + * @When I confirm my order with PayPlug payment */ public function iConfirmMyOrderWithPayPlugPayment(): void { @@ -81,8 +81,8 @@ public function iHaveFailedPayPlugPayment() } /** - * @When I cancel my PayPlug payment * @Given I have cancelled PayPlug payment + * @When I cancel my PayPlug payment */ public function iCancelMyPayPlugPayment(): void { @@ -102,8 +102,8 @@ public function iLeaveMyPayPlugPaymentPage(): void } /** - * @When PayPlug notified that the payment is expired * @Given I have left PayPlug payment page for more than 15 minutes + * @When PayPlug notified that the payment is expired */ public function PayPlugExpiredThePayment(): void { diff --git a/tests/Behat/Mocker/PayPlugApiMocker.php b/tests/Behat/Mocker/PayPlugApiMocker.php index 5911e536..43aa78b0 100644 --- a/tests/Behat/Mocker/PayPlugApiMocker.php +++ b/tests/Behat/Mocker/PayPlugApiMocker.php @@ -120,7 +120,7 @@ public function mockApiRetrievePayment(callable $action): void { $mock = $this->mocker->mockService( 'payplug_sylius_payplug_plugin.api_client.oney', - PayPlugApiClientInterface::class + PayPlugApiClientInterface::class, ); $payment = \Mockery::mock('payment', Payment::class); $payment->refundable_until = (new \DateTime())->add(new \DateInterval('P2D'))->getTimestamp(); @@ -137,7 +137,7 @@ public function mockApiRetrieveNotRefundablePayment(callable $action): void { $mock = $this->mocker->mockService( 'payplug_sylius_payplug_plugin.api_client.oney', - PayPlugApiClientInterface::class + PayPlugApiClientInterface::class, ); $payment = \Mockery::mock('payment', Payment::class); $payment->refundable_until = (new \DateTime())->add(new \DateInterval('P2D'))->getTimestamp(); @@ -331,7 +331,7 @@ public function enableOney(): void $this->mocker->unmockAll(); $mock = $this->mocker->mockService( 'payplug_sylius_payplug_plugin.api_client.oney', - PayPlugApiClientInterface::class + PayPlugApiClientInterface::class, ); $mock->shouldReceive([ 'getPermissions' => ['can_use_oney' => true], @@ -360,7 +360,7 @@ public function disableOney(): void $this->mocker->unmockAll(); $mock = $this->mocker->mockService( 'payplug_sylius_payplug_plugin.api_client.oney', - PayPlugApiClientInterface::class + PayPlugApiClientInterface::class, ); $mock->shouldReceive([ 'getPermissions' => ['can_use_oney' => false], diff --git a/tests/Behat/Page/Shop/Payum/PaymentPage.php b/tests/Behat/Page/Shop/Payum/PaymentPage.php index 44638591..b2b63b21 100644 --- a/tests/Behat/Page/Shop/Payum/PaymentPage.php +++ b/tests/Behat/Page/Shop/Payum/PaymentPage.php @@ -22,7 +22,7 @@ public function __construct( Session $session, $parameters, RepositoryInterface $securityTokenRepository, - KernelBrowser $client + KernelBrowser $client, ) { parent::__construct($session, $parameters); @@ -37,7 +37,7 @@ public function capture(array $parameters = []): void $url = $captureToken->getTargetUrl(); if (count($parameters) > 0) { - $url .= '?'.http_build_query($parameters); + $url .= '?' . http_build_query($parameters); } $this->getDriver()->visit($url); From a4ad381859c14d8523122e839da3fc9ffa903993 Mon Sep 17 00:00:00 2001 From: maxperei Date: Wed, 16 Apr 2025 17:43:57 +0200 Subject: [PATCH 006/112] refactor(di): [wip] turn most services injection from xml to yaml --- config/services.xml | 276 ------------------ config/services.yaml | 23 ++ config/services/action.xml | 42 --- config/services/no_defaults.xml | 21 -- .../config/packages/sylius_payplug.yaml | 1 - src/Action/CaptureAction.php | 33 +++ src/Action/ConvertPaymentAction.php | 35 +++ src/Action/NotifyAction.php | 35 +++ src/Action/StatusAction.php | 35 +++ src/Controller/AbstractOneyController.php | 4 +- .../RefundUnitsCommandCreatorDecorator.php | 1 + .../PayPlugSyliusPayPlugExtension.php | 9 +- .../OneySimulationDataProvider.php | 1 + .../Payment/ApplePayPaymentProvider.php | 2 + src/Twig/GetCurrentRouteExtension.php | 11 +- src/Twig/OneyRulesExtension.php | 2 + src/Twig/ShowMeaExtension.php | 2 + 17 files changed, 182 insertions(+), 351 deletions(-) delete mode 100644 config/services.xml create mode 100644 config/services.yaml delete mode 100644 config/services/action.xml delete mode 100644 config/services/no_defaults.xml diff --git a/config/services.xml b/config/services.xml deleted file mode 100644 index e1da0098..00000000 --- a/config/services.xml +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/services.yaml b/config/services.yaml new file mode 100644 index 00000000..5889e53d --- /dev/null +++ b/config/services.yaml @@ -0,0 +1,23 @@ +services: + _defaults: + autowire: true + autoconfigure: true + public: false + + PayPlug\SyliusPayPlugPlugin\: + resource: '../src/*' + exclude: '../src/{ApiClient,DependencyInjection,Entity,Exception,Gateway,Model,Repository,PayPlugSyliusPayPlugPlugin.php}' + + PayPlug\SyliusPayPlugPlugin\Repository\PaymentRepositoryInterface: + class: PayPlug\SyliusPayPlugPlugin\Repository\PaymentRepository + parent: sylius.repository.payment + + PayPlug\SyliusPayPlugPlugin\Repository\PaymentMethodRepositoryInterface: + class: PayPlug\SyliusPayPlugPlugin\Repository\PaymentMethodRepository + parent: sylius.repository.payment_method + + PayPlug\SyliusPayPlugPlugin\Controller\OrderController: + parent: sylius.controller.order + + PayPlug\SyliusPayPlugPlugin\Provider\OneySimulation\OneySimulationDataProviderInterface: + class: PayPlug\SyliusPayPlugPlugin\Provider\OneySimulation\OneySimulationDataProvider diff --git a/config/services/action.xml b/config/services/action.xml deleted file mode 100644 index 38b90def..00000000 --- a/config/services/action.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/services/no_defaults.xml b/config/services/no_defaults.xml deleted file mode 100644 index a41f20be..00000000 --- a/config/services/no_defaults.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - diff --git a/install/Application/config/packages/sylius_payplug.yaml b/install/Application/config/packages/sylius_payplug.yaml index 348a3599..7fe43aa0 100644 --- a/install/Application/config/packages/sylius_payplug.yaml +++ b/install/Application/config/packages/sylius_payplug.yaml @@ -1,3 +1,2 @@ imports: - { resource: "@PayPlugSyliusPayPlugPlugin/config/config.yml" } - - { resource: "@PayPlugSyliusPayPlugPlugin/config/services.xml" } diff --git a/src/Action/CaptureAction.php b/src/Action/CaptureAction.php index d03c6378..350e8f27 100644 --- a/src/Action/CaptureAction.php +++ b/src/Action/CaptureAction.php @@ -13,7 +13,9 @@ use PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientInterface; use PayPlug\SyliusPayPlugPlugin\Entity\Card; use PayPlug\SyliusPayPlugPlugin\Exception\UnknownApiErrorException; +use PayPlug\SyliusPayPlugPlugin\Gateway\AmericanExpressGatewayFactory; use PayPlug\SyliusPayPlugPlugin\Gateway\ApplePayGatewayFactory; +use PayPlug\SyliusPayPlugPlugin\Gateway\BancontactGatewayFactory; use PayPlug\SyliusPayPlugPlugin\Gateway\OneyGatewayFactory; use PayPlug\SyliusPayPlugPlugin\Gateway\PayPlugGatewayFactory; use PayPlug\SyliusPayPlugPlugin\PaymentProcessing\AbortPaymentProcessor; @@ -34,10 +36,41 @@ use Sylius\Component\Core\Model\PaymentInterface; use Sylius\Component\Core\Model\PaymentMethodInterface; use Sylius\Component\Resource\Repository\RepositoryInterface; +use Symfony\Component\DependencyInjection\Attribute\AsAlias; +use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Contracts\Translation\TranslatorInterface; use Webmozart\Assert\Assert; +#[AsAlias(id: 'payplug_sylius_payplug_plugin.action.capture', public: true)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => PayPlugGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => OneyGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => BancontactGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => AmericanExpressGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] final class CaptureAction implements ActionInterface, ApiAwareInterface, GatewayAwareInterface, GenericTokenFactoryAwareInterface { use GatewayAwareTrait; diff --git a/src/Action/ConvertPaymentAction.php b/src/Action/ConvertPaymentAction.php index cf04d4fe..43f0a502 100644 --- a/src/Action/ConvertPaymentAction.php +++ b/src/Action/ConvertPaymentAction.php @@ -6,12 +6,47 @@ use PayPlug\SyliusPayPlugPlugin\Action\Api\ApiAwareTrait; use PayPlug\SyliusPayPlugPlugin\Creator\PayPlugPaymentDataCreator; +use PayPlug\SyliusPayPlugPlugin\Gateway\AmericanExpressGatewayFactory; +use PayPlug\SyliusPayPlugPlugin\Gateway\BancontactGatewayFactory; +use PayPlug\SyliusPayPlugPlugin\Gateway\OneyGatewayFactory; +use PayPlug\SyliusPayPlugPlugin\Gateway\PayPlugGatewayFactory; use Payum\Core\Action\ActionInterface; use Payum\Core\ApiAwareInterface; use Payum\Core\Exception\RequestNotSupportedException; use Payum\Core\Request\Convert; use Sylius\Component\Core\Model\PaymentInterface; +use Symfony\Component\DependencyInjection\Attribute\AsAlias; +use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; +#[AsAlias(id: 'payplug_sylius_payplug_plugin.action.convert_payment', public: true)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => PayPlugGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => OneyGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => BancontactGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => AmericanExpressGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] final class ConvertPaymentAction implements ActionInterface, ApiAwareInterface { use ApiAwareTrait; diff --git a/src/Action/NotifyAction.php b/src/Action/NotifyAction.php index 0224ff12..e65e6846 100644 --- a/src/Action/NotifyAction.php +++ b/src/Action/NotifyAction.php @@ -9,6 +9,10 @@ use Payplug\Exception\PayplugException; use PayPlug\SyliusPayPlugPlugin\Action\Api\ApiAwareTrait; use PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientInterface; +use PayPlug\SyliusPayPlugPlugin\Gateway\AmericanExpressGatewayFactory; +use PayPlug\SyliusPayPlugPlugin\Gateway\BancontactGatewayFactory; +use PayPlug\SyliusPayPlugPlugin\Gateway\OneyGatewayFactory; +use PayPlug\SyliusPayPlugPlugin\Gateway\PayPlugGatewayFactory; use PayPlug\SyliusPayPlugPlugin\Handler\PaymentNotificationHandler; use PayPlug\SyliusPayPlugPlugin\Handler\RefundNotificationHandler; use Payum\Core\Action\ActionInterface; @@ -18,8 +22,39 @@ use Payum\Core\GatewayAwareTrait; use Payum\Core\Request\Notify; use Psr\Log\LoggerInterface; +use Symfony\Component\DependencyInjection\Attribute\AsAlias; +use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; use Symfony\Component\DependencyInjection\Attribute\Autowire; +#[AsAlias(id: 'payplug_sylius_payplug_plugin.action.notify', public: true)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => PayPlugGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => OneyGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => BancontactGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => AmericanExpressGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] final class NotifyAction implements ActionInterface, ApiAwareInterface, GatewayAwareInterface { use GatewayAwareTrait; diff --git a/src/Action/StatusAction.php b/src/Action/StatusAction.php index d7797fa0..7d43cb6c 100644 --- a/src/Action/StatusAction.php +++ b/src/Action/StatusAction.php @@ -6,6 +6,10 @@ use PayPlug\SyliusPayPlugPlugin\Action\Api\ApiAwareTrait; use PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientInterface; +use PayPlug\SyliusPayPlugPlugin\Gateway\AmericanExpressGatewayFactory; +use PayPlug\SyliusPayPlugPlugin\Gateway\BancontactGatewayFactory; +use PayPlug\SyliusPayPlugPlugin\Gateway\OneyGatewayFactory; +use PayPlug\SyliusPayPlugPlugin\Gateway\PayPlugGatewayFactory; use PayPlug\SyliusPayPlugPlugin\Handler\PaymentNotificationHandler; use PayPlug\SyliusPayPlugPlugin\PaymentProcessing\RefundPaymentHandlerInterface; use PayPlug\SyliusPayPlugPlugin\StateMachine\Transition\OrderPaymentTransitions; @@ -19,8 +23,39 @@ use Payum\Core\Request\GetStatusInterface; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\Model\PaymentInterface; +use Symfony\Component\DependencyInjection\Attribute\AsAlias; +use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; use Symfony\Component\HttpFoundation\RequestStack; +#[AsAlias(id: 'payplug_sylius_payplug_plugin.action.status', public: true)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => PayPlugGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => OneyGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => BancontactGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] +#[AutoconfigureTag( + name: 'payum.action', + attributes: [ + 'factory' => AmericanExpressGatewayFactory::FACTORY_NAME, + 'alias' => 'payum.action.capture', + ], +)] final class StatusAction implements ActionInterface, GatewayAwareInterface, ApiAwareInterface { use GatewayAwareTrait; diff --git a/src/Controller/AbstractOneyController.php b/src/Controller/AbstractOneyController.php index 513bc947..112a3619 100644 --- a/src/Controller/AbstractOneyController.php +++ b/src/Controller/AbstractOneyController.php @@ -4,7 +4,7 @@ namespace PayPlug\SyliusPayPlugPlugin\Controller; -use PayPlug\SyliusPayPlugPlugin\Provider\OneySimulation\OneySimulationDataProvider; +use PayPlug\SyliusPayPlugPlugin\Provider\OneySimulation\OneySimulationDataProviderInterface; use PayPlug\SyliusPayPlugPlugin\Twig\OneyRulesExtension; use Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductRepository; use Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductVariantRepository; @@ -25,7 +25,7 @@ abstract class AbstractOneyController extends AbstractController { public function __construct( - protected OneySimulationDataProvider $oneySimulationDataProvider, + protected OneySimulationDataProviderInterface $oneySimulationDataProvider, protected CartContextInterface $cartContext, protected ProductRepository $productRepository, protected ProductVariantRepository $productVariantRepository, diff --git a/src/Creator/RefundUnitsCommandCreatorDecorator.php b/src/Creator/RefundUnitsCommandCreatorDecorator.php index 498e38dd..45b67600 100644 --- a/src/Creator/RefundUnitsCommandCreatorDecorator.php +++ b/src/Creator/RefundUnitsCommandCreatorDecorator.php @@ -40,6 +40,7 @@ public function __construct( private PaymentMethodRepositoryInterface $paymentMethodRepository, private OrderRepositoryInterface $orderRepository, private TranslatorInterface $translator, + #[Autowire('@payplug_sylius_payplug_plugin.api_client.oney')] private PayPlugApiClientInterface $oneyClient, ) { } diff --git a/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php b/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php index 4277ab5e..edf4abb0 100644 --- a/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php +++ b/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php @@ -10,6 +10,7 @@ use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; final class PayPlugSyliusPayPlugExtension extends Extension implements PrependExtensionInterface { @@ -20,9 +21,13 @@ final class PayPlugSyliusPayPlugExtension extends Extension implements PrependEx */ public function load(array $configs, ContainerBuilder $container): void { - $loader = new XmlFileLoader($container, new FileLocator(dirname(__DIR__, 2) . '/config')); + $ymlloader = new YamlFileLoader($container, new FileLocator(dirname(__DIR__, 2) . '/config')); + $xmlloader = new XmlFileLoader($container, new FileLocator(dirname(__DIR__, 2) . '/config/services')); - $loader->load('services.xml'); + $ymlloader->load('services.yaml'); + + $xmlloader->load('client.xml'); + $xmlloader->load('gateway.xml'); } public function prepend(ContainerBuilder $container): void diff --git a/src/Provider/OneySimulation/OneySimulationDataProvider.php b/src/Provider/OneySimulation/OneySimulationDataProvider.php index 7408ad28..cb94dc22 100644 --- a/src/Provider/OneySimulation/OneySimulationDataProvider.php +++ b/src/Provider/OneySimulation/OneySimulationDataProvider.php @@ -14,6 +14,7 @@ final class OneySimulationDataProvider implements OneySimulationDataProviderInterface { public function __construct( + #[Autowire('@payplug_sylius_payplug_plugin.api_client.oney')] private PayPlugApiClientInterface $oneyClient, #[Autowire('@monolog.logger.payum')] private LoggerInterface $logger, diff --git a/src/Provider/Payment/ApplePayPaymentProvider.php b/src/Provider/Payment/ApplePayPaymentProvider.php index 06dc6e99..2f6aeea4 100644 --- a/src/Provider/Payment/ApplePayPaymentProvider.php +++ b/src/Provider/Payment/ApplePayPaymentProvider.php @@ -29,6 +29,7 @@ use Sylius\Component\Core\TokenAssigner\OrderTokenAssignerInterface; use Sylius\Component\Payment\Factory\PaymentFactoryInterface; use Sylius\Component\Payment\PaymentTransitions; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Generator\UrlGenerator; use Symfony\Component\Routing\RouterInterface; @@ -43,6 +44,7 @@ public function __construct( // private StateMachineFactoryInterface $stateMachineFactory; private PaymentMethodRepositoryInterface $paymentMethodRepository, private PayPlugPaymentDataCreator $paymentDataCreator, + #[Autowire('@sylius_payplug_plugin.api_client.apple_pay')] private PayPlugApiClientInterface $applePayClient, private EntityManagerInterface $entityManager, private OrderTokenAssignerInterface $orderTokenAssigner, diff --git a/src/Twig/GetCurrentRouteExtension.php b/src/Twig/GetCurrentRouteExtension.php index 68adb793..c396db49 100644 --- a/src/Twig/GetCurrentRouteExtension.php +++ b/src/Twig/GetCurrentRouteExtension.php @@ -11,13 +11,9 @@ final class GetCurrentRouteExtension extends AbstractExtension { - /** @var Request|null */ - private $request; - public function __construct( - RequestStack $requestStack, + private RequestStack $requestStack, ) { - $this->request = $requestStack->getCurrentRequest(); } public function getFunctions(): array @@ -29,10 +25,11 @@ public function getFunctions(): array public function payplugGetCurrentRoute(): string { - if (!$this->request instanceof Request) { + $currentRequest = $this->requestStack->getCurrentRequest(); + if (!$currentRequest instanceof Request) { return ''; } - return $this->request->get('_route', ''); + return $currentRequest->get('_route', ''); } } diff --git a/src/Twig/OneyRulesExtension.php b/src/Twig/OneyRulesExtension.php index 76dea3e4..fe2116e7 100644 --- a/src/Twig/OneyRulesExtension.php +++ b/src/Twig/OneyRulesExtension.php @@ -15,6 +15,7 @@ use Sylius\Component\Core\Repository\ProductRepositoryInterface; use Sylius\Component\Currency\Model\CurrencyInterface; use Sylius\Component\Order\Context\CartContextInterface; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\HttpFoundation\RequestStack; use Twig\Extension\AbstractExtension; use Twig\TwigFunction; @@ -25,6 +26,7 @@ final class OneyRulesExtension extends AbstractExtension public function __construct( private OneyCheckerInterface $oneyChecker, private CartContextInterface $cartContext, + #[Autowire('@payplug_sylius_payplug_plugin.api_client.oney')] private PayPlugApiClientInterface $oneyClient, private MoneyFormatterInterface $moneyFormatter, private ProductRepositoryInterface $productRepository, diff --git a/src/Twig/ShowMeaExtension.php b/src/Twig/ShowMeaExtension.php index 32cedd51..e74e601f 100644 --- a/src/Twig/ShowMeaExtension.php +++ b/src/Twig/ShowMeaExtension.php @@ -6,6 +6,7 @@ use PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientInterface; use Sylius\Component\Locale\Context\LocaleContextInterface; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use Twig\Extension\AbstractExtension; use Twig\TwigFunction; @@ -16,6 +17,7 @@ final class ShowMeaExtension extends AbstractExtension public function __construct( private LocaleContextInterface $localeContext, + #[Autowire('@payplug_sylius_payplug_plugin.api_client.oney')] private PayPlugApiClientInterface $oneyClient, ) { } From d299a342e5d58369f42a3f0ed7219ea0b75c81e6 Mon Sep 17 00:00:00 2001 From: maxperei Date: Wed, 16 Apr 2025 17:47:45 +0200 Subject: [PATCH 007/112] refactor(client): [deprecation] sylius core bundle version instead of kernel --- src/ApiClient/PayPlugApiClient.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ApiClient/PayPlugApiClient.php b/src/ApiClient/PayPlugApiClient.php index f581189d..ebc50236 100644 --- a/src/ApiClient/PayPlugApiClient.php +++ b/src/ApiClient/PayPlugApiClient.php @@ -15,7 +15,7 @@ use Payplug\Resource\Refund; use PayPlug\SyliusPayPlugPlugin\Gateway\PayPlugGatewayFactory; use PayPlug\SyliusPayPlugPlugin\PayPlugSyliusPayPlugPlugin; -use Sylius\Bundle\CoreBundle\Application\Kernel; +use Sylius\Bundle\CoreBundle\SyliusCoreBundle; use Symfony\Component\Cache\Adapter\ArrayAdapter; use Symfony\Contracts\Cache\CacheInterface; use Webmozart\Assert\Assert; @@ -49,7 +49,7 @@ public function __construct(string $secretKey, ?string $factoryName = null, ?Cac HttpClient::addDefaultUserAgentProduct( 'PayPlug-Sylius', PayPlugSyliusPayPlugPlugin::VERSION, - 'Sylius/' . Kernel::VERSION, + 'Sylius/' . SyliusCoreBundle::VERSION, ); } @@ -62,7 +62,7 @@ public function initialise(string $secretKey): void HttpClient::addDefaultUserAgentProduct( 'PayPlug-Sylius', PayPlugSyliusPayPlugPlugin::VERSION, - 'Sylius/' . Kernel::VERSION, + 'Sylius/' . SyliusCoreBundle::VERSION, ); } From 920bb02bd0e924a2af31240d17d39852ec5c359a Mon Sep 17 00:00:00 2001 From: maxperei Date: Thu, 17 Apr 2025 10:08:17 +0200 Subject: [PATCH 008/112] refactor(routing): [config] change from yaml to php attributes --- config/routing.yaml | 98 +------------------ config/routing/admin.yaml | 5 + config/routing/shop.yaml | 5 + .../Admin/CompleteRefundPaymentAction.php | 2 + src/Action/Admin/RefundUnitsAction.php | 2 + src/Controller/CardController.php | 3 + src/Controller/CompleteInfoController.php | 2 + .../IntegratedPaymentController.php | 2 + src/Controller/IpnAction.php | 2 + src/Controller/OneClickAction.php | 2 + src/Controller/OneyIsProductEligible.php | 2 + src/Controller/OneySimulationPopin.php | 2 + src/Controller/OrderController.php | 49 ++++++++++ 13 files changed, 83 insertions(+), 93 deletions(-) create mode 100644 config/routing/admin.yaml create mode 100644 config/routing/shop.yaml diff --git a/config/routing.yaml b/config/routing.yaml index 7b7994f4..84c98416 100644 --- a/config/routing.yaml +++ b/config/routing.yaml @@ -1,94 +1,6 @@ -sylius_refund_complete_refund_payment: - path: /%sylius_admin.path_name%/orders/{orderNumber}/refund-payments/{id}/complete - methods: [POST] - defaults: - _controller: PayPlug\SyliusPayPlugPlugin\Action\Admin\CompleteRefundPaymentAction +payplug_sylius_admin: + resource: "@PayPlugSyliusPayPlugPlugin/config/routing/admin.yaml" + prefix: '/%sylius_admin.path_name%' -sylius_refund_refund_units: - path: /%sylius_admin.path_name%/orders/{orderNumber}/refund-units - defaults: - _controller: PayPlug\SyliusPayPlugPlugin\Action\Admin\RefundUnitsAction - -payplug_sylius_oney_complete_info: - path: /{_locale}/payplug/oney_complete_info - methods: ['GET', 'POST'] - defaults: - _controller: 'PayPlug\SyliusPayPlugPlugin\Controller\CompleteInfoController' - -payplug_sylius_oney_simulation_popin: - path: /{_locale}/payplug/oney_popin - methods: ['GET'] - defaults: - _controller: 'PayPlug\SyliusPayPlugPlugin\Controller\OneySimulationPopin' - -payplug_sylius_oney_is_product_eligible: - path: /{_locale}/payplug/oney/is-product-eligible - methods: ['GET'] - defaults: - _controller: 'PayPlug\SyliusPayPlugPlugin\Controller\OneyIsProductEligible' - -payplug_sylius_card_account_index: - path: /{_locale}/account/saved-cards - methods: ['GET'] - defaults: - _controller: 'PayPlug\SyliusPayPlugPlugin\Controller\CardController::indexAction' - -payplug_sylius_card_account_delete: - path: /{_locale}/account/saved-cards/delete/{id} - methods: ['DELETE'] - defaults: - _controller: 'PayPlug\SyliusPayPlugPlugin\Controller\CardController::deleteAction' - -payplug_sylius_oneclick_verification: - path: /{_locale}/payment/capture/{payum_token}/1-click-checkup - methods: ['GET'] - defaults: - _controller: 'PayPlug\SyliusPayPlugPlugin\Controller\OneClickAction' - -payplug_sylius_ipn: - path: /payplug/ipn - methods: ['GET', 'POST'] - defaults: - _controller: 'PayPlug\SyliusPayPlugPlugin\Controller\IpnAction' - -payplug_shop_checkout_apple_prepare: - path: /payplug/apple-pay/prepare/{orderId} - methods: [POST, GET] - defaults: - _controller: 'PayPlug\SyliusPayPlugPlugin\Controller\OrderController::initiateApplePaySessionAction' - _sylius: - flash: false - repository: - method: find - arguments: - - "expr:service('PayPlug\\SyliusPayPlugPlugin\\Provider\\ApplePayOrderProvider').getCurrentCart()" - -payplug_shop_checkout_apple_confirm: - path: /payplug/apple-pay/complete/{orderId} - methods: [POST, GET] - defaults: - _controller: 'PayPlug\SyliusPayPlugPlugin\Controller\OrderController::confirmApplePayPaymentAction' - _sylius: - flash: false - repository: - method: find - arguments: - - "expr:service('PayPlug\\SyliusPayPlugPlugin\\Provider\\ApplePayOrderProvider').getCurrentCart()" - -payplug_shop_checkout_apple_cancel: - path: /payplug/apple-pay/cancel/{orderId} - methods: [POST, GET] - defaults: - _controller: 'PayPlug\SyliusPayPlugPlugin\Controller\OrderController::cancelApplePaySessionAction' - _sylius: - flash: false - repository: - method: find - arguments: - - "expr:service('PayPlug\\SyliusPayPlugPlugin\\Provider\\ApplePayOrderProvider').getCurrentCart()" - -payplug_sylius_integrated_payment_init: - path: /{_locale}/payplug/integrated_payment/init/{paymentMethodId} - methods: ['GET', 'POST'] - defaults: - _controller: 'PayPlug\SyliusPayPlugPlugin\Controller\IntegratedPaymentController::initPaymentAction' +payplug_sylius_shop: + resource: "@PayPlugSyliusPayPlugPlugin/config/routing/shop.yaml" diff --git a/config/routing/admin.yaml b/config/routing/admin.yaml new file mode 100644 index 00000000..4800b8e9 --- /dev/null +++ b/config/routing/admin.yaml @@ -0,0 +1,5 @@ +controllers: + resource: + path: '../../src/Action/Admin/' + namespace: 'PayPlug\SyliusPayPlugPlugin\Action\Admin' + type: attribute \ No newline at end of file diff --git a/config/routing/shop.yaml b/config/routing/shop.yaml new file mode 100644 index 00000000..4f34982e --- /dev/null +++ b/config/routing/shop.yaml @@ -0,0 +1,5 @@ +controllers: + resource: + path: '../../src/Controller/' + namespace: 'PayPlug\SyliusPayPlugPlugin\Controller' + type: attribute \ No newline at end of file diff --git a/src/Action/Admin/CompleteRefundPaymentAction.php b/src/Action/Admin/CompleteRefundPaymentAction.php index 917ccd3e..548d0029 100644 --- a/src/Action/Admin/CompleteRefundPaymentAction.php +++ b/src/Action/Admin/CompleteRefundPaymentAction.php @@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Attribute\AsController; use Symfony\Component\Messenger\MessageBusInterface; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Routing\RouterInterface; use Symfony\Contracts\Translation\TranslatorInterface; use Throwable; @@ -37,6 +38,7 @@ public function __construct( ) { } + #[Route(path: '/orders/{orderNumber}/refund-payments/{id}/complete', name: 'sylius_admin_refund_payment_complete', methods: ['POST'])] public function __invoke(string $orderNumber, string $id): Response { /** @var RefundPaymentInterface $refundPayment */ diff --git a/src/Action/Admin/RefundUnitsAction.php b/src/Action/Admin/RefundUnitsAction.php index 4db69c54..33d8e933 100644 --- a/src/Action/Admin/RefundUnitsAction.php +++ b/src/Action/Admin/RefundUnitsAction.php @@ -16,6 +16,7 @@ use Symfony\Component\HttpKernel\Attribute\AsController; use Symfony\Component\Messenger\Exception\HandlerFailedException; use Symfony\Component\Messenger\MessageBusInterface; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; #[AsController] @@ -31,6 +32,7 @@ public function __construct( ) { } + #[Route(path: '/orders/{orderNumber}/refunds-units', name: 'sylius_refund_refund_units', methods: ['POST'])] public function __invoke(Request $request): Response { try { diff --git a/src/Controller/CardController.php b/src/Controller/CardController.php index 5467564f..cdadb18b 100644 --- a/src/Controller/CardController.php +++ b/src/Controller/CardController.php @@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Attribute\AsController; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Contracts\Translation\TranslatorInterface; #[AsController] @@ -32,6 +33,7 @@ public function __construct( ) { } + #[Route(path: '/{_locale}/account/saved-cards', name: 'payplug_sylius_card_account_index', methods: ['GET'])] public function indexAction(): Response { $customer = $this->customerContext->getCustomer(); @@ -48,6 +50,7 @@ public function indexAction(): Response ]); } + #[Route(path: '/{_locale}/account/saved-cards/delete/{id}', name: 'payplug_sylius_card_account_delete', methods: ['DELETE'])] public function deleteAction(int $id): Response { $customer = $this->customerContext->getCustomer(); diff --git a/src/Controller/CompleteInfoController.php b/src/Controller/CompleteInfoController.php index a0d9e48d..77b07555 100644 --- a/src/Controller/CompleteInfoController.php +++ b/src/Controller/CompleteInfoController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Attribute\AsController; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Validator\Constraints\NotBlank; use Webmozart\Assert\Assert; @@ -30,6 +31,7 @@ public function __construct( ) { } + #[Route(path: '/{_locale}/payplug/oney_complete_info', name: 'payplug_sylius_oney_complete_info', methods: ['GET', 'POST'])] public function __invoke( Request $request, CartContextInterface $cartContext, diff --git a/src/Controller/IntegratedPaymentController.php b/src/Controller/IntegratedPaymentController.php index 1ddd7ff4..8c60d622 100644 --- a/src/Controller/IntegratedPaymentController.php +++ b/src/Controller/IntegratedPaymentController.php @@ -22,6 +22,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Attribute\AsController; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; +use Symfony\Component\Routing\Attribute\Route; #[AsController] final class IntegratedPaymentController extends AbstractController @@ -48,6 +49,7 @@ public function __construct( * * @see https://docs.payplug.com/api/integratedref.html#trigger-a-payment */ + #[Route(path: '/{_locale}/payplug/integrated-payment/init', name: 'payplug_sylius_integrated_payment_init', methods: ['GET', 'POST'])] public function initPaymentAction(Request $request, int $paymentMethodId): Response { $paymentMethod = $this->paymentMethodRepository->find($paymentMethodId); diff --git a/src/Controller/IpnAction.php b/src/Controller/IpnAction.php index cf1d2d3e..25d67368 100644 --- a/src/Controller/IpnAction.php +++ b/src/Controller/IpnAction.php @@ -24,6 +24,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Attribute\AsController; +use Symfony\Component\Routing\Attribute\Route; use Webmozart\Assert\Assert; #[AsController] @@ -41,6 +42,7 @@ public function __construct( ) { } + #[Route(path: '/payplug/ipn', name: 'payplug_sylius_ipn', methods: ['GET', 'POST'])] public function __invoke(Request $request): JsonResponse { $input = $request->getContent(); diff --git a/src/Controller/OneClickAction.php b/src/Controller/OneClickAction.php index 51a4b9ae..307a0527 100644 --- a/src/Controller/OneClickAction.php +++ b/src/Controller/OneClickAction.php @@ -20,6 +20,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Attribute\AsController; +use Symfony\Component\Routing\Attribute\Route; #[AsController] class OneClickAction extends AbstractController implements GatewayAwareInterface, ApiAwareInterface @@ -34,6 +35,7 @@ public function __construct( ) { } + #[Route(path: '/{_locale}/payment/capture/{payum_token}/1-click-checkup', name: 'payplug_sylius_oneclick_verification', methods: ['GET'])] public function __invoke(Request $request): Response { $token = $this->payum->getHttpRequestVerifier()->verify($request); diff --git a/src/Controller/OneyIsProductEligible.php b/src/Controller/OneyIsProductEligible.php index 2861d639..616760e7 100644 --- a/src/Controller/OneyIsProductEligible.php +++ b/src/Controller/OneyIsProductEligible.php @@ -10,11 +10,13 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Attribute\AsController; +use Symfony\Component\Routing\Attribute\Route; use Webmozart\Assert\Assert; #[AsController] final class OneyIsProductEligible extends AbstractOneyController { + #[Route(path: '/{_locale}/payplug/oney/is-product-eligible', name: 'payplug_sylius_oney_is_product_eligible', methods: ['GET'])] public function __invoke(Request $request): JsonResponse { /** @var OrderInterface $cart */ diff --git a/src/Controller/OneySimulationPopin.php b/src/Controller/OneySimulationPopin.php index a3af8572..5d6bbd45 100644 --- a/src/Controller/OneySimulationPopin.php +++ b/src/Controller/OneySimulationPopin.php @@ -10,11 +10,13 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Attribute\AsController; +use Symfony\Component\Routing\Attribute\Route; use Webmozart\Assert\Assert; #[AsController] final class OneySimulationPopin extends AbstractOneyController { + #[Route(path: '/{_locale}/payplug/oney_popin', name: 'payplug_sylius_oney_simulation_popin', methods: ['GET'])] public function __invoke(Request $request): Response { /** @var OrderInterface $cart */ diff --git a/src/Controller/OrderController.php b/src/Controller/OrderController.php index 00d6b292..f7c357bb 100644 --- a/src/Controller/OrderController.php +++ b/src/Controller/OrderController.php @@ -39,6 +39,7 @@ use Symfony\Component\HttpKernel\Attribute\AsController; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\Lock\LockFactory; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Webmozart\Assert\Assert; @@ -94,6 +95,22 @@ public function __construct( ); } + #[Route( + path: '/payplug/apple-pay/prepare/{orderId}', + name: 'payplug_shop_checkout_apple_prepare', + options: [ + '_sylius' => [ + 'flash' => false, + 'repository' => [ + 'method' => 'find', + 'arguments' => [ + 'expr:service("PayPlug\\SyliusPayPlugPlugin\\Provider\\ApplePayOrderProvider").getCurrentCart()', + ], + ], + ], + ], + methods: ['GET', 'POST'], + )] public function initiateApplePaySessionAction(Request $request): Response { $configuration = $this->requestConfigurationFactory->create($this->metadata, $request); @@ -189,6 +206,22 @@ public function initiateApplePaySessionAction(Request $request): Response } } + #[Route( + path: '/payplug/apple-pay/complete/{orderId}', + name: 'payplug_shop_checkout_apple_confirm', + options: [ + '_sylius' => [ + 'flash' => false, + 'repository' => [ + 'method' => 'find', + 'arguments' => [ + 'expr:service("PayPlug\\SyliusPayPlugPlugin\\Provider\\ApplePayOrderProvider").getCurrentCart()', + ], + ], + ], + ], + methods: ['GET', 'POST'], + )] public function confirmApplePayPaymentAction(Request $request): Response { $configuration = $this->requestConfigurationFactory->create($this->metadata, $request); @@ -286,6 +319,22 @@ public function confirmApplePayPaymentAction(Request $request): Response return new JsonResponse($response, Response::HTTP_OK); } + #[Route( + path: '/payplug/apple-pay/cancel/{orderId}', + name: 'payplug_shop_checkout_apple_cancel', + options: [ + '_sylius' => [ + 'flash' => false, + 'repository' => [ + 'method' => 'find', + 'arguments' => [ + 'expr:service("PayPlug\\SyliusPayPlugPlugin\\Provider\\ApplePayOrderProvider").getCurrentCart()', + ], + ], + ], + ], + methods: ['GET', 'POST'], + )] public function cancelApplePaySessionAction(Request $request): Response { $configuration = $this->requestConfigurationFactory->create($this->metadata, $request); From c42fb7838c941723bffaeb46a41f891bf0c1dfc7 Mon Sep 17 00:00:00 2001 From: maxperei Date: Thu, 17 Apr 2025 14:51:18 +0200 Subject: [PATCH 009/112] fix(tests): [behat] patch mocker to run something somehow --- tests/Behat/Mocker/PayPlugApiMocker.php | 150 ++++++++---------- tests/Behat/Resources/services.xml | 2 +- .../Resources/services/contexts/setup.xml | 12 +- .../Behat/Resources/services/contexts/ui.xml | 2 +- .../ui/paying_with_payplug_for_order.yml | 2 +- .../suites/ui/refunding_payplug_payment.yml | 2 +- 6 files changed, 80 insertions(+), 90 deletions(-) diff --git a/tests/Behat/Mocker/PayPlugApiMocker.php b/tests/Behat/Mocker/PayPlugApiMocker.php index 43aa78b0..f6e07ce5 100644 --- a/tests/Behat/Mocker/PayPlugApiMocker.php +++ b/tests/Behat/Mocker/PayPlugApiMocker.php @@ -8,48 +8,43 @@ use Payplug\Resource\Refund; use PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientInterface; use PayPlug\SyliusPayPlugPlugin\Gateway\PayPlugGatewayFactory; -use Sylius\Behat\Service\Mocker\MockerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; final class PayPlugApiMocker { - /** @var ContainerInterface */ - private $container; - - /** @var MockerInterface */ - private $mocker; - - public function __construct(MockerInterface $mocker, ContainerInterface $container) + public function __construct(private ContainerInterface $container) { - $this->mocker = $mocker; - $this->container = $container; } - public function getPayPlugApiClient() + public function getPayPlugApiClient(): PayPlugApiClient { - return new PayPlugApiClient($this->container, 'payplug_sylius_payplug_plugin.api_client.payplug'); + return new PayPlugApiClient( + $this->container, + 'payplug_sylius_payplug_plugin.api_client.payplug', + ); } public function mockApiRefundedPayment(callable $action): void { - $mock = $this->mocker->mockService('payplug_sylius_payplug_plugin.api_client.payplug', PayPlugApiClientInterface::class); - $mock - ->shouldReceive('initialise') - ; + $mock = \Mockery::mock( + 'payplug_sylius_payplug_plugin.api_client.payplug', + PayPlugApiClientInterface::class, + ); + $mock->shouldReceive('initialise'); $mock ->shouldReceive('refundPayment') ->andReturn(\Mockery::mock('refund', Refund::class)) ; $action(); - $this->mocker->unmockAll(); } public function mockApiRefundedWithAmountPayment(callable $action): void { - $mock = $this->mocker->mockService('payplug_sylius_payplug_plugin.api_client.payplug', PayPlugApiClientInterface::class); - $mock - ->shouldReceive('initialise') - ; + $mock = \Mockery::mock( + 'payplug_sylius_payplug_plugin.api_client.payplug', + PayPlugApiClientInterface::class, + ); + $mock->shouldReceive('initialise'); $payment = \Mockery::mock('payment', Payment::class); $payment->id = 'pay_1'; $payment->is_paid = true; @@ -70,15 +65,15 @@ public function mockApiRefundedWithAmountPayment(callable $action): void ->andReturn($refund) ; $action(); - $this->mocker->unmockAll(); } public function mockApiCreatePayment(callable $action): void { - $mock = $this->mocker->mockService('payplug_sylius_payplug_plugin.api_client.payplug', PayPlugApiClientInterface::class); - $mock - ->shouldReceive('initialise') - ; + $mock = \Mockery::mock( + 'payplug_sylius_payplug_plugin.api_client.payplug', + PayPlugApiClientInterface::class, + ); + $mock->shouldReceive('initialise'); $payment = \Mockery::mock('payment', Payment::class); $payment->id = 'pay_1'; $payment->is_live = false; @@ -90,16 +85,15 @@ public function mockApiCreatePayment(callable $action): void ->andReturn($payment) ; $action(); - $this->mocker->unmockAll(); } public function mockApiSuccessfulPayment(callable $action): void { - $mock = $this->mocker->mockService('payplug_sylius_payplug_plugin.api_client.payplug', PayPlugApiClientInterface::class); - $mock - ->shouldReceive('initialise') - ->shouldReceive('createPayment') - ; + $mock = \Mockery::mock( + 'payplug_sylius_payplug_plugin.api_client.payplug', + PayPlugApiClientInterface::class, + ); + $mock->shouldReceive('initialise', 'createPayment'); $payment = \Mockery::mock('payment', Payment::class); $payment->id = 'pay_1'; $payment->is_paid = true; @@ -113,12 +107,11 @@ public function mockApiSuccessfulPayment(callable $action): void ->andReturn($payment) ; $action(); - $this->mocker->unmockAll(); } public function mockApiRetrievePayment(callable $action): void { - $mock = $this->mocker->mockService( + $mock = \Mockery::mock( 'payplug_sylius_payplug_plugin.api_client.oney', PayPlugApiClientInterface::class, ); @@ -130,12 +123,11 @@ public function mockApiRetrievePayment(callable $action): void ->andReturn($payment) ; $action(); - $this->mocker->unmockAll(); } public function mockApiRetrieveNotRefundablePayment(callable $action): void { - $mock = $this->mocker->mockService( + $mock = \Mockery::mock( 'payplug_sylius_payplug_plugin.api_client.oney', PayPlugApiClientInterface::class, ); @@ -147,15 +139,15 @@ public function mockApiRetrieveNotRefundablePayment(callable $action): void ->andReturn($payment) ; $action(); - $this->mocker->unmockAll(); } public function mockApiFailedPayment(callable $action): void { - $mock = $this->mocker->mockService('payplug_sylius_payplug_plugin.api_client.payplug', PayPlugApiClientInterface::class); - $mock - ->shouldReceive('initialise') - ; + $mock = \Mockery::mock( + 'payplug_sylius_payplug_plugin.api_client.payplug', + PayPlugApiClientInterface::class, + ); + $mock->shouldReceive('initialise'); $payment = \Mockery::mock('payment', Payment::class); $payment->id = 'pay_1'; $payment->is_paid = false; @@ -164,19 +156,21 @@ public function mockApiFailedPayment(callable $action): void ->andReturn($payment) ; $action(); - $this->mocker->unmockAll(); } public function mockApiExpiredPayment(callable $action): void { - $mock = $this->mocker->mockService('payplug_sylius_payplug_plugin.api_client.payplug', PayPlugApiClientInterface::class); - $mock - ->shouldReceive('initialise') - ; + $mock = \Mockery::mock( + 'payplug_sylius_payplug_plugin.api_client.payplug', + PayPlugApiClientInterface::class, + ); + $mock->shouldReceive('initialise'); + $payment = \Mockery::mock('payment', Payment::class); $payment->id = 'pay_1'; $payment->status = 'failure'; $payment->is_paid = false; + $failure = new \stdClass(); $failure->code = 'timeout'; $failure->message = 'The customer has not tried to pay and left the payment page.'; @@ -186,15 +180,16 @@ public function mockApiExpiredPayment(callable $action): void ->andReturn($payment) ; $action(); - $this->mocker->unmockAll(); } public function mockApiCreatedPayment(callable $action): void { - $mock = $this->mocker->mockService('payplug_sylius_payplug_plugin.api_client.payplug', PayPlugApiClientInterface::class); - $mock - ->shouldReceive('initialise') - ; + $mock = \Mockery::mock( + 'payplug_sylius_payplug_plugin.api_client.payplug', + PayPlugApiClientInterface::class, + ); + $mock->shouldReceive('initialise'); + $payment = \Mockery::mock('payment', Payment::class); $payment->id = 'pay_1'; $payment->status = 'created'; @@ -204,21 +199,20 @@ public function mockApiCreatedPayment(callable $action): void ->andReturn($payment) ; $action(); - $this->mocker->unmockAll(); } public function mockApiCancelledPayment(callable $action): void { - $mock = $this->mocker->mockService('payplug_sylius_payplug_plugin.api_client.payplug', PayPlugApiClientInterface::class); - $mock - ->shouldReceive('initialise') - ; + $mock = \Mockery::mock( + 'payplug_sylius_payplug_plugin.api_client.payplug', + PayPlugApiClientInterface::class, + ); + $mock->shouldReceive('initialise'); $payment = \Mockery::mock('payment', Payment::class); $payment->id = 'pay_1'; $payment->state = 'abort'; $payment->is_paid = false; - $mock ->shouldReceive('abortPayment')->once() ->withArgs(['pay_1']) @@ -226,21 +220,20 @@ public function mockApiCancelledPayment(callable $action): void ; $action(); - $this->mocker->unmockAll(); } public function mockMultipleApiCancelledPayment(callable $action): void { - $mock = $this->mocker->mockService('payplug_sylius_payplug_plugin.api_client.payplug', PayPlugApiClientInterface::class); - $mock - ->shouldReceive('initialise') - ; + $mock = \Mockery::mock( + 'payplug_sylius_payplug_plugin.api_client.payplug', + PayPlugApiClientInterface::class, + ); + $mock->shouldReceive('initialise'); $payment = \Mockery::mock('payment', Payment::class); $payment->id = 'pay_1'; $payment->state = 'abort'; $payment->is_paid = false; - $mock ->shouldReceive('abortPayment') ->withArgs(['pay_1']) @@ -248,37 +241,38 @@ public function mockMultipleApiCancelledPayment(callable $action): void ; $action(); - $this->mocker->unmockAll(); } public function mockApiStatePayment(callable $action): void { - $mock = $this->mocker->mockService('payplug_sylius_payplug_plugin.api_client.payplug', PayPlugApiClientInterface::class); + $mock = \Mockery::mock( + 'payplug_sylius_payplug_plugin.api_client.payplug', + PayPlugApiClientInterface::class, + ); $mock->shouldReceive('initialise'); $payment = \Mockery::mock('payment', Payment::class); $payment->state = 'failed'; $payment->is_paid = false; $payment->failure = true; $mock - ->shouldReceive('retrieve')//->withArgs(['paymentId' => '123456']) + ->shouldReceive('retrieve') ->andReturn($payment) ; $action(); - $this->mocker->unmockAll(); } public function refundPaymentWithAmount(callable $action): void { $action(); - $this->mocker->unmockAll(); } public function mockApiRefundedFromPayPlugPortal(callable $action): void { - $mock = $this->mocker->mockService('payplug_sylius_payplug_plugin.api_client.payplug', PayPlugApiClientInterface::class); - $mock - ->shouldReceive('initialise') - ; + $mock = \Mockery::mock( + 'payplug_sylius_payplug_plugin.api_client.payplug', + PayPlugApiClientInterface::class, + ); + $mock->shouldReceive('initialise'); $refund = \Mockery::mock('refund', Refund::class); $refund->amount = 34000; $refund->currency = 'EUR'; @@ -290,12 +284,11 @@ public function mockApiRefundedFromPayPlugPortal(callable $action): void ->andReturn($refund) ; $action(); - $this->mocker->unmockAll(); } public function mockApiRefundPartiallyFromPayPlugPortal(callable $action, int $amount): void { - $mock = $this->mocker->mockService('payplug_sylius_payplug_plugin.api_client.payplug', PayPlugApiClientInterface::class); + $mock = \Mockery::mock('payplug_sylius_payplug_plugin.api_client.payplug', PayPlugApiClientInterface::class); $mock ->shouldReceive('initialise') ; @@ -310,12 +303,11 @@ public function mockApiRefundPartiallyFromPayPlugPortal(callable $action, int $a ->andReturn($refund) ; $action(); - $this->mocker->unmockAll(); } public function mockPayPlugApiGetGatewayFactoryName(callable $action): void { - $mock = $this->mocker->mockService('payplug_sylius_payplug_plugin.api_client.payplug', PayPlugApiClientInterface::class); + $mock = \Mockery::mock('payplug_sylius_payplug_plugin.api_client.payplug', PayPlugApiClientInterface::class); $mock ->shouldReceive([ 'getGatewayFactoryName' => PayPlugGatewayFactory::FACTORY_NAME, @@ -323,13 +315,12 @@ public function mockPayPlugApiGetGatewayFactoryName(callable $action): void ; $action(); - $this->mocker->unmockAll(); } public function enableOney(): void { $this->mocker->unmockAll(); - $mock = $this->mocker->mockService( + $mock = \Mockery::mock( 'payplug_sylius_payplug_plugin.api_client.oney', PayPlugApiClientInterface::class, ); @@ -357,8 +348,7 @@ public function enableOney(): void public function disableOney(): void { - $this->mocker->unmockAll(); - $mock = $this->mocker->mockService( + $mock = \Mockery::mock( 'payplug_sylius_payplug_plugin.api_client.oney', PayPlugApiClientInterface::class, ); diff --git a/tests/Behat/Resources/services.xml b/tests/Behat/Resources/services.xml index 17aaf2a8..561a4c21 100644 --- a/tests/Behat/Resources/services.xml +++ b/tests/Behat/Resources/services.xml @@ -18,7 +18,7 @@ - + diff --git a/tests/Behat/Resources/services/contexts/setup.xml b/tests/Behat/Resources/services/contexts/setup.xml index d135a3d3..91d432e6 100644 --- a/tests/Behat/Resources/services/contexts/setup.xml +++ b/tests/Behat/Resources/services/contexts/setup.xml @@ -13,11 +13,11 @@ - - - - - - + + + + + + diff --git a/tests/Behat/Resources/services/contexts/ui.xml b/tests/Behat/Resources/services/contexts/ui.xml index 654fc942..bba842a6 100644 --- a/tests/Behat/Resources/services/contexts/ui.xml +++ b/tests/Behat/Resources/services/contexts/ui.xml @@ -9,7 +9,7 @@ - + diff --git a/tests/Behat/Resources/suites/ui/paying_with_payplug_for_order.yml b/tests/Behat/Resources/suites/ui/paying_with_payplug_for_order.yml index 8f06e1fb..659d5003 100644 --- a/tests/Behat/Resources/suites/ui/paying_with_payplug_for_order.yml +++ b/tests/Behat/Resources/suites/ui/paying_with_payplug_for_order.yml @@ -31,7 +31,7 @@ default: - payplug_sylius_payplug_plugin.behat.context.setup.payplug - - sylius.behat.context.ui.paypal +# - sylius.behat.context.ui.paypal - sylius.behat.context.ui.shop.cart - sylius.behat.context.ui.shop.checkout - sylius.behat.context.ui.shop.checkout.addressing diff --git a/tests/Behat/Resources/suites/ui/refunding_payplug_payment.yml b/tests/Behat/Resources/suites/ui/refunding_payplug_payment.yml index b282c649..decb7841 100644 --- a/tests/Behat/Resources/suites/ui/refunding_payplug_payment.yml +++ b/tests/Behat/Resources/suites/ui/refunding_payplug_payment.yml @@ -23,7 +23,7 @@ default: - sylius.behat.context.setup.user - payplug_sylius_payplug_plugin.behat.context.setup.payplug - - payplug_sylius_payplug_plugin.behat.context.setup.order +# - payplug_sylius_payplug_plugin.behat.context.setup.order - sylius.behat.context.transform.address - sylius.behat.context.transform.channel From 99dd5a349e943d0daea270584fc5cfaf9c75baef Mon Sep 17 00:00:00 2001 From: maxperei Date: Fri, 25 Apr 2025 15:29:04 +0200 Subject: [PATCH 010/112] fix(gateway): [admin] missing twig hooks for payment method update --- config/twig_hooks/admin.yaml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/config/twig_hooks/admin.yaml b/config/twig_hooks/admin.yaml index 25e2e30e..f73c2bb8 100644 --- a/config/twig_hooks/admin.yaml +++ b/config/twig_hooks/admin.yaml @@ -1,6 +1,6 @@ sylius_twig_hooks: hooks: - 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.payplug': + 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.payplug': &payplugGateway secret_key: &secretKey template: '@PayPlugSyliusPayPlugPlugin/admin/payment_method/form/secret_key.html.twig' priority: 0 @@ -13,14 +13,20 @@ sylius_twig_hooks: deferred_capture: template: '@PayPlugSyliusPayPlugPlugin/admin/payment_method/form/deferred_capture.html.twig' priority: 0 - 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.payplug_oney': + 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.payplug_oney': &oneyGateway secret_key: *secretKey fees_for: template: '@PayPlugSyliusPayPlugPlugin/admin/payment_method/form/fees_for.html.twig' priority: 0 - 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.payplug_bancontact': + 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.payplug_bancontact': &bancontactGateway secret_key: *secretKey - 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.payplug_apple_pay': + 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.payplug_apple_pay': &applePayGateway secret_key: *secretKey - 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.payplug_american_express': + 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.payplug_american_express': &amexGateway secret_key: *secretKey + + 'sylius_admin.payment_method.update.content.form.sections.gateway_configuration.payplug': *payplugGateway + 'sylius_admin.payment_method.update.content.form.sections.gateway_configuration.payplug_oney': *oneyGateway + 'sylius_admin.payment_method.update.content.form.sections.gateway_configuration.payplug_bancontact': *bancontactGateway + 'sylius_admin.payment_method.update.content.form.sections.gateway_configuration.payplug_apple_pay': *applePayGateway + 'sylius_admin.payment_method.update.content.form.sections.gateway_configuration.payplug_american_express': *amexGateway \ No newline at end of file From 1fb92e383f630a1cc75650c334479217264019f0 Mon Sep 17 00:00:00 2001 From: maxperei Date: Fri, 25 Apr 2025 15:36:20 +0200 Subject: [PATCH 011/112] feat(ux): [product] rework oney popin --- assets/controllers/oney/popin_controller.js | 164 + assets/dist/shop/oney_common/index.css | 1 + assets/dist/shop/oney_popin/index.css | 1 + assets/package.json | 59 +- assets/shop/oney_popin/index.js | 148 - assets/shop/oney_popin/index.scss | 161 - assets/yarn.lock | 3507 +---------------- composer.json | 3 +- config/twig_hooks/shop.yaml | 6 + templates/oney/popin.html.twig | 14 +- .../oney/product/pay_with_oney.html.twig | 64 +- 11 files changed, 255 insertions(+), 3873 deletions(-) create mode 100644 assets/controllers/oney/popin_controller.js create mode 100644 assets/dist/shop/oney_common/index.css create mode 100644 assets/dist/shop/oney_popin/index.css delete mode 100644 assets/shop/oney_popin/index.js delete mode 100644 assets/shop/oney_popin/index.scss create mode 100644 config/twig_hooks/shop.yaml diff --git a/assets/controllers/oney/popin_controller.js b/assets/controllers/oney/popin_controller.js new file mode 100644 index 00000000..93bfce6c --- /dev/null +++ b/assets/controllers/oney/popin_controller.js @@ -0,0 +1,164 @@ +import { Controller } from '@hotwired/stimulus'; +import $ from 'jquery'; +import WebFont from 'webfontloader'; + +/* stimulusFetch: 'lazy' */ +export default class extends Controller { + static targets = ['popin', 'variantCodes']; + static values = { + eligibleUrl: String, + popinUrl: String, + productMeta: Object, + translations: Object, + } + inputs = { + option: "cartItem_variant", + quantity: "cartItem_quantity", + } + storage = [] + initialize() { + WebFont.load({ + google: { + families: ["Poppins:400,600"], + }, + }); + } + connect() { + if (this.hasProductMetaValue) { + this.watch(); + } + this.fade(); + this.closeHandler(); + } + watch() { + for (const prop in this.inputs) { + const $selectors = $(`[id*=${this.inputs[prop]}`); + if ($selectors.length > 0) { + this.handleProductOptionsChange($selectors, prop); + } + this.productMetaValue = { + ...this.productMetaValue, + [prop]: $selectors.val(), + }; + $selectors.on( + "input", + this.debounce((e) => { + e.preventDefault(); + if ($selectors.length > 0) { + this.handleProductOptionsChange($selectors, prop); + } + this.productMetaValue = { + ...this.productMetaValue, + [prop]: $(e.currentTarget).val(), + }; + this.check(); + }, 500) + ); + } + } + handleProductOptionsChange($selectors, prop) { + if (prop === "option") { + let selector = ""; + $selectors.each((k, v) => { + const select = $(v); + const option = select.find("option:selected").val(); + selector += `[data-${select.attr("data-option")}="${option}"]`; + }); + return (this.productMetaValue = { + ...this.productMetaValue, + product_variant_code: $(this.variantCodesTarget).find(selector).attr("data-value") + }); + } + } + check() { + this.storage = []; + this.toggleLoader(); + $.ajax({ + url: this.eligibleUrlValue, + data: this.productMetaValue, + success: (res) => { + $(this.element).find(".oney-logo").attr("src", this.productMetaValue.img[res.isEligible]); + res.isEligible + ? $(this.popinTarget).removeClass("disabled").addClass("enabled") + : $(this.popinTarget).removeClass("enabled").addClass("disabled"); + }, + complete: () => { + this.toggleLoader(); + } + }); + } + /** + * https://davidwalsh.name/javascript-debounce-function + */ + debounce(func, wait) { + let timeout; + return function executedFunction(...args) { + const later = () => { + clearTimeout(timeout); + func(...args); + }; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + }; + } + fade() { + $(this.element).on("click", (e) => { + e.preventDefault(); + e.stopPropagation(); + if (!$(this.popinTarget).is(":empty") && $(this.popinTarget).text().trim() === this.storage) { + $(this.popinTarget).fadeIn(); + return; + } + // content isn't loaded yet + this.toggleLoader(); + this.load(); + }); + } + load() { + $.ajax({ + url: this.popinUrlValue, + data: this.productMetaValue, + success: (res) => { + if (res.includes(this.translationsValue.reason)) { + $(this.popinTarget).removeClass("enabled").addClass("disabled"); + } + this.storage = $(res).text().trim(); + $(this.popinTarget).html(res); + }, + error: ()=> { + $(this.popinTarget).removeClass("enabled").addClass("disabled").html(` +
+ + + +
+
+

${this.translationsValue.reason}

+
+ `); + }, + complete: ()=> { + this.toggleLoader(); + $(this.popinTarget).fadeIn(); + this.closeHandler(); + }, + }); + } + toggleLoader() { + $(this.element).find('.sylius-shop-loader').toggleClass("d-none"); + } + closeHandler() { + $("html") + .not(this.popinTarget) + .on("click", (e) => { + e.stopPropagation(); + $(this.popinTarget).fadeOut(); + }); + $(this.popinTarget) + .find("a.close") + .on("click", (e) => { + e.stopPropagation(); + $(this.popinTarget).fadeOut(); + }); + } +} \ No newline at end of file diff --git a/assets/dist/shop/oney_common/index.css b/assets/dist/shop/oney_common/index.css new file mode 100644 index 00000000..84b84648 --- /dev/null +++ b/assets/dist/shop/oney_common/index.css @@ -0,0 +1 @@ +[class*=oney] *{line-height:1.25;font-family:Poppins,Arial,sans-serif!important}[class*=oney] * p{color:#66727f;margin:0}[class*=oney] * small{font-size:90%}.oney-info{margin:1em auto .5em;display:inline-block;position:relative}.oney-info span{vertical-align:text-bottom;text-transform:uppercase;font-size:16px}.oney-info>img{cursor:pointer;vertical-align:middle;margin:0 4px}.oney-info.loading{pointer-events:none}.oney-logo[src*=without-fees]{max-width:190px}@media screen and (max-width:768px){.oney-logo{max-width:230px}} \ No newline at end of file diff --git a/assets/dist/shop/oney_popin/index.css b/assets/dist/shop/oney_popin/index.css new file mode 100644 index 00000000..ecaf7bff --- /dev/null +++ b/assets/dist/shop/oney_popin/index.css @@ -0,0 +1 @@ +.oney-popin{z-index:99;max-width:20em;background-color:#fff;padding:10px;display:none;position:absolute;top:0;left:calc(-20em - 32px);transform:translateY(calc(10px - 33.3333%))}.oney-popin:after{content:"";height:0;width:0;border-top:20px solid #0000;border-bottom:20px solid #0000;display:inline-block;position:absolute;top:calc(33.3333% - 10px);right:-20px}.oney-popin.enabled{border:1px solid #81bc00}.oney-popin.enabled hr{border-color:#81bc00}.oney-popin.enabled:after{border-left:20px solid #81bc00}.oney-popin.enabled a.close>span{background:#81bc00}.oney-popin.enabled .oney-popin__content>p{color:#81bc00}.oney-popin.disabled{border:1px solid #ccc}.oney-popin.disabled hr{border-color:#ccc}.oney-popin.disabled:after{border-left:20px solid #ccc}.oney-popin.disabled a.close>span{background:#ccc}.oney-popin.disabled .oney-popin__content>p{color:#66727f}.oney-popin__header{text-align:right}.oney-popin__header a.close{width:40px;height:40px;position:absolute;top:0;right:0}.oney-popin__header a.close>span{width:15px;height:2px;border-radius:0;margin:0;position:absolute;top:1em;right:.5em}.oney-popin__header a.close>span:first-of-type{transform:rotate(55deg)}.oney-popin__header a.close>span:last-of-type{transform:rotate(-55deg)}.oney-popin__content>p:not(.reasons){text-transform:uppercase;margin-bottom:0;font-size:16px}.oney-popin__content>p:not(.reasons):last-of-type{margin-bottom:1em}.oney-popin__content>p.reasons{max-width:95%}.oney-popin__footer{margin-top:1em}.oney-popin__footer>p{text-align:justify}.oney-popin section{align-items:flex-start;display:flex}.oney-popin img{height:auto;margin-right:.5em}.oney-popin hr{border-style:solid none none;border-width:1px 0 0;border-bottom-color:currentColor;border-left-color:currentColor;border-right-color:currentColor;margin:1.25em 0}@media screen and (max-width:768px){.oney-popin{top:60px;left:0;transform:none}.oney-popin__header a.close{padding:10px 50px}.oney-popin:after{top:-30px;right:calc(50% - 10px);transform:rotate(-90deg)}} \ No newline at end of file diff --git a/assets/package.json b/assets/package.json index 94a54b71..bee944de 100644 --- a/assets/package.json +++ b/assets/package.json @@ -1,41 +1,40 @@ { - "name": "sylius-payplug-plugin", - "version": "1.11.0", + "name": "@payplug/sylius-payplug-plugin", + "license": "MIT", + "version": "2.0.0", + "keywords": [ + "symfony-ux" + ], "description": "Sylius Payplug Plugin", - "source": "src/index.js", + "type": "module", + "files": [ + "dist" + ], "scripts": { - "build": "parcel build shop/**/* --dist-dir ../public/assets/shop --no-source-maps", - "build:admin": "parcel build admin/**/* --dist-dir ../public/assets/admin --no-source-maps", - "dev": "parcel watch shop/**/* --dist-dir ../public/assets/shop --no-hmr", - "dev:admin": "parcel watch admin/**/* --dist-dir ../public/assets/admin --no-hmr", - "eslint": "eslint -c .eslintrc ./", - "fix-eslint": "eslint -c .eslintrc ./ --fix", "test": "echo \"Error: no test specified\" && exit 1" }, - "license": "MIT", - "browserslist": [ - "> 2%", - "last 4 versions", - "ie > 8", - "not dead", - "not op_mob 59" - ], - "engines": { - "node": ">=12.18.3" + "symfony": { + "controllers": { + "oney-popin": { + "main": "controllers/oney/popin_controller.js", + "enabled": true, + "webpackMode": "lazy", + "fetch": "lazy", + "autoimport": { + "@payplug/sylius-payplug-plugin/dist/shop/oney_common/index.css": true, + "@payplug/sylius-payplug-plugin/dist/shop/oney_popin/index.css": true + } + } + } + }, + "peerDependencies": { + "@hotwired/stimulus": "^3.0.0" }, "devDependencies": { - "@babel/core": "^7.9.0", - "@babel/eslint-parser": "^7.14.7", - "@parcel/babel-preset-env": "^2.5.0", - "@parcel/transformer-sass": "^2.5.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.1", - "eslint-plugin-prettier": "^3.1.3", - "parcel": "^2.5.0", - "prettier": "^2.6.0", - "sass": "^1.26.3" + "@hotwired/stimulus": "^3.0.0" }, "dependencies": { - "jquery": "^3.5.1" + "jquery": "^3.5.1", + "webfontloader": "^1.6.28" } } diff --git a/assets/shop/oney_popin/index.js b/assets/shop/oney_popin/index.js deleted file mode 100644 index ed4cd010..00000000 --- a/assets/shop/oney_popin/index.js +++ /dev/null @@ -1,148 +0,0 @@ -const Popin = { - handlers: { - info: ".oney-info", - popin: ".oney-popin", - codes: "#payplug-product-variant-codes", - }, - triggers: { - option: "cartItem_variant", - quantity: "cartItem_quantity", - }, - productMeta: [], - storage: [], - init() { - if (typeof productMeta !== "undefined") { - Popin.watch(); - } - Popin.fade(); - Popin.closeHandler(); - }, - watch() { - for (const prop in this.triggers) { - const $selectors = $(`[id*=${this.triggers[prop]}`); - if ($selectors.length > 0) { - this.handleProductOptionsChange($selectors, prop); - } - productMeta[prop] = $selectors.val(); - $selectors.on( - "input", - this.debounce((e) => { - e.preventDefault(); - if ($selectors.length > 0) { - this.handleProductOptionsChange($selectors, prop); - } - productMeta[prop] = $(e.currentTarget).val(); - this.check(); - }, 500) - ); - } - this.productMeta = productMeta; - }, - /** - * @see Sylius/Bundle/ShopBundle/Resources/private/js/sylius-variants-prices.js - * @param $selectors - * @param prop - */ - handleProductOptionsChange($selectors, prop) { - if (prop === "option") { - let selector = ""; - $selectors.each((k, v) => { - const select = $(v); - const option = select.find("option:selected").val(); - selector += `[data-${select.attr("data-option")}="${option}"]`; - }); - return (productMeta.product_variant_code = $(this.handlers.codes).find(selector).attr("data-value")); - } - }, - check() { - const self = this; - this.storage = []; - $.ajax({ - url: this.productMeta.url, - data: this.productMeta, - success: function (res) { - $(self.handlers.info).find("img:first").attr("src", self.productMeta.img[res.isEligible]); - res.isEligible - ? $(self.handlers.popin).removeClass("disabled").addClass("enabled") - : $(self.handlers.popin).removeClass("enabled").addClass("disabled"); - }, - }); - }, - /** - * https://davidwalsh.name/javascript-debounce-function - */ - debounce(func, wait) { - let timeout; - return function executedFunction(...args) { - const later = () => { - clearTimeout(timeout); - func(...args); - }; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - }; - }, - fade() { - $(this.handlers.info).on("click", (e) => { - e.preventDefault(); - e.stopPropagation(); - if (!$(this.handlers.popin).is(":empty") && $(this.handlers.popin).text().trim() === this.storage) { - $(this.handlers.popin).fadeIn(); - return; - } - // content not loaded yet - this.toggleLoader(); - this.load(); - }); - }, - load() { - const self = this; - $.ajax({ - url: $(this.handlers.popin).data("popin-url"), - data: this.productMeta, - success: function (res) { - if (res.includes(translations.reason)) { - $(self.handlers.popin).removeClass("enabled").addClass("disabled"); - } - self.storage = $(res).text().trim(); - $(self.handlers.popin).html(res); - }, - error: function () { - $(self.handlers.popin).removeClass("enabled").addClass("disabled").html(` -
- - - -
-
-

${translations.reason}

-
- `); - }, - complete: function () { - self.toggleLoader(); - $(self.handlers.popin).fadeIn(); - Popin.closeHandler(); - }, - }); - }, - toggleLoader() { - $(this.handlers.info).toggleClass("loading").find(".dimmer").toggleClass("active"); - }, - closeHandler() { - $("html") - .not(this.handlers.popin) - .on("click", (e) => { - e.stopPropagation(); - $(this.handlers.popin).fadeOut(); - }); - $(this.handlers.popin) - .find("a.close") - .on("click", (e) => { - e.stopPropagation(); - $(this.handlers.popin).fadeOut(); - }); - }, -}; - -document.addEventListener("DOMContentLoaded", Popin.init, false); diff --git a/assets/shop/oney_popin/index.scss b/assets/shop/oney_popin/index.scss deleted file mode 100644 index 240d9389..00000000 --- a/assets/shop/oney_popin/index.scss +++ /dev/null @@ -1,161 +0,0 @@ -@import "../../settings/constants.scss"; - -.oney-popin { - display: none; - background-color: white; - padding: 10px; - position: absolute; - z-index: 99; - max-width: 20em; - top: 0; - left: calc(-20em - 32px); - transform: translateY(calc(-100% / 3 + 10px)); - - &:after { - content: ''; - display: inline-block; - height: 0; - width: 0; - border-top: 20px solid transparent; - border-bottom: 20px solid transparent; - position: absolute; - right: -20px; - top: calc(100% / 3 - 10px); - } - - &.enabled { - border: 1px solid $green; - - hr { - border-color: $green; - } - - &:after { - border-left: 20px solid $green; - } - - a.close > span { - background: $green; - } - - .oney-popin__content > p { - color: $green; - } - } - - &.disabled { - border: 1px solid $lightgrey; - - hr { - border-color: $lightgrey; - } - - &:after { - border-left: 20px solid $lightgrey; - } - - a.close > span { - background: $lightgrey; - } - - .oney-popin__content > p { - color: $greyish; - } - } - - &__header { - text-align: right; - - a.close { - position: absolute; - top: 0; - right: 0; - width: 40px; - height: 40px; - - > span { - position: absolute; - width: 15px; - height: 2px; - right: .5em; - top: 1em; - margin: 0; - border-radius: 0; - - &:first-of-type { - transform: rotate(55deg); - } - - &:last-of-type { - transform: rotate(-55deg); - - } - } - } - } - - &__content { - > p { - &:not(.reasons) { - text-transform: uppercase; - margin-bottom: 0; - font-size: 16px; - - &:last-of-type { - margin-bottom: 1em; - } - } - &.reasons { - // avoid superposition of closing button over text - max-width: 95%; - } - } - } - - &__footer { - margin-top: 1em; - - > p { - text-align: justify; - } - } - - section { - display: flex; - align-items: flex-start; - } - - img { - height: auto; - margin-right: .5em; - } - - hr { - border-top-width: 1px; - border-top-style: solid; - border-bottom: 0; - border-left: 0; - border-right: 0; - margin: 1.25em 0; - } -} - -@media screen and (max-width: 768px) { - .oney-popin { - top: 60px; - left: 0; - transform: none; - - &__header { - a.close { - padding: 10px 50px; - } - } - - &:after { - transform: rotate(-90deg); - right: calc(50% - 10px); - top: -30px; - } - } -} diff --git a/assets/yarn.lock b/assets/yarn.lock index dd9a3f07..961087b2 100644 --- a/assets/yarn.lock +++ b/assets/yarn.lock @@ -2,3500 +2,17 @@ # yarn lockfile v1 -"@ampproject/remapping@^2.2.0": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.3.0.tgz#ed441b6fa600072520ce18b43d2c8cc8caecc7f4" - integrity sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw== - dependencies: - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.24" - -"@babel/code-frame@^7.0.0": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" - integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== - dependencies: - "@babel/highlight" "^7.18.6" - -"@babel/code-frame@^7.18.6", "@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0", "@babel/code-frame@^7.26.2": - version "7.26.2" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" - integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== - dependencies: - "@babel/helper-validator-identifier" "^7.25.9" - js-tokens "^4.0.0" - picocolors "^1.0.0" - -"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.20.1": - version "7.20.14" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.14.tgz#4106fc8b755f3e3ee0a0a7c27dde5de1d2b2baf8" - integrity sha512-0YpKHD6ImkWMEINCyDAD0HLLUH/lPCefG8ld9it8DJB2wnApraKuhgYTvTY1z7UFIfBTGy5LwncZ+5HWWGbhFw== - -"@babel/compat-data@^7.20.5", "@babel/compat-data@^7.25.9": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.26.3.tgz#99488264a56b2aded63983abd6a417f03b92ed02" - integrity sha512-nHIxvKPniQXpmQLb0vhY3VaFb3S0YrTAwpOWJZh1wn3oJPjJk9Asva204PsBdmAE8vpzfHudT8DB0scYvy9q0g== - -"@babel/core@^7.9.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" - integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.26.0" - "@babel/generator" "^7.26.0" - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-module-transforms" "^7.26.0" - "@babel/helpers" "^7.26.0" - "@babel/parser" "^7.26.0" - "@babel/template" "^7.25.9" - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.26.0" - convert-source-map "^2.0.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.3" - semver "^6.3.1" - -"@babel/eslint-parser@^7.14.7": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.25.9.tgz#603c68a63078796527bc9d0833f5e52dd5f9224c" - integrity sha512-5UXfgpK0j0Xr/xIdgdLEhOFxaDZ0bRPWJJchRpqOSur/3rZoPbqqki5mm0p4NE2cs28krBEiSM2MB7//afRSQQ== - dependencies: - "@nicolo-ribaudo/eslint-scope-5-internals" "5.1.1-v1" - eslint-visitor-keys "^2.1.0" - semver "^6.3.1" - -"@babel/generator@^7.20.7", "@babel/generator@^7.26.0", "@babel/generator@^7.26.3": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.26.3.tgz#ab8d4360544a425c90c248df7059881f4b2ce019" - integrity sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ== - dependencies: - "@babel/parser" "^7.26.3" - "@babel/types" "^7.26.3" - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^3.0.2" - -"@babel/helper-annotate-as-pure@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" - integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-builder-binary-assignment-operator-visitor@^7.18.6": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz#acd4edfd7a566d1d51ea975dff38fd52906981bb" - integrity sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw== - dependencies: - "@babel/helper-explode-assignable-expression" "^7.18.6" - "@babel/types" "^7.18.9" - -"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.0": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz#a6cd33e93629f5eb473b021aac05df62c4cd09bb" - integrity sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ== - dependencies: - "@babel/compat-data" "^7.20.5" - "@babel/helper-validator-option" "^7.18.6" - browserslist "^4.21.3" - lru-cache "^5.1.1" - semver "^6.3.0" - -"@babel/helper-compilation-targets@^7.20.7", "@babel/helper-compilation-targets@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" - integrity sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ== - dependencies: - "@babel/compat-data" "^7.25.9" - "@babel/helper-validator-option" "^7.25.9" - browserslist "^4.24.0" - lru-cache "^5.1.1" - semver "^6.3.1" - -"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.20.5", "@babel/helper-create-class-features-plugin@^7.20.7": - version "7.20.12" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.12.tgz#4349b928e79be05ed2d1643b20b99bb87c503819" - integrity sha512-9OunRkbT0JQcednL0UFvbfXpAsUXiGjUk0a7sN8fUXX7Mue79cUSMjHGDRRi/Vz9vYlpIhLV5fMD5dKoMhhsNQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" - "@babel/helper-member-expression-to-functions" "^7.20.7" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-replace-supers" "^7.20.7" - "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" - "@babel/helper-split-export-declaration" "^7.18.6" - -"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.20.5": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.20.5.tgz#5ea79b59962a09ec2acf20a963a01ab4d076ccca" - integrity sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - regexpu-core "^5.2.1" - -"@babel/helper-define-polyfill-provider@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz#8612e55be5d51f0cd1f36b4a5a83924e89884b7a" - integrity sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww== - dependencies: - "@babel/helper-compilation-targets" "^7.17.7" - "@babel/helper-plugin-utils" "^7.16.7" - debug "^4.1.1" - lodash.debounce "^4.0.8" - resolve "^1.14.2" - semver "^6.1.2" - -"@babel/helper-environment-visitor@^7.18.9": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz#4b31ba9551d1f90781ba83491dd59cf9b269f7d9" - integrity sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ== - dependencies: - "@babel/types" "^7.24.7" - -"@babel/helper-explode-assignable-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz#41f8228ef0a6f1a036b8dfdfec7ce94f9a6bc096" - integrity sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-function-name@^7.18.9": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" - integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== - dependencies: - "@babel/template" "^7.18.10" - "@babel/types" "^7.19.0" - -"@babel/helper-function-name@^7.19.0": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz#75f1e1725742f39ac6584ee0b16d94513da38dd2" - integrity sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA== - dependencies: - "@babel/template" "^7.24.7" - "@babel/types" "^7.24.7" - -"@babel/helper-hoist-variables@^7.18.6": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz#b4ede1cde2fd89436397f30dc9376ee06b0f25ee" - integrity sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ== - dependencies: - "@babel/types" "^7.24.7" - -"@babel/helper-member-expression-to-functions@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.20.7.tgz#a6f26e919582275a93c3aa6594756d71b0bb7f05" - integrity sha512-9J0CxJLq315fEdi4s7xK5TQaNYjZw+nDVpVqr1axNGKzdrdwYBD5b4uKv3n75aABG0rCCTK8Im8Ww7eYfMrZgw== - dependencies: - "@babel/types" "^7.20.7" - -"@babel/helper-module-imports@^7.18.6", "@babel/helper-module-imports@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" - integrity sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - -"@babel/helper-module-transforms@^7.18.6": - version "7.20.11" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz#df4c7af713c557938c50ea3ad0117a7944b2f1b0" - integrity sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg== - dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.20.2" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.19.1" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.10" - "@babel/types" "^7.20.7" - -"@babel/helper-module-transforms@^7.20.11", "@babel/helper-module-transforms@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz#8ce54ec9d592695e58d84cd884b7b5c6a2fdeeae" - integrity sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw== - dependencies: - "@babel/helper-module-imports" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - "@babel/traverse" "^7.25.9" - -"@babel/helper-optimise-call-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz#9369aa943ee7da47edab2cb4e838acf09d290ffe" - integrity sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" - integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== - -"@babel/helper-remap-async-to-generator@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz#997458a0e3357080e54e1d79ec347f8a8cd28519" - integrity sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-wrap-function" "^7.18.9" - "@babel/types" "^7.18.9" - -"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.20.7.tgz#243ecd2724d2071532b2c8ad2f0f9f083bcae331" - integrity sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A== - dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-member-expression-to-functions" "^7.20.7" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.7" - "@babel/types" "^7.20.7" - -"@babel/helper-simple-access@^7.20.2": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.25.9.tgz#6d51783299884a2c74618d6ef0f86820ec2e7739" - integrity sha512-c6WHXuiaRsJTyHYLJV75t9IqsmTbItYfdj99PnzYGQZkYKvan5/2jKJ7gu31J3/BJ/A18grImSPModuyG/Eo0Q== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - -"@babel/helper-skip-transparent-expression-wrappers@^7.20.0": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz#fbe4c52f60518cab8140d77101f0e63a8a230684" - integrity sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg== - dependencies: - "@babel/types" "^7.20.0" - -"@babel/helper-split-export-declaration@^7.18.6": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz#83949436890e07fa3d6873c61a96e3bbf692d856" - integrity sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA== - dependencies: - "@babel/types" "^7.24.7" - -"@babel/helper-string-parser@^7.19.4", "@babel/helper-string-parser@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" - integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== - -"@babel/helper-validator-identifier@^7.19.1", "@babel/helper-validator-identifier@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" - integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== - -"@babel/helper-validator-option@^7.18.6", "@babel/helper-validator-option@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" - integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== - -"@babel/helper-wrap-function@^7.18.9": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz#75e2d84d499a0ab3b31c33bcfe59d6b8a45f62e3" - integrity sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q== - dependencies: - "@babel/helper-function-name" "^7.19.0" - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.20.5" - "@babel/types" "^7.20.5" - -"@babel/helpers@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.26.0.tgz#30e621f1eba5aa45fe6f4868d2e9154d884119a4" - integrity sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw== - dependencies: - "@babel/template" "^7.25.9" - "@babel/types" "^7.26.0" - -"@babel/highlight@^7.18.6": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.25.9.tgz#8141ce68fc73757946f983b343f1231f4691acc6" - integrity sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw== - dependencies: - "@babel/helper-validator-identifier" "^7.25.9" - chalk "^2.4.2" - js-tokens "^4.0.0" - picocolors "^1.0.0" - -"@babel/parser@^7.20.13", "@babel/parser@^7.25.9", "@babel/parser@^7.26.0", "@babel/parser@^7.26.3": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.26.3.tgz#8c51c5db6ddf08134af1ddbacf16aaab48bac234" - integrity sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA== - dependencies: - "@babel/types" "^7.26.3" - -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2" - integrity sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.18.9": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.20.7.tgz#d9c85589258539a22a901033853101a6198d4ef1" - integrity sha512-sbr9+wNE5aXMBBFBICk01tt7sBf2Oc9ikRFEcem/ZORup9IMUdNhW7/wVLEbbtlWOsEubJet46mHAL2C8+2jKQ== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" - "@babel/plugin-proposal-optional-chaining" "^7.20.7" - -"@babel/plugin-proposal-async-generator-functions@^7.20.1": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz#bfb7276d2d573cb67ba379984a2334e262ba5326" - integrity sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA== - dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-remap-async-to-generator" "^7.18.9" - "@babel/plugin-syntax-async-generators" "^7.8.4" - -"@babel/plugin-proposal-class-properties@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" - integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-proposal-class-static-block@^7.18.6": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.20.7.tgz#92592e9029b13b15be0f7ce6a7aedc2879ca45a7" - integrity sha512-AveGOoi9DAjUYYuUAG//Ig69GlazLnoyzMw68VCDux+c1tsnnH/OkYcpz/5xzMkEFC6UxjR5Gw1c+iY2wOGVeQ== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.20.7" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - -"@babel/plugin-proposal-dynamic-import@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz#72bcf8d408799f547d759298c3c27c7e7faa4d94" - integrity sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - -"@babel/plugin-proposal-export-namespace-from@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz#5f7313ab348cdb19d590145f9247540e94761203" - integrity sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - -"@babel/plugin-proposal-json-strings@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz#7e8788c1811c393aff762817e7dbf1ebd0c05f0b" - integrity sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-json-strings" "^7.8.3" - -"@babel/plugin-proposal-logical-assignment-operators@^7.18.9": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz#dfbcaa8f7b4d37b51e8bfb46d94a5aea2bb89d83" - integrity sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - -"@babel/plugin-proposal-nullish-coalescing-operator@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz#fdd940a99a740e577d6c753ab6fbb43fdb9467e1" - integrity sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - -"@babel/plugin-proposal-numeric-separator@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz#899b14fbafe87f053d2c5ff05b36029c62e13c75" - integrity sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - -"@babel/plugin-proposal-object-rest-spread@^7.20.2": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz#aa662940ef425779c75534a5c41e9d936edc390a" - integrity sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg== - dependencies: - "@babel/compat-data" "^7.20.5" - "@babel/helper-compilation-targets" "^7.20.7" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.20.7" - -"@babel/plugin-proposal-optional-catch-binding@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz#f9400d0e6a3ea93ba9ef70b09e72dd6da638a2cb" - integrity sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - -"@babel/plugin-proposal-optional-chaining@^7.18.9", "@babel/plugin-proposal-optional-chaining@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.20.7.tgz#49f2b372519ab31728cc14115bb0998b15bfda55" - integrity sha512-T+A7b1kfjtRM51ssoOfS1+wbyCVqorfyZhT99TvxxLMirPShD8CzKMRepMlCBGM5RpHMbn8s+5MMHnPstJH6mQ== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - -"@babel/plugin-proposal-private-methods@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz#5209de7d213457548a98436fa2882f52f4be6bea" - integrity sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-proposal-private-property-in-object@^7.18.6": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.20.5.tgz#309c7668f2263f1c711aa399b5a9a6291eef6135" - integrity sha512-Vq7b9dUA12ByzB4EjQTPo25sFhY+08pQDBSZRtUAkj7lb7jahaHR5igera16QZ+3my1nYR4dKsNdYj5IjPHilQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-create-class-features-plugin" "^7.20.5" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - -"@babel/plugin-proposal-unicode-property-regex@^7.18.6", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz#af613d2cd5e643643b65cded64207b15c85cb78e" - integrity sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-syntax-async-generators@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" - integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-class-properties@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" - integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-syntax-class-static-block@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" - integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-dynamic-import@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" - integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-export-namespace-from@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" - integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - -"@babel/plugin-syntax-import-assertions@^7.20.0": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz#bb50e0d4bea0957235390641209394e87bdb9cc4" - integrity sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ== - dependencies: - "@babel/helper-plugin-utils" "^7.19.0" - -"@babel/plugin-syntax-json-strings@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" - integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" - integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" - integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-numeric-separator@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" - integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-object-rest-spread@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" - integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-catch-binding@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" - integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-chaining@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" - integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-private-property-in-object@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" - integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-top-level-await@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" - integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-arrow-functions@^7.18.6": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.20.7.tgz#bea332b0e8b2dab3dafe55a163d8227531ab0551" - integrity sha512-3poA5E7dzDomxj9WXWwuD6A5F3kc7VXwIJO+E+J8qtDtS+pXPAhrgEyh+9GBwBgPq1Z+bB+/JD60lp5jsN7JPQ== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - -"@babel/plugin-transform-async-to-generator@^7.18.6": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.20.7.tgz#dfee18623c8cb31deb796aa3ca84dda9cea94354" - integrity sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q== - dependencies: - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-remap-async-to-generator" "^7.18.9" - -"@babel/plugin-transform-block-scoped-functions@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz#9187bf4ba302635b9d70d986ad70f038726216a8" - integrity sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-block-scoping@^7.20.2": - version "7.20.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.15.tgz#3e1b2aa9cbbe1eb8d644c823141a9c5c2a22392d" - integrity sha512-Vv4DMZ6MiNOhu/LdaZsT/bsLRxgL94d269Mv4R/9sp6+Mp++X/JqypZYypJXLlM4mlL352/Egzbzr98iABH1CA== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - -"@babel/plugin-transform-classes@^7.20.2": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.20.7.tgz#f438216f094f6bb31dc266ebfab8ff05aecad073" - integrity sha512-LWYbsiXTPKl+oBlXUGlwNlJZetXD5Am+CyBdqhPsDVjM9Jc8jwBJFrKhHf900Kfk2eZG1y9MAG3UNajol7A4VQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-compilation-targets" "^7.20.7" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-replace-supers" "^7.20.7" - "@babel/helper-split-export-declaration" "^7.18.6" - globals "^11.1.0" - -"@babel/plugin-transform-computed-properties@^7.18.9": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.20.7.tgz#704cc2fd155d1c996551db8276d55b9d46e4d0aa" - integrity sha512-Lz7MvBK6DTjElHAmfu6bfANzKcxpyNPeYBGEafyA6E5HtRpjpZwU+u7Qrgz/2OR0z+5TvKYbPdphfSaAcZBrYQ== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/template" "^7.20.7" - -"@babel/plugin-transform-destructuring@^7.20.2": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.20.7.tgz#8bda578f71620c7de7c93af590154ba331415454" - integrity sha512-Xwg403sRrZb81IVB79ZPqNQME23yhugYVqgTxAhT99h485F4f+GMELFhhOsscDUB7HCswepKeCKLn/GZvUKoBA== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - -"@babel/plugin-transform-dotall-regex@^7.18.6", "@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz#b286b3e7aae6c7b861e45bed0a2fafd6b1a4fef8" - integrity sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-duplicate-keys@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz#687f15ee3cdad6d85191eb2a372c4528eaa0ae0e" - integrity sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - -"@babel/plugin-transform-exponentiation-operator@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz#421c705f4521888c65e91fdd1af951bfefd4dacd" - integrity sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw== - dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-for-of@^7.18.8": - version "7.18.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.8.tgz#6ef8a50b244eb6a0bdbad0c7c61877e4e30097c1" - integrity sha512-yEfTRnjuskWYo0k1mHUqrVWaZwrdq8AYbfrpqULOJOaucGSp4mNMVps+YtA8byoevxS/urwU75vyhQIxcCgiBQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-function-name@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz#cc354f8234e62968946c61a46d6365440fc764e0" - integrity sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ== - dependencies: - "@babel/helper-compilation-targets" "^7.18.9" - "@babel/helper-function-name" "^7.18.9" - "@babel/helper-plugin-utils" "^7.18.9" - -"@babel/plugin-transform-literals@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz#72796fdbef80e56fba3c6a699d54f0de557444bc" - integrity sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg== - dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - -"@babel/plugin-transform-member-expression-literals@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz#ac9fdc1a118620ac49b7e7a5d2dc177a1bfee88e" - integrity sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-modules-amd@^7.19.6": - version "7.20.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.20.11.tgz#3daccca8e4cc309f03c3a0c4b41dc4b26f55214a" - integrity sha512-NuzCt5IIYOW0O30UvqktzHYR2ud5bOWbY0yaxWZ6G+aFzOMJvrs5YHNikrbdaT15+KNO31nPOy5Fim3ku6Zb5g== - dependencies: - "@babel/helper-module-transforms" "^7.20.11" - "@babel/helper-plugin-utils" "^7.20.2" - -"@babel/plugin-transform-modules-commonjs@^7.19.6": - version "7.20.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.20.11.tgz#8cb23010869bf7669fd4b3098598b6b2be6dc607" - integrity sha512-S8e1f7WQ7cimJQ51JkAaDrEtohVEitXjgCGAS2N8S31Y42E+kWwfSz83LYz57QdBm7q9diARVqanIaH2oVgQnw== - dependencies: - "@babel/helper-module-transforms" "^7.20.11" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-simple-access" "^7.20.2" - -"@babel/plugin-transform-modules-systemjs@^7.19.6": - version "7.20.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.20.11.tgz#467ec6bba6b6a50634eea61c9c232654d8a4696e" - integrity sha512-vVu5g9BPQKSFEmvt2TA4Da5N+QVS66EX21d8uoOihC+OCpUoGvzVsXeqFdtAEfVa5BILAeFt+U7yVmLbQnAJmw== - dependencies: - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-module-transforms" "^7.20.11" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-validator-identifier" "^7.19.1" - -"@babel/plugin-transform-modules-umd@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz#81d3832d6034b75b54e62821ba58f28ed0aab4b9" - integrity sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ== - dependencies: - "@babel/helper-module-transforms" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-named-capturing-groups-regex@^7.19.1": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz#626298dd62ea51d452c3be58b285d23195ba69a8" - integrity sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.20.5" - "@babel/helper-plugin-utils" "^7.20.2" - -"@babel/plugin-transform-new-target@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz#d128f376ae200477f37c4ddfcc722a8a1b3246a8" - integrity sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-object-super@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz#fb3c6ccdd15939b6ff7939944b51971ddc35912c" - integrity sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-replace-supers" "^7.18.6" - -"@babel/plugin-transform-parameters@^7.20.1", "@babel/plugin-transform-parameters@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.7.tgz#0ee349e9d1bc96e78e3b37a7af423a4078a7083f" - integrity sha512-WiWBIkeHKVOSYPO0pWkxGPfKeWrCJyD3NJ53+Lrp/QMSZbsVPovrVl2aWZ19D/LTVnaDv5Ap7GJ/B2CTOZdrfA== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - -"@babel/plugin-transform-property-literals@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz#e22498903a483448e94e032e9bbb9c5ccbfc93a3" - integrity sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-regenerator@^7.18.6": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz#57cda588c7ffb7f4f8483cc83bdcea02a907f04d" - integrity sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - regenerator-transform "^0.15.1" - -"@babel/plugin-transform-reserved-words@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz#b1abd8ebf8edaa5f7fe6bbb8d2133d23b6a6f76a" - integrity sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-shorthand-properties@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz#6d6df7983d67b195289be24909e3f12a8f664dc9" - integrity sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-spread@^7.19.0": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.20.7.tgz#c2d83e0b99d3bf83e07b11995ee24bf7ca09401e" - integrity sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" - -"@babel/plugin-transform-sticky-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz#c6706eb2b1524028e317720339583ad0f444adcc" - integrity sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-template-literals@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz#04ec6f10acdaa81846689d63fae117dd9c243a5e" - integrity sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - -"@babel/plugin-transform-typeof-symbol@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz#c8cea68263e45addcd6afc9091429f80925762c0" - integrity sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - -"@babel/plugin-transform-unicode-escapes@^7.18.10": - version "7.18.10" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz#1ecfb0eda83d09bbcb77c09970c2dd55832aa246" - integrity sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - -"@babel/plugin-transform-unicode-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz#194317225d8c201bbae103364ffe9e2cea36cdca" - integrity sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/preset-env@^7.4.0": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.20.2.tgz#9b1642aa47bb9f43a86f9630011780dab7f86506" - integrity sha512-1G0efQEWR1EHkKvKHqbG+IN/QdgwfByUpM5V5QroDzGV2t3S/WXNQd693cHiHTlCFMpr9B6FkPFXDA2lQcKoDg== - dependencies: - "@babel/compat-data" "^7.20.1" - "@babel/helper-compilation-targets" "^7.20.0" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-validator-option" "^7.18.6" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.18.9" - "@babel/plugin-proposal-async-generator-functions" "^7.20.1" - "@babel/plugin-proposal-class-properties" "^7.18.6" - "@babel/plugin-proposal-class-static-block" "^7.18.6" - "@babel/plugin-proposal-dynamic-import" "^7.18.6" - "@babel/plugin-proposal-export-namespace-from" "^7.18.9" - "@babel/plugin-proposal-json-strings" "^7.18.6" - "@babel/plugin-proposal-logical-assignment-operators" "^7.18.9" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.6" - "@babel/plugin-proposal-numeric-separator" "^7.18.6" - "@babel/plugin-proposal-object-rest-spread" "^7.20.2" - "@babel/plugin-proposal-optional-catch-binding" "^7.18.6" - "@babel/plugin-proposal-optional-chaining" "^7.18.9" - "@babel/plugin-proposal-private-methods" "^7.18.6" - "@babel/plugin-proposal-private-property-in-object" "^7.18.6" - "@babel/plugin-proposal-unicode-property-regex" "^7.18.6" - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.20.0" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.18.6" - "@babel/plugin-transform-async-to-generator" "^7.18.6" - "@babel/plugin-transform-block-scoped-functions" "^7.18.6" - "@babel/plugin-transform-block-scoping" "^7.20.2" - "@babel/plugin-transform-classes" "^7.20.2" - "@babel/plugin-transform-computed-properties" "^7.18.9" - "@babel/plugin-transform-destructuring" "^7.20.2" - "@babel/plugin-transform-dotall-regex" "^7.18.6" - "@babel/plugin-transform-duplicate-keys" "^7.18.9" - "@babel/plugin-transform-exponentiation-operator" "^7.18.6" - "@babel/plugin-transform-for-of" "^7.18.8" - "@babel/plugin-transform-function-name" "^7.18.9" - "@babel/plugin-transform-literals" "^7.18.9" - "@babel/plugin-transform-member-expression-literals" "^7.18.6" - "@babel/plugin-transform-modules-amd" "^7.19.6" - "@babel/plugin-transform-modules-commonjs" "^7.19.6" - "@babel/plugin-transform-modules-systemjs" "^7.19.6" - "@babel/plugin-transform-modules-umd" "^7.18.6" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.19.1" - "@babel/plugin-transform-new-target" "^7.18.6" - "@babel/plugin-transform-object-super" "^7.18.6" - "@babel/plugin-transform-parameters" "^7.20.1" - "@babel/plugin-transform-property-literals" "^7.18.6" - "@babel/plugin-transform-regenerator" "^7.18.6" - "@babel/plugin-transform-reserved-words" "^7.18.6" - "@babel/plugin-transform-shorthand-properties" "^7.18.6" - "@babel/plugin-transform-spread" "^7.19.0" - "@babel/plugin-transform-sticky-regex" "^7.18.6" - "@babel/plugin-transform-template-literals" "^7.18.9" - "@babel/plugin-transform-typeof-symbol" "^7.18.9" - "@babel/plugin-transform-unicode-escapes" "^7.18.10" - "@babel/plugin-transform-unicode-regex" "^7.18.6" - "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.20.2" - babel-plugin-polyfill-corejs2 "^0.3.3" - babel-plugin-polyfill-corejs3 "^0.6.0" - babel-plugin-polyfill-regenerator "^0.4.1" - core-js-compat "^3.25.1" - semver "^6.3.0" - -"@babel/preset-modules@^0.1.5": - version "0.1.5" - resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.5.tgz#ef939d6e7f268827e1841638dc6ff95515e115d9" - integrity sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" - "@babel/plugin-transform-dotall-regex" "^7.4.4" - "@babel/types" "^7.4.4" - esutils "^2.0.2" - -"@babel/regjsgen@^0.8.0": - version "0.8.0" - resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" - integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== - -"@babel/runtime@^7.8.4": - version "7.20.13" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.13.tgz#7055ab8a7cff2b8f6058bf6ae45ff84ad2aded4b" - integrity sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA== - dependencies: - regenerator-runtime "^0.13.11" - -"@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.24.7", "@babel/template@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" - integrity sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg== - dependencies: - "@babel/code-frame" "^7.25.9" - "@babel/parser" "^7.25.9" - "@babel/types" "^7.25.9" - -"@babel/traverse@^7.20.10", "@babel/traverse@^7.25.9": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.26.3.tgz#1ebfc75bd748d8f96b3cc63af5e82ebd4c37ba35" - integrity sha512-yTmc8J+Sj8yLzwr4PD5Xb/WF3bOYu2C2OoSZPzbuqRm4n98XirsbzaX+GloeO376UnSYIYJ4NCanwV5/ugZkwA== - dependencies: - "@babel/code-frame" "^7.26.2" - "@babel/generator" "^7.26.3" - "@babel/parser" "^7.26.3" - "@babel/template" "^7.25.9" - "@babel/types" "^7.26.3" - debug "^4.3.1" - globals "^11.1.0" - -"@babel/traverse@^7.20.5", "@babel/traverse@^7.20.7": - version "7.20.13" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.13.tgz#817c1ba13d11accca89478bd5481b2d168d07473" - integrity sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.20.7" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.20.13" - "@babel/types" "^7.20.7" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.24.7", "@babel/types@^7.25.9", "@babel/types@^7.26.0", "@babel/types@^7.26.3": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.26.3.tgz#37e79830f04c2b5687acc77db97fbc75fb81f3c0" - integrity sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA== - dependencies: - "@babel/helper-string-parser" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - -"@babel/types@^7.18.9", "@babel/types@^7.20.0", "@babel/types@^7.20.5", "@babel/types@^7.4.4": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f" - integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg== - dependencies: - "@babel/helper-string-parser" "^7.19.4" - "@babel/helper-validator-identifier" "^7.19.1" - to-fast-properties "^2.0.0" - -"@jridgewell/gen-mapping@^0.3.0": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" - integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== - dependencies: - "@jridgewell/set-array" "^1.0.1" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.9" - -"@jridgewell/gen-mapping@^0.3.5": - version "0.3.5" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" - integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== - dependencies: - "@jridgewell/set-array" "^1.2.1" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.24" - -"@jridgewell/resolve-uri@^3.1.0": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" - integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== - -"@jridgewell/set-array@^1.0.1", "@jridgewell/set-array@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" - integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== - -"@jridgewell/source-map@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.2.tgz#f45351aaed4527a298512ec72f81040c998580fb" - integrity sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw== - dependencies: - "@jridgewell/gen-mapping" "^0.3.0" - "@jridgewell/trace-mapping" "^0.3.9" - -"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" - integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== - -"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.25" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" - integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== - dependencies: - "@jridgewell/resolve-uri" "^3.1.0" - "@jridgewell/sourcemap-codec" "^1.4.14" - -"@lezer/common@^0.15.0", "@lezer/common@^0.15.7": - version "0.15.12" - resolved "https://registry.yarnpkg.com/@lezer/common/-/common-0.15.12.tgz#2f21aec551dd5fd7d24eb069f90f54d5bc6ee5e9" - integrity sha512-edfwCxNLnzq5pBA/yaIhwJ3U3Kz8VAUOTRg0hhxaizaI1N+qxV7EXDv/kLCkLeq2RzSFvxexlaj5Mzfn2kY0Ig== - -"@lezer/lr@^0.15.4": - version "0.15.8" - resolved "https://registry.yarnpkg.com/@lezer/lr/-/lr-0.15.8.tgz#1564a911e62b0a0f75ca63794a6aa8c5dc63db21" - integrity sha512-bM6oE6VQZ6hIFxDNKk8bKPa14hqFrV07J/vHGOeiAbJReIaQXmkVb6xQu4MR+JBTLa5arGRyAAjJe1qaQt3Uvg== - dependencies: - "@lezer/common" "^0.15.0" - -"@lmdb/lmdb-darwin-arm64@2.5.2": - version "2.5.2" - resolved "https://registry.yarnpkg.com/@lmdb/lmdb-darwin-arm64/-/lmdb-darwin-arm64-2.5.2.tgz#bc66fa43286b5c082e8fee0eacc17995806b6fbe" - integrity sha512-+F8ioQIUN68B4UFiIBYu0QQvgb9FmlKw2ctQMSBfW2QBrZIxz9vD9jCGqTCPqZBRbPHAS/vG1zSXnKqnS2ch/A== - -"@lmdb/lmdb-darwin-x64@2.5.2": - version "2.5.2" - resolved "https://registry.yarnpkg.com/@lmdb/lmdb-darwin-x64/-/lmdb-darwin-x64-2.5.2.tgz#89d8390041bce6bab24a82a20392be22faf54ffc" - integrity sha512-KvPH56KRLLx4KSfKBx0m1r7GGGUMXm0jrKmNE7plbHlesZMuPJICtn07HYgQhj1LNsK7Yqwuvnqh1QxhJnF1EA== - -"@lmdb/lmdb-linux-arm64@2.5.2": - version "2.5.2" - resolved "https://registry.yarnpkg.com/@lmdb/lmdb-linux-arm64/-/lmdb-linux-arm64-2.5.2.tgz#14fe4c96c2bb1285f93797f45915fa35ee047268" - integrity sha512-aLl89VHL/wjhievEOlPocoefUyWdvzVrcQ/MHQYZm2JfV1jUsrbr/ZfkPPUFvZBf+VSE+Q0clWs9l29PCX1hTQ== - -"@lmdb/lmdb-linux-arm@2.5.2": - version "2.5.2" - resolved "https://registry.yarnpkg.com/@lmdb/lmdb-linux-arm/-/lmdb-linux-arm-2.5.2.tgz#05bde4573ab10cf21827339fe687148f2590cfa1" - integrity sha512-5kQAP21hAkfW5Bl+e0P57dV4dGYnkNIpR7f/GAh6QHlgXx+vp/teVj4PGRZaKAvt0GX6++N6hF8NnGElLDuIDw== - -"@lmdb/lmdb-linux-x64@2.5.2": - version "2.5.2" - resolved "https://registry.yarnpkg.com/@lmdb/lmdb-linux-x64/-/lmdb-linux-x64-2.5.2.tgz#d2f85afd857d2c33d2caa5b057944574edafcfee" - integrity sha512-xUdUfwDJLGjOUPH3BuPBt0NlIrR7f/QHKgu3GZIXswMMIihAekj2i97oI0iWG5Bok/b+OBjHPfa8IU9velnP/Q== - -"@lmdb/lmdb-win32-x64@2.5.2": - version "2.5.2" - resolved "https://registry.yarnpkg.com/@lmdb/lmdb-win32-x64/-/lmdb-win32-x64-2.5.2.tgz#28f643fbc0bec30b07fbe95b137879b6b4d1c9c5" - integrity sha512-zrBczSbXKxEyK2ijtbRdICDygRqWSRPpZMN5dD1T8VMEW5RIhIbwFWw2phDRXuBQdVDpSjalCIUMWMV2h3JaZA== - -"@mischnic/json-sourcemap@^0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@mischnic/json-sourcemap/-/json-sourcemap-0.1.0.tgz#38af657be4108140a548638267d02a2ea3336507" - integrity sha512-dQb3QnfNqmQNYA4nFSN/uLaByIic58gOXq4Y4XqLOWmOrw73KmJPt/HLyG0wvn1bnR6mBKs/Uwvkh+Hns1T0XA== - dependencies: - "@lezer/common" "^0.15.7" - "@lezer/lr" "^0.15.4" - json5 "^2.2.1" - -"@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.0.tgz#d31a238c943ffc34bab73ad6ce7a6466d65888ef" - integrity sha512-5qpnNHUyyEj9H3sm/4Um/bnx1lrQGhe8iqry/1d+cQYCRd/gzYA0YLeq0ezlk4hKx4vO+dsEsNyeowqRqslwQA== - -"@msgpackr-extract/msgpackr-extract-darwin-x64@3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.0.tgz#2f6fbbec3d3f0bbe9c6678c899f1c1a6e25ed980" - integrity sha512-ZphTFFd6SFweNAMKD+QJCrWpgkjf4qBuHltiMkKkD6FFrB3NOTRVmetAGTkJ57pa+s6J0yCH06LujWB9rZe94g== - -"@msgpackr-extract/msgpackr-extract-linux-arm64@3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.0.tgz#19875441da50b9aa8f8e726eb097a4cead435a3f" - integrity sha512-NEX6hdSvP4BmVyegaIbrGxvHzHvTzzsPaxXCsUt0mbLbPpEftsvNwaEVKOowXnLoeuGeD4MaqSwL3BUK2elsUA== - -"@msgpackr-extract/msgpackr-extract-linux-arm@3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.0.tgz#3b855ac72cc16e89db2f72adf47ddc964c20a53d" - integrity sha512-ztKVV1dO/sSZyGse0PBCq3Pk1PkYjsA/dsEWE7lfrGoAK3i9HpS2o7XjGQ7V4va6nX+xPPOiuYpQwa4Bi6vlww== - -"@msgpackr-extract/msgpackr-extract-linux-x64@3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.0.tgz#455f1d5bb00e87f78c67711f26e7bff9f1457684" - integrity sha512-9uvdAkZMOPCY7SPRxZLW8XGqBOVNVEhqlgffenN8shA1XR9FWVsSM13nr/oHtNgXg6iVyML7RwWPyqUeThlwxg== - -"@msgpackr-extract/msgpackr-extract-win32-x64@3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.0.tgz#03c6bfcd3acb179ea69546c20d50895b9d623ada" - integrity sha512-Wg0+9615kHKlr9iLVcG5I+/CHnf6w3x5UADRv8Ad16yA0Bu5l9eVOROjV7aHPG6uC8ZPFIVVaoSjDChD+Y0pzg== - -"@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1": - version "5.1.1-v1" - resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz#dbf733a965ca47b1973177dc0bb6c889edcfb129" - integrity sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg== - dependencies: - eslint-scope "5.1.1" - -"@parcel/babel-preset-env@^2.5.0": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/babel-preset-env/-/babel-preset-env-2.8.3.tgz#5e8b0c85aaeb775a365ead2a07fab940dfb90811" - integrity sha512-eBNnzVXC409yTEFoPmlZwHBSQlOqM2nBkyxuLN4aaVKziOWekOKLalk47O65NYJImL+yq4fPIrWd3Z3Lhukx/w== - dependencies: - "@babel/preset-env" "^7.4.0" - semver "^5.7.1" - -"@parcel/bundler-default@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/bundler-default/-/bundler-default-2.8.3.tgz#d64739dbc2dbd59d6629861bf77a8083aced5229" - integrity sha512-yJvRsNWWu5fVydsWk3O2L4yIy3UZiKWO2cPDukGOIWMgp/Vbpp+2Ct5IygVRtE22bnseW/E/oe0PV3d2IkEJGg== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/graph" "2.8.3" - "@parcel/hash" "2.8.3" - "@parcel/plugin" "2.8.3" - "@parcel/utils" "2.8.3" - nullthrows "^1.1.1" - -"@parcel/cache@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/cache/-/cache-2.8.3.tgz#169e130cf59913c0ed9fadce1a450e68f710e16f" - integrity sha512-k7xv5vSQrJLdXuglo+Hv3yF4BCSs1tQ/8Vbd6CHTkOhf7LcGg6CPtLw053R/KdMpd/4GPn0QrAsOLdATm1ELtQ== - dependencies: - "@parcel/fs" "2.8.3" - "@parcel/logger" "2.8.3" - "@parcel/utils" "2.8.3" - lmdb "2.5.2" - -"@parcel/codeframe@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/codeframe/-/codeframe-2.8.3.tgz#84fb529ef70def7f5bc64f6c59b18d24826f5fcc" - integrity sha512-FE7sY53D6n/+2Pgg6M9iuEC6F5fvmyBkRE4d9VdnOoxhTXtkEqpqYgX7RJ12FAQwNlxKq4suBJQMgQHMF2Kjeg== - dependencies: - chalk "^4.1.0" - -"@parcel/compressor-raw@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/compressor-raw/-/compressor-raw-2.8.3.tgz#301753df8c6de967553149639e8a4179b88f0c95" - integrity sha512-bVDsqleBUxRdKMakWSlWC9ZjOcqDKE60BE+Gh3JSN6WJrycJ02P5wxjTVF4CStNP/G7X17U+nkENxSlMG77ySg== - dependencies: - "@parcel/plugin" "2.8.3" - -"@parcel/config-default@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/config-default/-/config-default-2.8.3.tgz#9a43486e7c702e96c68052c37b79098d7240e35b" - integrity sha512-o/A/mbrO6X/BfGS65Sib8d6SSG45NYrNooNBkH/o7zbOBSRQxwyTlysleK1/3Wa35YpvFyLOwgfakqCtbGy4fw== - dependencies: - "@parcel/bundler-default" "2.8.3" - "@parcel/compressor-raw" "2.8.3" - "@parcel/namer-default" "2.8.3" - "@parcel/optimizer-css" "2.8.3" - "@parcel/optimizer-htmlnano" "2.8.3" - "@parcel/optimizer-image" "2.8.3" - "@parcel/optimizer-svgo" "2.8.3" - "@parcel/optimizer-terser" "2.8.3" - "@parcel/packager-css" "2.8.3" - "@parcel/packager-html" "2.8.3" - "@parcel/packager-js" "2.8.3" - "@parcel/packager-raw" "2.8.3" - "@parcel/packager-svg" "2.8.3" - "@parcel/reporter-dev-server" "2.8.3" - "@parcel/resolver-default" "2.8.3" - "@parcel/runtime-browser-hmr" "2.8.3" - "@parcel/runtime-js" "2.8.3" - "@parcel/runtime-react-refresh" "2.8.3" - "@parcel/runtime-service-worker" "2.8.3" - "@parcel/transformer-babel" "2.8.3" - "@parcel/transformer-css" "2.8.3" - "@parcel/transformer-html" "2.8.3" - "@parcel/transformer-image" "2.8.3" - "@parcel/transformer-js" "2.8.3" - "@parcel/transformer-json" "2.8.3" - "@parcel/transformer-postcss" "2.8.3" - "@parcel/transformer-posthtml" "2.8.3" - "@parcel/transformer-raw" "2.8.3" - "@parcel/transformer-react-refresh-wrap" "2.8.3" - "@parcel/transformer-svg" "2.8.3" - -"@parcel/core@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/core/-/core-2.8.3.tgz#22a69f36095d53736ab10bf42697d9aa5f4e382b" - integrity sha512-Euf/un4ZAiClnlUXqPB9phQlKbveU+2CotZv7m7i+qkgvFn5nAGnrV4h1OzQU42j9dpgOxWi7AttUDMrvkbhCQ== - dependencies: - "@mischnic/json-sourcemap" "^0.1.0" - "@parcel/cache" "2.8.3" - "@parcel/diagnostic" "2.8.3" - "@parcel/events" "2.8.3" - "@parcel/fs" "2.8.3" - "@parcel/graph" "2.8.3" - "@parcel/hash" "2.8.3" - "@parcel/logger" "2.8.3" - "@parcel/package-manager" "2.8.3" - "@parcel/plugin" "2.8.3" - "@parcel/source-map" "^2.1.1" - "@parcel/types" "2.8.3" - "@parcel/utils" "2.8.3" - "@parcel/workers" "2.8.3" - abortcontroller-polyfill "^1.1.9" - base-x "^3.0.8" - browserslist "^4.6.6" - clone "^2.1.1" - dotenv "^7.0.0" - dotenv-expand "^5.1.0" - json5 "^2.2.0" - msgpackr "^1.5.4" - nullthrows "^1.1.1" - semver "^5.7.1" - -"@parcel/diagnostic@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/diagnostic/-/diagnostic-2.8.3.tgz#d560276d5d2804b48beafa1feaf3fc6b2ac5e39d" - integrity sha512-u7wSzuMhLGWZjVNYJZq/SOViS3uFG0xwIcqXw12w54Uozd6BH8JlhVtVyAsq9kqnn7YFkw6pXHqAo5Tzh4FqsQ== - dependencies: - "@mischnic/json-sourcemap" "^0.1.0" - nullthrows "^1.1.1" - -"@parcel/events@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/events/-/events-2.8.3.tgz#205f8d874e6ecc2cbdb941bf8d54bae669e571af" - integrity sha512-hoIS4tAxWp8FJk3628bsgKxEvR7bq2scCVYHSqZ4fTi/s0+VymEATrRCUqf+12e5H47uw1/ZjoqrGtBI02pz4w== - -"@parcel/fs-search@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/fs-search/-/fs-search-2.8.3.tgz#1c7d812c110b808758f44c56e61dfffdb09e9451" - integrity sha512-DJBT2N8knfN7Na6PP2mett3spQLTqxFrvl0gv+TJRp61T8Ljc4VuUTb0hqBj+belaASIp3Q+e8+SgaFQu7wLiQ== - dependencies: - detect-libc "^1.0.3" - -"@parcel/fs@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/fs/-/fs-2.8.3.tgz#80536afe877fc8a2bd26be5576b9ba27bb4c5754" - integrity sha512-y+i+oXbT7lP0e0pJZi/YSm1vg0LDsbycFuHZIL80pNwdEppUAtibfJZCp606B7HOjMAlNZOBo48e3hPG3d8jgQ== - dependencies: - "@parcel/fs-search" "2.8.3" - "@parcel/types" "2.8.3" - "@parcel/utils" "2.8.3" - "@parcel/watcher" "^2.0.7" - "@parcel/workers" "2.8.3" - -"@parcel/graph@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/graph/-/graph-2.8.3.tgz#00ffe8ec032e74fee57199e54529f1da7322571d" - integrity sha512-26GL8fYZPdsRhSXCZ0ZWliloK6DHlMJPWh6Z+3VVZ5mnDSbYg/rRKWmrkhnr99ZWmL9rJsv4G74ZwvDEXTMPBg== - dependencies: - nullthrows "^1.1.1" - -"@parcel/hash@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/hash/-/hash-2.8.3.tgz#bc2499a27395169616cad2a99e19e69b9098f6e9" - integrity sha512-FVItqzjWmnyP4ZsVgX+G00+6U2IzOvqDtdwQIWisCcVoXJFCqZJDy6oa2qDDFz96xCCCynjRjPdQx2jYBCpfYw== - dependencies: - detect-libc "^1.0.3" - xxhash-wasm "^0.4.2" - -"@parcel/logger@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/logger/-/logger-2.8.3.tgz#e14e4debafb3ca9e87c07c06780f9afc38b2712c" - integrity sha512-Kpxd3O/Vs7nYJIzkdmB6Bvp3l/85ydIxaZaPfGSGTYOfaffSOTkhcW9l6WemsxUrlts4za6CaEWcc4DOvaMOPA== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/events" "2.8.3" - -"@parcel/markdown-ansi@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/markdown-ansi/-/markdown-ansi-2.8.3.tgz#1337d421bb1133ad178f386a8e1b746631bba4a1" - integrity sha512-4v+pjyoh9f5zuU/gJlNvNFGEAb6J90sOBwpKJYJhdWXLZMNFCVzSigxrYO+vCsi8G4rl6/B2c0LcwIMjGPHmFQ== - dependencies: - chalk "^4.1.0" - -"@parcel/namer-default@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/namer-default/-/namer-default-2.8.3.tgz#5304bee74beb4b9c1880781bdbe35be0656372f4" - integrity sha512-tJ7JehZviS5QwnxbARd8Uh63rkikZdZs1QOyivUhEvhN+DddSAVEdQLHGPzkl3YRk0tjFhbqo+Jci7TpezuAMw== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/plugin" "2.8.3" - nullthrows "^1.1.1" - -"@parcel/node-resolver-core@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/node-resolver-core/-/node-resolver-core-2.8.3.tgz#581df074a27646400b3fed9da95297b616a7db8f" - integrity sha512-12YryWcA5Iw2WNoEVr/t2HDjYR1iEzbjEcxfh1vaVDdZ020PiGw67g5hyIE/tsnG7SRJ0xdRx1fQ2hDgED+0Ww== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/utils" "2.8.3" - nullthrows "^1.1.1" - semver "^5.7.1" - -"@parcel/optimizer-css@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/optimizer-css/-/optimizer-css-2.8.3.tgz#420a333f4b78f7ff15e69217dfed34421b1143ee" - integrity sha512-JotGAWo8JhuXsQDK0UkzeQB0UR5hDAKvAviXrjqB4KM9wZNLhLleeEAW4Hk8R9smCeQFP6Xg/N/NkLDpqMwT3g== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/plugin" "2.8.3" - "@parcel/source-map" "^2.1.1" - "@parcel/utils" "2.8.3" - browserslist "^4.6.6" - lightningcss "^1.16.1" - nullthrows "^1.1.1" - -"@parcel/optimizer-htmlnano@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/optimizer-htmlnano/-/optimizer-htmlnano-2.8.3.tgz#a71ab6f0f24160ef9f573266064438eff65e96d0" - integrity sha512-L8/fHbEy8Id2a2E0fwR5eKGlv9VYDjrH9PwdJE9Za9v1O/vEsfl/0T/79/x129l5O0yB6EFQkFa20MiK3b+vOg== - dependencies: - "@parcel/plugin" "2.8.3" - htmlnano "^2.0.0" - nullthrows "^1.1.1" - posthtml "^0.16.5" - svgo "^2.4.0" - -"@parcel/optimizer-image@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/optimizer-image/-/optimizer-image-2.8.3.tgz#ea49b4245b4f7d60b38c7585c6311fb21d341baa" - integrity sha512-SD71sSH27SkCDNUNx9A3jizqB/WIJr3dsfp+JZGZC42tpD/Siim6Rqy9M4To/BpMMQIIiEXa5ofwS+DgTEiEHQ== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/plugin" "2.8.3" - "@parcel/utils" "2.8.3" - "@parcel/workers" "2.8.3" - detect-libc "^1.0.3" - -"@parcel/optimizer-svgo@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/optimizer-svgo/-/optimizer-svgo-2.8.3.tgz#04da4efec6b623679539a84961bff6998034ba8a" - integrity sha512-9KQed99NZnQw3/W4qBYVQ7212rzA9EqrQG019TIWJzkA9tjGBMIm2c/nXpK1tc3hQ3e7KkXkFCQ3C+ibVUnHNA== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/plugin" "2.8.3" - "@parcel/utils" "2.8.3" - svgo "^2.4.0" - -"@parcel/optimizer-terser@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/optimizer-terser/-/optimizer-terser-2.8.3.tgz#3a06d98d09386a1a0ae1be85376a8739bfba9618" - integrity sha512-9EeQlN6zIeUWwzrzu6Q2pQSaYsYGah8MtiQ/hog9KEPlYTP60hBv/+utDyYEHSQhL7y5ym08tPX5GzBvwAD/dA== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/plugin" "2.8.3" - "@parcel/source-map" "^2.1.1" - "@parcel/utils" "2.8.3" - nullthrows "^1.1.1" - terser "^5.2.0" - -"@parcel/package-manager@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/package-manager/-/package-manager-2.8.3.tgz#ddd0d62feae3cf0fb6cc0537791b3a16296ad458" - integrity sha512-tIpY5pD2lH53p9hpi++GsODy6V3khSTX4pLEGuMpeSYbHthnOViobqIlFLsjni+QA1pfc8NNNIQwSNdGjYflVA== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/fs" "2.8.3" - "@parcel/logger" "2.8.3" - "@parcel/types" "2.8.3" - "@parcel/utils" "2.8.3" - "@parcel/workers" "2.8.3" - semver "^5.7.1" - -"@parcel/packager-css@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/packager-css/-/packager-css-2.8.3.tgz#0eff34268cb4f5dfb53c1bbca85f5567aeb1835a" - integrity sha512-WyvkMmsurlHG8d8oUVm7S+D+cC/T3qGeqogb7sTI52gB6uiywU7lRCizLNqGFyFGIxcVTVHWnSHqItBcLN76lA== - dependencies: - "@parcel/plugin" "2.8.3" - "@parcel/source-map" "^2.1.1" - "@parcel/utils" "2.8.3" - nullthrows "^1.1.1" - -"@parcel/packager-html@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/packager-html/-/packager-html-2.8.3.tgz#f9263b891aa4dd46c6e2fa2b07025a482132fff1" - integrity sha512-OhPu1Hx1RRKJodpiu86ZqL8el2Aa4uhBHF6RAL1Pcrh2EhRRlPf70Sk0tC22zUpYL7es+iNKZ/n0Rl+OWSHWEw== - dependencies: - "@parcel/plugin" "2.8.3" - "@parcel/types" "2.8.3" - "@parcel/utils" "2.8.3" - nullthrows "^1.1.1" - posthtml "^0.16.5" - -"@parcel/packager-js@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/packager-js/-/packager-js-2.8.3.tgz#3ed11565915d73d12192b6901c75a6b820e4a83a" - integrity sha512-0pGKC3Ax5vFuxuZCRB+nBucRfFRz4ioie19BbDxYnvBxrd4M3FIu45njf6zbBYsI9eXqaDnL1b3DcZJfYqtIzw== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/hash" "2.8.3" - "@parcel/plugin" "2.8.3" - "@parcel/source-map" "^2.1.1" - "@parcel/utils" "2.8.3" - globals "^13.2.0" - nullthrows "^1.1.1" - -"@parcel/packager-raw@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/packager-raw/-/packager-raw-2.8.3.tgz#bdec826df991e186cb58691cc45d12ad5c06676e" - integrity sha512-BA6enNQo1RCnco9MhkxGrjOk59O71IZ9DPKu3lCtqqYEVd823tXff2clDKHK25i6cChmeHu6oB1Rb73hlPqhUA== - dependencies: - "@parcel/plugin" "2.8.3" - -"@parcel/packager-svg@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/packager-svg/-/packager-svg-2.8.3.tgz#7233315296001c531cb55ca96b5f2ef672343630" - integrity sha512-mvIoHpmv5yzl36OjrklTDFShLUfPFTwrmp1eIwiszGdEBuQaX7JVI3Oo2jbVQgcN4W7J6SENzGQ3Q5hPTW3pMw== - dependencies: - "@parcel/plugin" "2.8.3" - "@parcel/types" "2.8.3" - "@parcel/utils" "2.8.3" - posthtml "^0.16.4" - -"@parcel/plugin@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/plugin/-/plugin-2.8.3.tgz#7bb30a5775eaa6473c27f002a0a3ee7308d6d669" - integrity sha512-jZ6mnsS4D9X9GaNnvrixDQwlUQJCohDX2hGyM0U0bY2NWU8Km97SjtoCpWjq+XBCx/gpC4g58+fk9VQeZq2vlw== - dependencies: - "@parcel/types" "2.8.3" - -"@parcel/reporter-cli@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/reporter-cli/-/reporter-cli-2.8.3.tgz#12a4743b51b8fe6837f53c20e01bbf1f7336e8e4" - integrity sha512-3sJkS6tFFzgIOz3u3IpD/RsmRxvOKKiQHOTkiiqRt1l44mMDGKS7zANRnJYsQzdCsgwc9SOP30XFgJwtoVlMbw== - dependencies: - "@parcel/plugin" "2.8.3" - "@parcel/types" "2.8.3" - "@parcel/utils" "2.8.3" - chalk "^4.1.0" - term-size "^2.2.1" - -"@parcel/reporter-dev-server@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/reporter-dev-server/-/reporter-dev-server-2.8.3.tgz#a0daa5cc015642684cea561f4e0e7116bbffdc1c" - integrity sha512-Y8C8hzgzTd13IoWTj+COYXEyCkXfmVJs3//GDBsH22pbtSFMuzAZd+8J9qsCo0EWpiDow7V9f1LischvEh3FbQ== - dependencies: - "@parcel/plugin" "2.8.3" - "@parcel/utils" "2.8.3" - -"@parcel/resolver-default@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/resolver-default/-/resolver-default-2.8.3.tgz#5ae41e537ae4a793c1abb47f094482b9e2ac3535" - integrity sha512-k0B5M/PJ+3rFbNj4xZSBr6d6HVIe6DH/P3dClLcgBYSXAvElNDfXgtIimbjCyItFkW9/BfcgOVKEEIZOeySH/A== - dependencies: - "@parcel/node-resolver-core" "2.8.3" - "@parcel/plugin" "2.8.3" - -"@parcel/runtime-browser-hmr@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/runtime-browser-hmr/-/runtime-browser-hmr-2.8.3.tgz#1fa74e1fbd1030b0a920c58afa3a9eb7dc4bcd1e" - integrity sha512-2O1PYi2j/Q0lTyGNV3JdBYwg4rKo6TEVFlYGdd5wCYU9ZIN9RRuoCnWWH2qCPj3pjIVtBeppYxzfVjPEHINWVg== - dependencies: - "@parcel/plugin" "2.8.3" - "@parcel/utils" "2.8.3" - -"@parcel/runtime-js@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/runtime-js/-/runtime-js-2.8.3.tgz#0baa4c8fbf77eabce05d01ccc186614968ffc0cd" - integrity sha512-IRja0vNKwvMtPgIqkBQh0QtRn0XcxNC8HU1jrgWGRckzu10qJWO+5ULgtOeR4pv9krffmMPqywGXw6l/gvJKYQ== - dependencies: - "@parcel/plugin" "2.8.3" - "@parcel/utils" "2.8.3" - nullthrows "^1.1.1" - -"@parcel/runtime-react-refresh@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/runtime-react-refresh/-/runtime-react-refresh-2.8.3.tgz#381a942fb81e8f5ac6c7e0ee1b91dbf34763c3f8" - integrity sha512-2v/qFKp00MfG0234OdOgQNAo6TLENpFYZMbVbAsPMY9ITiqG73MrEsrGXVoGbYiGTMB/Toer/lSWlJxtacOCuA== - dependencies: - "@parcel/plugin" "2.8.3" - "@parcel/utils" "2.8.3" - react-error-overlay "6.0.9" - react-refresh "^0.9.0" - -"@parcel/runtime-service-worker@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/runtime-service-worker/-/runtime-service-worker-2.8.3.tgz#54d92da9ff1dfbd27db0e84164a22fa59e99b348" - integrity sha512-/Skkw+EeRiwzOJso5fQtK8c9b452uWLNhQH1ISTodbmlcyB4YalAiSsyHCtMYD0c3/t5Sx4ZS7vxBAtQd0RvOw== - dependencies: - "@parcel/plugin" "2.8.3" - "@parcel/utils" "2.8.3" - nullthrows "^1.1.1" - -"@parcel/source-map@^2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@parcel/source-map/-/source-map-2.1.1.tgz#fb193b82dba6dd62cc7a76b326f57bb35000a782" - integrity sha512-Ejx1P/mj+kMjQb8/y5XxDUn4reGdr+WyKYloBljpppUy8gs42T+BNoEOuRYqDVdgPc6NxduzIDoJS9pOFfV5Ew== - dependencies: - detect-libc "^1.0.3" - -"@parcel/transformer-babel@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/transformer-babel/-/transformer-babel-2.8.3.tgz#286bc6cb9afe4c0259f0b28e0f2f47322a24b130" - integrity sha512-L6lExfpvvC7T/g3pxf3CIJRouQl+sgrSzuWQ0fD4PemUDHvHchSP4SNUVnd6gOytF3Y1KpnEZIunQGi5xVqQCQ== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/plugin" "2.8.3" - "@parcel/source-map" "^2.1.1" - "@parcel/utils" "2.8.3" - browserslist "^4.6.6" - json5 "^2.2.0" - nullthrows "^1.1.1" - semver "^5.7.0" - -"@parcel/transformer-css@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/transformer-css/-/transformer-css-2.8.3.tgz#d6c44100204e73841ad8e0f90472172ea8b9120c" - integrity sha512-xTqFwlSXtnaYen9ivAgz+xPW7yRl/u4QxtnDyDpz5dr8gSeOpQYRcjkd4RsYzKsWzZcGtB5EofEk8ayUbWKEUg== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/plugin" "2.8.3" - "@parcel/source-map" "^2.1.1" - "@parcel/utils" "2.8.3" - browserslist "^4.6.6" - lightningcss "^1.16.1" - nullthrows "^1.1.1" - -"@parcel/transformer-html@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/transformer-html/-/transformer-html-2.8.3.tgz#5c68b28ee6b8c7a13b8aee87f7957ad3227bd83f" - integrity sha512-kIZO3qsMYTbSnSpl9cnZog+SwL517ffWH54JeB410OSAYF1ouf4n5v9qBnALZbuCCmPwJRGs4jUtE452hxwN4g== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/hash" "2.8.3" - "@parcel/plugin" "2.8.3" - nullthrows "^1.1.1" - posthtml "^0.16.5" - posthtml-parser "^0.10.1" - posthtml-render "^3.0.0" - semver "^5.7.1" - srcset "4" - -"@parcel/transformer-image@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/transformer-image/-/transformer-image-2.8.3.tgz#73805b2bfc3c8919d7737544e5f8be39e3f303fe" - integrity sha512-cO4uptcCGTi5H6bvTrAWEFUsTNhA4kCo8BSvRSCHA2sf/4C5tGQPHt3JhdO0GQLPwZRCh/R41EkJs5HZ8A8DAg== - dependencies: - "@parcel/plugin" "2.8.3" - "@parcel/utils" "2.8.3" - "@parcel/workers" "2.8.3" - nullthrows "^1.1.1" - -"@parcel/transformer-js@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/transformer-js/-/transformer-js-2.8.3.tgz#fe400df428394d1e7fe5afb6dea5c7c858e44f03" - integrity sha512-9Qd6bib+sWRcpovvzvxwy/PdFrLUXGfmSW9XcVVG8pvgXsZPFaNjnNT8stzGQj1pQiougCoxMY4aTM5p1lGHEQ== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/plugin" "2.8.3" - "@parcel/source-map" "^2.1.1" - "@parcel/utils" "2.8.3" - "@parcel/workers" "2.8.3" - "@swc/helpers" "^0.4.12" - browserslist "^4.6.6" - detect-libc "^1.0.3" - nullthrows "^1.1.1" - regenerator-runtime "^0.13.7" - semver "^5.7.1" - -"@parcel/transformer-json@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/transformer-json/-/transformer-json-2.8.3.tgz#25deb3a5138cc70a83269fc5d39d564609354d36" - integrity sha512-B7LmVq5Q7bZO4ERb6NHtRuUKWGysEeaj9H4zelnyBv+wLgpo4f5FCxSE1/rTNmP9u1qHvQ3scGdK6EdSSokGPg== - dependencies: - "@parcel/plugin" "2.8.3" - json5 "^2.2.0" - -"@parcel/transformer-postcss@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/transformer-postcss/-/transformer-postcss-2.8.3.tgz#df4fdc1c90893823445f2a8eb8e2bdd0349ccc58" - integrity sha512-e8luB/poIlz6jBsD1Izms+6ElbyzuoFVa4lFVLZnTAChI3UxPdt9p/uTsIO46HyBps/Bk8ocvt3J4YF84jzmvg== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/hash" "2.8.3" - "@parcel/plugin" "2.8.3" - "@parcel/utils" "2.8.3" - clone "^2.1.1" - nullthrows "^1.1.1" - postcss-value-parser "^4.2.0" - semver "^5.7.1" - -"@parcel/transformer-posthtml@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/transformer-posthtml/-/transformer-posthtml-2.8.3.tgz#7c3912a5a631cb26485f6464e0d6eeabb6f1e718" - integrity sha512-pkzf9Smyeaw4uaRLsT41RGrPLT5Aip8ZPcntawAfIo+KivBQUV0erY1IvHYjyfFzq1ld/Fo2Ith9He6mxpPifA== - dependencies: - "@parcel/plugin" "2.8.3" - "@parcel/utils" "2.8.3" - nullthrows "^1.1.1" - posthtml "^0.16.5" - posthtml-parser "^0.10.1" - posthtml-render "^3.0.0" - semver "^5.7.1" - -"@parcel/transformer-raw@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/transformer-raw/-/transformer-raw-2.8.3.tgz#3a22213fe18a5f83fd78889cb49f06e059cfead7" - integrity sha512-G+5cXnd2/1O3nV/pgRxVKZY/HcGSseuhAe71gQdSQftb8uJEURyUHoQ9Eh0JUD3MgWh9V+nIKoyFEZdf9T0sUQ== - dependencies: - "@parcel/plugin" "2.8.3" - -"@parcel/transformer-react-refresh-wrap@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/transformer-react-refresh-wrap/-/transformer-react-refresh-wrap-2.8.3.tgz#8b0392638405dd470a886002229f7889d5464822" - integrity sha512-q8AAoEvBnCf/nPvgOwFwKZfEl/thwq7c2duxXkhl+tTLDRN2vGmyz4355IxCkavSX+pLWSQ5MexklSEeMkgthg== - dependencies: - "@parcel/plugin" "2.8.3" - "@parcel/utils" "2.8.3" - react-refresh "^0.9.0" - -"@parcel/transformer-sass@^2.5.0": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/transformer-sass/-/transformer-sass-2.8.3.tgz#d3a0388e77c1e6279b488ccd0abf612d3a0897ff" - integrity sha512-ak196rjvXdsBOGi5aTkBEKv6i4LKQgOkHuaKEjeT8g2a3CU6Z36J+j2GbZzsznfws/hH+CRTf8bAsbkxtKlkjQ== - dependencies: - "@parcel/plugin" "2.8.3" - "@parcel/source-map" "^2.1.1" - sass "^1.38.0" - -"@parcel/transformer-svg@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/transformer-svg/-/transformer-svg-2.8.3.tgz#4df959cba4ebf45d7aaddd540f752e6e84df38b2" - integrity sha512-3Zr/gBzxi1ZH1fftH/+KsZU7w5GqkmxlB0ZM8ovS5E/Pl1lq1t0xvGJue9m2VuQqP8Mxfpl5qLFmsKlhaZdMIQ== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/hash" "2.8.3" - "@parcel/plugin" "2.8.3" - nullthrows "^1.1.1" - posthtml "^0.16.5" - posthtml-parser "^0.10.1" - posthtml-render "^3.0.0" - semver "^5.7.1" - -"@parcel/types@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/types/-/types-2.8.3.tgz#3306bc5391b6913bd619914894b8cd84a24b30fa" - integrity sha512-FECA1FB7+0UpITKU0D6TgGBpGxYpVSMNEENZbSJxFSajNy3wrko+zwBKQmFOLOiPcEtnGikxNs+jkFWbPlUAtw== - dependencies: - "@parcel/cache" "2.8.3" - "@parcel/diagnostic" "2.8.3" - "@parcel/fs" "2.8.3" - "@parcel/package-manager" "2.8.3" - "@parcel/source-map" "^2.1.1" - "@parcel/workers" "2.8.3" - utility-types "^3.10.0" - -"@parcel/utils@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/utils/-/utils-2.8.3.tgz#0d56c9e8e22c119590a5e044a0e01031965da40e" - integrity sha512-IhVrmNiJ+LOKHcCivG5dnuLGjhPYxQ/IzbnF2DKNQXWBTsYlHkJZpmz7THoeLtLliGmSOZ3ZCsbR8/tJJKmxjA== - dependencies: - "@parcel/codeframe" "2.8.3" - "@parcel/diagnostic" "2.8.3" - "@parcel/hash" "2.8.3" - "@parcel/logger" "2.8.3" - "@parcel/markdown-ansi" "2.8.3" - "@parcel/source-map" "^2.1.1" - chalk "^4.1.0" - -"@parcel/watcher@^2.0.7": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher/-/watcher-2.1.0.tgz#5f32969362db4893922c526a842d8af7a8538545" - integrity sha512-8s8yYjd19pDSsBpbkOHnT6Z2+UJSuLQx61pCFM0s5wSRvKCEMDjd/cHY3/GI1szHIWbpXpsJdg3V6ISGGx9xDw== - dependencies: - is-glob "^4.0.3" - micromatch "^4.0.5" - node-addon-api "^3.2.1" - node-gyp-build "^4.3.0" - -"@parcel/workers@2.8.3": - version "2.8.3" - resolved "https://registry.yarnpkg.com/@parcel/workers/-/workers-2.8.3.tgz#255450ccf4db234082407e4ddda5fd575f08c235" - integrity sha512-+AxBnKgjqVpUHBcHLWIHcjYgKIvHIpZjN33mG5LG9XXvrZiqdWvouEzqEXlVLq5VzzVbKIQQcmsvRy138YErkg== - dependencies: - "@parcel/diagnostic" "2.8.3" - "@parcel/logger" "2.8.3" - "@parcel/types" "2.8.3" - "@parcel/utils" "2.8.3" - chrome-trace-event "^1.0.2" - nullthrows "^1.1.1" - -"@swc/helpers@^0.4.12": - version "0.4.14" - resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.14.tgz#1352ac6d95e3617ccb7c1498ff019654f1e12a74" - integrity sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw== - dependencies: - tslib "^2.4.0" - -"@trysound/sax@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" - integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA== - -"@types/parse-json@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" - integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== - -abortcontroller-polyfill@^1.1.9: - version "1.7.5" - resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz#6738495f4e901fbb57b6c0611d0c75f76c485bed" - integrity sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ== - -acorn-jsx@^5.2.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" - integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== - -acorn@^7.1.1: - version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== - -acorn@^8.5.0: - version "8.8.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" - integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== - -ajv@^6.10.0, ajv@^6.10.2: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ansi-escapes@^4.2.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^3.2.0, ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -anymatch@~3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" - integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - -babel-plugin-polyfill-corejs2@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz#5d1bd3836d0a19e1b84bbf2d9640ccb6f951c122" - integrity sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q== - dependencies: - "@babel/compat-data" "^7.17.7" - "@babel/helper-define-polyfill-provider" "^0.3.3" - semver "^6.1.1" - -babel-plugin-polyfill-corejs3@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.6.0.tgz#56ad88237137eade485a71b52f72dbed57c6230a" - integrity sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.3" - core-js-compat "^3.25.1" - -babel-plugin-polyfill-regenerator@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz#390f91c38d90473592ed43351e801a9d3e0fd747" - integrity sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.3" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base-x@^3.0.8: - version "3.0.9" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" - integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== - dependencies: - safe-buffer "^5.0.1" - -binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -boolbase@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" - integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^3.0.2, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -browserslist@^4.21.3, browserslist@^4.24.0: - version "4.24.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" - integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== - dependencies: - caniuse-lite "^1.0.30001669" - electron-to-chromium "^1.5.41" - node-releases "^2.0.18" - update-browserslist-db "^1.1.1" - -browserslist@^4.21.4, browserslist@^4.6.6: - version "4.21.5" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.5.tgz#75c5dae60063ee641f977e00edd3cfb2fb7af6a7" - integrity sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w== - dependencies: - caniuse-lite "^1.0.30001449" - electron-to-chromium "^1.4.284" - node-releases "^2.0.8" - update-browserslist-db "^1.0.10" - -buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -caniuse-lite@^1.0.30001449, caniuse-lite@^1.0.30001669: - version "1.0.30001686" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001686.tgz#0e04b8d90de8753188e93c9989d56cb19d902670" - integrity sha512-Y7deg0Aergpa24M3qLC5xjNklnKnhsmSyR/V89dLZ1n0ucJIFNs7PgR2Yfa/Zf6W79SbBicgtGxZr2juHkEUIA== - -chalk@^2.1.0, chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.1.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - -"chokidar@>=3.0.0 <4.0.0": - version "3.5.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - -chrome-trace-event@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" - integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== - -cli-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" - integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== - dependencies: - restore-cursor "^3.1.0" - -cli-width@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" - integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== - -clone@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" - integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -commander@^2.20.0: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -commander@^7.0.0, commander@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" - integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -convert-source-map@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" - integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== - -core-js-compat@^3.25.1: - version "3.27.2" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.27.2.tgz#607c50ad6db8fd8326af0b2883ebb987be3786da" - integrity sha512-welaYuF7ZtbYKGrIy7y3eb40d37rG1FvzEOfe7hSLd2iD6duMDqUhRfSvCGyC46HhR6Y8JXXdZ2lnRUMkPBpvg== - dependencies: - browserslist "^4.21.4" - -cosmiconfig@^7.0.1: - version "7.1.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6" - integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA== - dependencies: - "@types/parse-json" "^4.0.0" - import-fresh "^3.2.1" - parse-json "^5.0.0" - path-type "^4.0.0" - yaml "^1.10.0" - -cross-spawn@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -css-select@^4.1.3: - version "4.3.0" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.3.0.tgz#db7129b2846662fd8628cfc496abb2b59e41529b" - integrity sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ== - dependencies: - boolbase "^1.0.0" - css-what "^6.0.1" - domhandler "^4.3.1" - domutils "^2.8.0" - nth-check "^2.0.1" - -css-tree@^1.1.2, css-tree@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.1.3.tgz#eb4870fb6fd7707327ec95c2ff2ab09b5e8db91d" - integrity sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q== - dependencies: - mdn-data "2.0.14" - source-map "^0.6.1" - -css-what@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" - integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== - -csso@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/csso/-/csso-4.2.0.tgz#ea3a561346e8dc9f546d6febedd50187cf389529" - integrity sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA== - dependencies: - css-tree "^1.1.2" - -debug@^4.0.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== - dependencies: - ms "2.1.2" - -debug@^4.1.0, debug@^4.3.1: - version "4.3.7" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" - integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== - dependencies: - ms "^2.1.3" - -debug@^4.1.1: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -deep-is@~0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" - integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== - -detect-libc@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== - -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - -dom-serializer@^1.0.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.4.1.tgz#de5d41b1aea290215dc45a6dae8adcf1d32e2d30" - integrity sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag== - dependencies: - domelementtype "^2.0.1" - domhandler "^4.2.0" - entities "^2.0.0" - -domelementtype@^2.0.1, domelementtype@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" - integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== - -domhandler@^4.2.0, domhandler@^4.2.2, domhandler@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c" - integrity sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ== - dependencies: - domelementtype "^2.2.0" - -domutils@^2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" - integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A== - dependencies: - dom-serializer "^1.0.1" - domelementtype "^2.2.0" - domhandler "^4.2.0" - -dotenv-expand@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-5.1.0.tgz#3fbaf020bfd794884072ea26b1e9791d45a629f0" - integrity sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA== - -dotenv@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-7.0.0.tgz#a2be3cd52736673206e8a85fb5210eea29628e7c" - integrity sha512-M3NhsLbV1i6HuGzBUH8vXrtxOk+tWmzWKDMbAVSUp3Zsjm7ywFeuwrUXhmhQyRK1q5B5GGy7hcXPbj3bnfZg2g== - -electron-to-chromium@^1.4.284, electron-to-chromium@^1.5.41: - version "1.5.68" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.68.tgz#4f46be4d465ef00e2100d5557b66f4af70e3ce6c" - integrity sha512-FgMdJlma0OzUYlbrtZ4AeXjKxKPk6KT8WOP8BjcqxWtlg8qyJQjRzPJzUtUn5GBg1oQ26hFs7HOOHJMYiJRnvQ== - -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -entities@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" - integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== - -entities@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/entities/-/entities-3.0.1.tgz#2b887ca62585e96db3903482d336c1006c3001d4" - integrity sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q== - -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -escalade@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" - integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - -eslint-config-prettier@^6.10.1: - version "6.15.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz#7f93f6cb7d45a92f1537a70ecc06366e1ac6fed9" - integrity sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw== - dependencies: - get-stdin "^6.0.0" - -eslint-plugin-prettier@^3.1.3: - version "3.4.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz#e9ddb200efb6f3d05ffe83b1665a716af4a387e5" - integrity sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g== - dependencies: - prettier-linter-helpers "^1.0.0" - -eslint-scope@5.1.1, eslint-scope@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - -eslint-utils@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" - integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== - dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-visitor-keys@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - -eslint-visitor-keys@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" - integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== - -eslint@^6.8.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" - integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== - dependencies: - "@babel/code-frame" "^7.0.0" - ajv "^6.10.0" - chalk "^2.1.0" - cross-spawn "^6.0.5" - debug "^4.0.1" - doctrine "^3.0.0" - eslint-scope "^5.0.0" - eslint-utils "^1.4.3" - eslint-visitor-keys "^1.1.0" - espree "^6.1.2" - esquery "^1.0.1" - esutils "^2.0.2" - file-entry-cache "^5.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.0.0" - globals "^12.1.0" - ignore "^4.0.6" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - inquirer "^7.0.0" - is-glob "^4.0.0" - js-yaml "^3.13.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.14" - minimatch "^3.0.4" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.3" - progress "^2.0.0" - regexpp "^2.0.1" - semver "^6.1.2" - strip-ansi "^5.2.0" - strip-json-comments "^3.0.1" - table "^5.2.3" - text-table "^0.2.0" - v8-compile-cache "^2.0.3" - -espree@^6.1.2: - version "6.2.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-6.2.1.tgz#77fc72e1fd744a2052c20f38a5b575832e82734a" - integrity sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw== - dependencies: - acorn "^7.1.1" - acorn-jsx "^5.2.0" - eslint-visitor-keys "^1.1.0" - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esquery@^1.0.1: - version "1.4.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" - integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== - dependencies: - estraverse "^5.1.0" - -esrecurse@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - -estraverse@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== - -estraverse@^5.2.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" - integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - -fast-deep-equal@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-diff@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" - integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== - -fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= - -figures@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" - integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== - dependencies: - escape-string-regexp "^1.0.5" - -file-entry-cache@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" - integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== - dependencies: - flat-cache "^2.0.1" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -flat-cache@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" - integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== - dependencies: - flatted "^2.0.0" - rimraf "2.6.3" - write "1.0.3" - -flatted@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" - integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - -gensync@^1.0.0-beta.2: - version "1.0.0-beta.2" - resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" - integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== - -get-port@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/get-port/-/get-port-4.2.0.tgz#e37368b1e863b7629c43c5a323625f95cf24b119" - integrity sha512-/b3jarXkH8KJoOMQc3uVGHASwGLPq3gSFJ7tgJm2diza+bydJPTGOibin2steecKeOylE8oY2JERlVWkAJO6yw== - -get-stdin@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" - integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== - -glob-parent@^5.0.0, glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@^7.1.3: - version "7.2.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^11.1.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - -globals@^12.1.0: - version "12.4.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" - integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== - dependencies: - type-fest "^0.8.1" - -globals@^13.2.0: - version "13.20.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" - integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== - dependencies: - type-fest "^0.20.2" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -htmlnano@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/htmlnano/-/htmlnano-2.0.3.tgz#50ee639ed63357d4a6c01309f52a35892e4edc2e" - integrity sha512-S4PGGj9RbdgW8LhbILNK7W9JhmYP8zmDY7KDV/8eCiJBQJlbmltp5I0gv8c5ntLljfdxxfmJ+UJVSqyH4mb41A== - dependencies: - cosmiconfig "^7.0.1" - posthtml "^0.16.5" - timsort "^0.3.0" - -htmlparser2@^7.1.1: - version "7.2.0" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-7.2.0.tgz#8817cdea38bbc324392a90b1990908e81a65f5a5" - integrity sha512-H7MImA4MS6cw7nbyURtLPO1Tms7C5H602LRETv95z1MxO/7CP7rDVROehUYeYBUYEON94NXXDEPmZuq+hX4sog== - dependencies: - domelementtype "^2.0.1" - domhandler "^4.2.2" - domutils "^2.8.0" - entities "^3.0.1" - -iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -immutable@^4.0.0: - version "4.2.4" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.2.4.tgz#83260d50889526b4b531a5e293709a77f7c55a2a" - integrity sha512-WDxL3Hheb1JkRN3sQkyujNlL/xRjAo3rJtaU5xeufUauG66JdMr32bLj4gF+vWl84DIA3Zxw7tiAjneYzRRw+w== - -import-fresh@^3.0.0, import-fresh@^3.2.1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -inquirer@^7.0.0: - version "7.3.3" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" - integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== - dependencies: - ansi-escapes "^4.2.1" - chalk "^4.1.0" - cli-cursor "^3.1.0" - cli-width "^3.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.19" - mute-stream "0.0.8" - run-async "^2.4.0" - rxjs "^6.6.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-core-module@^2.9.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" - integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== - dependencies: - has "^1.0.3" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-json@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-json/-/is-json-2.0.1.tgz#6be166d144828a131d686891b983df62c39491ff" - integrity sha512-6BEnpVn1rcf3ngfmViLM6vjUjGErbdrL4rwlv+u1NO1XO8kqT4YGL8+19Q+Z/bas8tY90BTWMk2+fW1g6hQjbA== - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= +"@hotwired/stimulus@^3.0.0": + version "3.2.2" + resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.2.tgz#071aab59c600fed95b97939e605ff261a4251608" + integrity sha512-eGeIqNOQpXoPAIP7tC1+1Yc1yl1xnwYqg+3mzqxyrbE5pg5YFBZcA6YoTiByJB6DKAEsiWtl6tjTJS4IYtbB7A== jquery@^3.5.1: - version "3.6.0" - resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.0.tgz#c72a09f15c1bdce142f49dbf1170bdf8adac2470" - integrity sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw== - -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsesc@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" - integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== - -jsesc@~0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== - -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= - -json5@^2.2.0, json5@^2.2.1, json5@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" - integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== - -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -lightningcss-darwin-arm64@1.18.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.18.0.tgz#bcd7d494d99c69947abd71136a42e80dfa80c682" - integrity sha512-OqjydwtiNPgdH1ByIjA1YzqvDG/OMR6L3LPN6wRl1729LB0y4Mik7L06kmZaTb+pvUHr+NmDd2KCwnlrQ4zO3w== - -lightningcss-darwin-x64@1.18.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.18.0.tgz#952abea2405fe2bb8dd0bb57a9d5590f8d1d6414" - integrity sha512-mNiuPHj89/JHZmJMp+5H8EZSt6EL5DZRWJ31O6k3DrLLnRIQjXuXdDdN8kP7LoIkeWI5xvyD60CsReJm+YWYAw== - -lightningcss-linux-arm-gnueabihf@1.18.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.18.0.tgz#23ca85e05dc4def9b4975aef307554ef292b56cd" - integrity sha512-S+25JjI6601HiAVoTDXW6SqH+E94a+FHA7WQqseyNHunOgVWKcAkNEc2LJvVxgwTq6z41sDIb9/M3Z9wa9lk4A== - -lightningcss-linux-arm64-gnu@1.18.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.18.0.tgz#6c8e0a6e2c8b44cf180f3a0f0740402e8f656155" - integrity sha512-JSqh4+21dCgBecIQUet35dtE4PhhSEMyqe3y0ZNQrAJQ5kyUPSQHiw81WXnPJcOSTTpG0TyMLiC8K//+BsFGQA== - -lightningcss-linux-arm64-musl@1.18.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.18.0.tgz#88393c101cf236ea0cdc97fddd66b82db964d835" - integrity sha512-2FWHa8iUhShnZnqhn2wfIcK5adJat9hAAaX7etNsoXJymlliDIOFuBQEsba2KBAZSM4QqfQtvRdR7m8i0I7ybQ== - -lightningcss-linux-x64-gnu@1.18.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.18.0.tgz#ad068d24836568337bfe545650565e13f813c8ee" - integrity sha512-plCPGQJtDZHcLVKVRLnQVF2XRsIC32WvuJhQ7fJ7F6BV98b/VZX0OlX05qUaOESD9dCDHjYSfxsgcvOKgCWh7A== - -lightningcss-linux-x64-musl@1.18.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.18.0.tgz#4d84de26b8185aa42450e0f4c83bbfb5a36ae750" - integrity sha512-na+BGtVU6fpZvOHKhnlA0XHeibkT3/46nj6vLluG3kzdJYoBKU6dIl7DSOk++8jv4ybZyFJ0aOFMMSc8g2h58A== - -lightningcss-win32-x64-msvc@1.18.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.18.0.tgz#f83952d16b83dfce65f4615f87c867769220d117" - integrity sha512-5qeAH4RMNy2yMNEl7e5TI6upt/7xD2ZpHWH4RkT8iJ7/6POS5mjHbXWUO9Q1hhDhqkdzGa76uAdMzEouIeCyNw== - -lightningcss@^1.16.1: - version "1.18.0" - resolved "https://registry.yarnpkg.com/lightningcss/-/lightningcss-1.18.0.tgz#ca3327a1a7571a83bbb9733ed4e4cded775bdadf" - integrity sha512-uk10tNxi5fhZqU93vtYiQgx/8a9f0Kvtj5AXIm+VlOXY+t/DWDmCZWJEkZJmmALgvbS6aAW8or+Kq85eJ6TDTw== - dependencies: - detect-libc "^1.0.3" - optionalDependencies: - lightningcss-darwin-arm64 "1.18.0" - lightningcss-darwin-x64 "1.18.0" - lightningcss-linux-arm-gnueabihf "1.18.0" - lightningcss-linux-arm64-gnu "1.18.0" - lightningcss-linux-arm64-musl "1.18.0" - lightningcss-linux-x64-gnu "1.18.0" - lightningcss-linux-x64-musl "1.18.0" - lightningcss-win32-x64-msvc "1.18.0" - -lines-and-columns@^1.1.6: - version "1.2.4" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" - integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== - -lmdb@2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/lmdb/-/lmdb-2.5.2.tgz#37e28a9fb43405f4dc48c44cec0e13a14c4a6ff1" - integrity sha512-V5V5Xa2Hp9i2XsbDALkBTeHXnBXh/lEmk9p22zdr7jtuOIY9TGhjK6vAvTpOOx9IKU4hJkRWZxn/HsvR1ELLtA== - dependencies: - msgpackr "^1.5.4" - node-addon-api "^4.3.0" - node-gyp-build-optional-packages "5.0.3" - ordered-binary "^1.2.4" - weak-lru-cache "^1.2.2" - optionalDependencies: - "@lmdb/lmdb-darwin-arm64" "2.5.2" - "@lmdb/lmdb-darwin-x64" "2.5.2" - "@lmdb/lmdb-linux-arm" "2.5.2" - "@lmdb/lmdb-linux-arm64" "2.5.2" - "@lmdb/lmdb-linux-x64" "2.5.2" - "@lmdb/lmdb-win32-x64" "2.5.2" - -lodash.debounce@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" - integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== - -lodash@^4.17.14, lodash@^4.17.19: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -lru-cache@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" - integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== - dependencies: - yallist "^3.0.2" - -mdn-data@2.0.14: - version "2.0.14" - resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" - integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow== - -micromatch@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== - dependencies: - braces "^3.0.2" - picomatch "^2.3.1" - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -minimatch@^3.0.4: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.2.5: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== - -mkdirp@^0.5.1: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@^2.1.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -msgpackr-extract@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/msgpackr-extract/-/msgpackr-extract-3.0.0.tgz#5b5c5fbfff25be5ee5b5a82a9cbe02e37f72bed0" - integrity sha512-oy6KCk1+X4Bn5m6Ycq5N1EWl9npqG/cLrE8ga8NX7ZqfqYUUBS08beCQaGq80fjbKBySur0E6x//yZjzNJDt3A== - dependencies: - node-gyp-build-optional-packages "5.0.7" - optionalDependencies: - "@msgpackr-extract/msgpackr-extract-darwin-arm64" "3.0.0" - "@msgpackr-extract/msgpackr-extract-darwin-x64" "3.0.0" - "@msgpackr-extract/msgpackr-extract-linux-arm" "3.0.0" - "@msgpackr-extract/msgpackr-extract-linux-arm64" "3.0.0" - "@msgpackr-extract/msgpackr-extract-linux-x64" "3.0.0" - "@msgpackr-extract/msgpackr-extract-win32-x64" "3.0.0" - -msgpackr@^1.5.4: - version "1.8.3" - resolved "https://registry.yarnpkg.com/msgpackr/-/msgpackr-1.8.3.tgz#78c1b91359f72707f4abeaca40cc423bd2d75185" - integrity sha512-m2JefwcKNzoHYXkH/5jzHRxAw7XLWsAdvu0FOJ+OLwwozwOV/J6UA62iLkfIMbg7G8+dIuRwgg6oz+QoQ4YkoA== - optionalDependencies: - msgpackr-extract "^3.0.0" - -mute-stream@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - -node-addon-api@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.2.1.tgz#81325e0a2117789c0128dab65e7e38f07ceba161" - integrity sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A== - -node-addon-api@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f" - integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ== - -node-gyp-build-optional-packages@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.0.3.tgz#92a89d400352c44ad3975010368072b41ad66c17" - integrity sha512-k75jcVzk5wnnc/FMxsf4udAoTEUv2jY3ycfdSd3yWu6Cnd1oee6/CfZJApyscA4FJOmdoixWwiwOyf16RzD5JA== - -node-gyp-build-optional-packages@5.0.7: - version "5.0.7" - resolved "https://registry.yarnpkg.com/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.0.7.tgz#5d2632bbde0ab2f6e22f1bbac2199b07244ae0b3" - integrity sha512-YlCCc6Wffkx0kHkmam79GKvDQ6x+QZkMjFGrIMxgFNILFvGSbCp2fCBC55pGTT9gVaz8Na5CLmxt/urtzRv36w== - -node-gyp-build@^4.3.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.0.tgz#0c52e4cbf54bbd28b709820ef7b6a3c2d6209055" - integrity sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ== - -node-releases@^2.0.18, node-releases@^2.0.8: - version "2.0.18" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" - integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g== - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -nth-check@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" - integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== - dependencies: - boolbase "^1.0.0" - -nullthrows@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/nullthrows/-/nullthrows-1.1.1.tgz#7818258843856ae971eae4208ad7d7eb19a431b1" - integrity sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw== - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -onetime@^5.1.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -optionator@^0.8.3: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - -ordered-binary@^1.2.4: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ordered-binary/-/ordered-binary-1.4.0.tgz#6bb53d44925f3b8afc33d1eed0fa15693b211389" - integrity sha512-EHQ/jk4/a9hLupIKxTfUsQRej1Yd/0QLQs3vGvIqg5ZtCYSzNhkzHoZc7Zf4e4kUlDaC3Uw8Q/1opOLNN2OKRQ== - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -parcel@^2.5.0: - version "2.8.3" - resolved "https://registry.yarnpkg.com/parcel/-/parcel-2.8.3.tgz#1ff71d7317274fd367379bc7310a52c6b75d30c2" - integrity sha512-5rMBpbNE72g6jZvkdR5gS2nyhwIXaJy8i65osOqs/+5b7zgf3eMKgjSsDrv6bhz3gzifsba6MBJiZdBckl+vnA== - dependencies: - "@parcel/config-default" "2.8.3" - "@parcel/core" "2.8.3" - "@parcel/diagnostic" "2.8.3" - "@parcel/events" "2.8.3" - "@parcel/fs" "2.8.3" - "@parcel/logger" "2.8.3" - "@parcel/package-manager" "2.8.3" - "@parcel/reporter-cli" "2.8.3" - "@parcel/reporter-dev-server" "2.8.3" - "@parcel/utils" "2.8.3" - chalk "^4.1.0" - commander "^7.0.0" - get-port "^4.2.0" - v8-compile-cache "^2.0.0" - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -parse-json@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - -path-parse@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -picocolors@^1.0.0, picocolors@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" - integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== - -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -postcss-value-parser@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" - integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== - -posthtml-parser@^0.10.1: - version "0.10.2" - resolved "https://registry.yarnpkg.com/posthtml-parser/-/posthtml-parser-0.10.2.tgz#df364d7b179f2a6bf0466b56be7b98fd4e97c573" - integrity sha512-PId6zZ/2lyJi9LiKfe+i2xv57oEjJgWbsHGGANwos5AvdQp98i6AtamAl8gzSVFGfQ43Glb5D614cvZf012VKg== - dependencies: - htmlparser2 "^7.1.1" - -posthtml-parser@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/posthtml-parser/-/posthtml-parser-0.11.0.tgz#25d1c7bf811ea83559bc4c21c189a29747a24b7a" - integrity sha512-QecJtfLekJbWVo/dMAA+OSwY79wpRmbqS5TeXvXSX+f0c6pW4/SE6inzZ2qkU7oAMCPqIDkZDvd/bQsSFUnKyw== - dependencies: - htmlparser2 "^7.1.1" - -posthtml-render@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/posthtml-render/-/posthtml-render-3.0.0.tgz#97be44931496f495b4f07b99e903cc70ad6a3205" - integrity sha512-z+16RoxK3fUPgwaIgH9NGnK1HKY9XIDpydky5eQGgAFVXTCSezalv9U2jQuNV+Z9qV1fDWNzldcw4eK0SSbqKA== - dependencies: - is-json "^2.0.1" - -posthtml@^0.16.4, posthtml@^0.16.5: - version "0.16.6" - resolved "https://registry.yarnpkg.com/posthtml/-/posthtml-0.16.6.tgz#e2fc407f67a64d2fa3567afe770409ffdadafe59" - integrity sha512-JcEmHlyLK/o0uGAlj65vgg+7LIms0xKXe60lcDOTU7oVX/3LuEuLwrQpW3VJ7de5TaFKiW4kWkaIpJL42FEgxQ== - dependencies: - posthtml-parser "^0.11.0" - posthtml-render "^3.0.0" - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - -prettier-linter-helpers@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" - integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== - dependencies: - fast-diff "^1.1.2" - -prettier@^2.6.0: - version "2.8.4" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.4.tgz#34dd2595629bfbb79d344ac4a91ff948694463c3" - integrity sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw== - -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -react-error-overlay@6.0.9: - version "6.0.9" - resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a" - integrity sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew== - -react-refresh@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.9.0.tgz#71863337adc3e5c2f8a6bfddd12ae3bfe32aafbf" - integrity sha512-Gvzk7OZpiqKSkxsQvO/mbTN1poglhmAV7gR/DdIrRrSMXraRQQlfikRJOr3Nb9GTMPC5kof948Zy6jJZIFtDvQ== - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - -regenerate-unicode-properties@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz#7c3192cab6dd24e21cb4461e5ddd7dd24fa8374c" - integrity sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ== - dependencies: - regenerate "^1.4.2" - -regenerate@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" - integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== - -regenerator-runtime@^0.13.11, regenerator-runtime@^0.13.7: - version "0.13.11" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" - integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== - -regenerator-transform@^0.15.1: - version "0.15.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.1.tgz#f6c4e99fc1b4591f780db2586328e4d9a9d8dc56" - integrity sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg== - dependencies: - "@babel/runtime" "^7.8.4" - -regexpp@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" - integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== - -regexpu-core@^5.2.1: - version "5.3.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.3.0.tgz#4d0d044b76fedbad6238703ae84bfdedee2cf074" - integrity sha512-ZdhUQlng0RoscyW7jADnUZ25F5eVtHdMyXSb2PiwafvteRAOJUjFoUPEYZSIfP99fBIs3maLIRfpEddT78wAAQ== - dependencies: - "@babel/regjsgen" "^0.8.0" - regenerate "^1.4.2" - regenerate-unicode-properties "^10.1.0" - regjsparser "^0.9.1" - unicode-match-property-ecmascript "^2.0.0" - unicode-match-property-value-ecmascript "^2.1.0" - -regjsparser@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709" - integrity sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ== - dependencies: - jsesc "~0.5.0" - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve@^1.14.2: - version "1.22.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" - integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== - dependencies: - is-core-module "^2.9.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -restore-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" - integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== - dependencies: - onetime "^5.1.0" - signal-exit "^3.0.2" - -rimraf@2.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - -run-async@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" - integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== - -rxjs@^6.6.0: - version "6.6.7" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" - integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== - dependencies: - tslib "^1.9.0" - -safe-buffer@^5.0.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -sass@^1.26.3, sass@^1.38.0: - version "1.58.0" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.58.0.tgz#ee8aea3ad5ea5c485c26b3096e2df6087d0bb1cc" - integrity sha512-PiMJcP33DdKtZ/1jSjjqVIKihoDc6yWmYr9K/4r3fVVIEDAluD0q7XZiRKrNJcPK3qkLRF/79DND1H5q1LBjgg== - dependencies: - chokidar ">=3.0.0 <4.0.0" - immutable "^4.0.0" - source-map-js ">=0.6.2 <2.0.0" - -semver@^5.5.0, semver@^5.7.0, semver@^5.7.1: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@^6.1.1, semver@^6.1.2: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^6.3.0, semver@^6.3.1: - version "6.3.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - -signal-exit@^3.0.2: - version "3.0.5" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f" - integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ== - -slice-ansi@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== - dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" - -"source-map-js@>=0.6.2 <2.0.0": - version "1.0.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" - integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== - -source-map-support@~0.5.20: - version "0.5.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0, source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -srcset@4: - version "4.0.0" - resolved "https://registry.yarnpkg.com/srcset/-/srcset-4.0.0.tgz#336816b665b14cd013ba545b6fe62357f86e65f4" - integrity sha512-wvLeHgcVHKO8Sc/H/5lkGreJQVeYMm9rlmt8PuR1xE31rIuXhuzznUUqAt8MqLhB3MqJdFzlNAfpcWnxiFUcPw== - -stable@^0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" - integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w== - -string-width@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - -string-width@^4.1.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" - integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" - -strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - -strip-ansi@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-json-comments@^3.0.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - -svgo@^2.4.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/svgo/-/svgo-2.8.0.tgz#4ff80cce6710dc2795f0c7c74101e6764cfccd24" - integrity sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg== - dependencies: - "@trysound/sax" "0.2.0" - commander "^7.2.0" - css-select "^4.1.3" - css-tree "^1.1.3" - csso "^4.2.0" - picocolors "^1.0.0" - stable "^0.1.8" - -table@^5.2.3: - version "5.4.6" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" - integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== - dependencies: - ajv "^6.10.2" - lodash "^4.17.14" - slice-ansi "^2.1.0" - string-width "^3.0.0" - -term-size@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54" - integrity sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== - -terser@^5.2.0: - version "5.16.3" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.16.3.tgz#3266017a9b682edfe019b8ecddd2abaae7b39c6b" - integrity sha512-v8wWLaS/xt3nE9dgKEWhNUFP6q4kngO5B8eYFUuebsu7Dw/UNAnpUod6UHo04jSSkv8TzKHjZDSd7EXdDQAl8Q== - dependencies: - "@jridgewell/source-map" "^0.3.2" - acorn "^8.5.0" - commander "^2.20.0" - source-map-support "~0.5.20" - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= - -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -timsort@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" - integrity sha512-qsdtZH+vMoCARQtyod4imc2nIJwg9Cc7lPRrw9CzF8ZKR0khdr8+2nX80PBhET3tcyTtJDxAffGh2rXH4tyU8A== - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -tslib@^1.9.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tslib@^2.4.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" - integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - -unicode-canonical-property-names-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" - integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== - -unicode-match-property-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3" - integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== - dependencies: - unicode-canonical-property-names-ecmascript "^2.0.0" - unicode-property-aliases-ecmascript "^2.0.0" - -unicode-match-property-value-ecmascript@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0" - integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== - -unicode-property-aliases-ecmascript@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" - integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== - -update-browserslist-db@^1.0.10, update-browserslist-db@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz#80846fba1d79e82547fb661f8d141e0945755fe5" - integrity sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A== - dependencies: - escalade "^3.2.0" - picocolors "^1.1.0" - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -utility-types@^3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.10.0.tgz#ea4148f9a741015f05ed74fd615e1d20e6bed82b" - integrity sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg== - -v8-compile-cache@^2.0.0, v8-compile-cache@^2.0.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" - integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== - -weak-lru-cache@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/weak-lru-cache/-/weak-lru-cache-1.2.2.tgz#fdbb6741f36bae9540d12f480ce8254060dccd19" - integrity sha512-DEAoo25RfSYMuTGc9vPJzZcZullwIqRDSI9LOy+fkCJPi6hykCnfKaXTuPBDuXAUcqHXyOgFtHNp/kB2FjYHbw== - -which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -write@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" - integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== - dependencies: - mkdirp "^0.5.1" - -xxhash-wasm@^0.4.2: - version "0.4.2" - resolved "https://registry.yarnpkg.com/xxhash-wasm/-/xxhash-wasm-0.4.2.tgz#752398c131a4dd407b5132ba62ad372029be6f79" - integrity sha512-/eyHVRJQCirEkSZ1agRSCwriMhwlyUcFkXD5TPVSLP+IPzjsqMVzZwdoczLp1SoQU0R3dxz1RpIK+4YNQbCVOA== - -yallist@^3.0.2: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - -yaml@^1.10.0: - version "1.10.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" - integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== + version "3.7.1" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de" + integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg== + +webfontloader@^1.6.28: + version "1.6.28" + resolved "https://registry.yarnpkg.com/webfontloader/-/webfontloader-1.6.28.tgz#db786129253cb6e8eae54c2fb05f870af6675bae" + integrity sha512-Egb0oFEga6f+nSgasH3E0M405Pzn6y3/9tOVanv/DLfa1YBIgcv90L18YyWnvXkRbIM17v5Kv6IT2N6g1x5tvQ== diff --git a/composer.json b/composer.json index 452a10ae..77a616df 100755 --- a/composer.json +++ b/composer.json @@ -4,7 +4,8 @@ "keywords": [ "sylius", "sylius-plugin", - "payplug" + "payplug", + "symfony-ux" ], "description": "PayPlug payment plugin for Sylius applications.", "license": "MIT", diff --git a/config/twig_hooks/shop.yaml b/config/twig_hooks/shop.yaml new file mode 100644 index 00000000..a3537890 --- /dev/null +++ b/config/twig_hooks/shop.yaml @@ -0,0 +1,6 @@ +sylius_twig_hooks: + hooks: + 'sylius_shop.product.show.content.info.summary': + pay_with_oney: + template: '@PayPlugSyliusPayPlugPlugin/oney/product/pay_with_oney.html.twig' + priority: 101 diff --git a/templates/oney/popin.html.twig b/templates/oney/popin.html.twig index 01283c0b..f0b48837 100644 --- a/templates/oney/popin.html.twig +++ b/templates/oney/popin.html.twig @@ -1,11 +1,7 @@ -{% import "@SyliusShop/Common/Macro/money.html.twig" as money %} +{% import "@SyliusShop/shared/macro/money.html.twig" as money %} + {% if data is empty %} {% set data = ineligibilityData %} - {% if is_oney_without_fees() %} - {% set logo_name = '3x4x-without-fees.svg' %} - {% else %} - {% set logo_name = '3x4x.svg' %} - {% endif %}
@@ -36,8 +32,10 @@ {% for key, choice in oney_supported_choices() %}
- Paiement en {{ key + 3 }}x + {{ ('payplug_sylius_payplug_plugin.ui.oney_x' ~ (key + 3) ~ '_with_fees_payment')|trans }}
{{ 'payplug_sylius_payplug_plugin.ui.popin_paiement_desc'|trans({ diff --git a/templates/oney/product/pay_with_oney.html.twig b/templates/oney/product/pay_with_oney.html.twig index fc01aa50..1c8c419d 100644 --- a/templates/oney/product/pay_with_oney.html.twig +++ b/templates/oney/product/pay_with_oney.html.twig @@ -13,37 +13,41 @@ {% else %} {% set logo_name = logo_disabled %} {% endif %} -
- {{ 'payplug_sylius_payplug_plugin.ui.or_pay_with_oney'|trans }} - -
-
+
+
+ {{ 'sylius.ui.loading'|trans }}
-
+ {{ 'payplug_sylius_payplug_plugin.ui.or_pay_with_oney'|trans }} + +
+
+ {% for variant_codes in sylius_product_variant_codes(hookable_metadata.context.product, sylius.channel) %} +
+ {% endfor %}
- - -
- {% for variantCodes in sylius_product_variant_codes(product, sylius.channel) %} -
- {% endfor %} -
- {% endif %} From 7887aceea47a3cdaccfcdebb42df37f6deb1c461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jib=C3=A9=20Barth?= Date: Mon, 28 Apr 2025 14:02:00 +0200 Subject: [PATCH 012/112] fix(oney_popin): Move images logo from productMeta to imagesMap Adding them to productMeta send them to controllers for check eligibility or popin content, whereas it's not needed --- assets/controllers/oney/popin_controller.js | 5 +++-- templates/oney/product/pay_with_oney.html.twig | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/assets/controllers/oney/popin_controller.js b/assets/controllers/oney/popin_controller.js index 93bfce6c..6ad46ddb 100644 --- a/assets/controllers/oney/popin_controller.js +++ b/assets/controllers/oney/popin_controller.js @@ -9,6 +9,7 @@ export default class extends Controller { eligibleUrl: String, popinUrl: String, productMeta: Object, + imagesMap: Object, translations: Object, } inputs = { @@ -77,7 +78,7 @@ export default class extends Controller { url: this.eligibleUrlValue, data: this.productMetaValue, success: (res) => { - $(this.element).find(".oney-logo").attr("src", this.productMetaValue.img[res.isEligible]); + $(this.element).find(".oney-logo").attr("src", this.imagesMapValue[res.isEligible ? 'enabled' : 'disabled']); res.isEligible ? $(this.popinTarget).removeClass("disabled").addClass("enabled") : $(this.popinTarget).removeClass("enabled").addClass("disabled"); @@ -161,4 +162,4 @@ export default class extends Controller { $(this.popinTarget).fadeOut(); }); } -} \ No newline at end of file +} diff --git a/templates/oney/product/pay_with_oney.html.twig b/templates/oney/product/pay_with_oney.html.twig index 1c8c419d..490f8064 100644 --- a/templates/oney/product/pay_with_oney.html.twig +++ b/templates/oney/product/pay_with_oney.html.twig @@ -20,10 +20,10 @@ popinUrl: path('payplug_sylius_oney_simulation_popin'), productMeta: { product_variant_code: (hookable_metadata.context.product|sylius_resolve_variant).code, - img: { - true: asset('bundles/payplugsyliuspayplugplugin/assets/oney/' ~ logo_enabled), - false: asset('bundles/payplugsyliuspayplugplugin/assets/oney/' ~ logo_disabled) - }, + }, + imagesMap: { + enabled: asset('bundles/payplugsyliuspayplugplugin/assets/oney/' ~ logo_enabled), + disabled: asset('bundles/payplugsyliuspayplugplugin/assets/oney/' ~ logo_disabled) }, translations: { reason: 'payplug_sylius_payplug_plugin.ui.oney_unavailable'|trans, From a33feccfd044cb8859643375456849c8af0c3dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jib=C3=A9=20Barth?= Date: Mon, 28 Apr 2025 14:30:01 +0200 Subject: [PATCH 013/112] chore(di): separate prepend twig specific And remove override of Sylius Shop/Admin templates --- .../PayPlugSyliusPayPlugExtension.php | 48 ++++--------------- 1 file changed, 8 insertions(+), 40 deletions(-) diff --git a/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php b/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php index edf4abb0..2793e114 100644 --- a/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php +++ b/src/DependencyInjection/PayPlugSyliusPayPlugExtension.php @@ -25,63 +25,31 @@ public function load(array $configs, ContainerBuilder $container): void $xmlloader = new XmlFileLoader($container, new FileLocator(dirname(__DIR__, 2) . '/config/services')); $ymlloader->load('services.yaml'); - + // TODO: migrate to YAML $xmlloader->load('client.xml'); $xmlloader->load('gateway.xml'); } public function prepend(ContainerBuilder $container): void + { + $this->prependTwigExtension($container); + $this->prependDoctrineMigrations($container); + } + + private function prependTwigExtension(ContainerBuilder $container): void { if (!$container->hasExtension('twig')) { return; } - $viewsPath = dirname(__DIR__, 2) . '/templates/'; - // This adds our override in twig paths with correct namespace if there are not already overridden - // No need for the final user to copy it - $paths = [ - $viewsPath . 'SyliusShopBundle' => 'SyliusShop', - $viewsPath . 'SyliusAdminBundle' => 'SyliusAdmin', - $viewsPath . 'SyliusUiBundle' => 'SyliusUi', - ]; - - $twigConfig = $container->getExtensionConfig('twig'); - - foreach ($paths as $key => $path) { - if ($this->isPathAlreadyInConfiguration($path, $twigConfig)) { - unset($paths[$key]); - } - } - + // TODO: check if still mandatory on v2 $container->prependExtensionConfig('twig', [ - 'paths' => $paths, 'form_themes' => [ '@PayPlugSyliusPayPlugPlugin/form/form_gateway_config_row.html.twig', '@PayPlugSyliusPayPlugPlugin/form/sylius_checkout_select_payment_row.html.twig', '@PayPlugSyliusPayPlugPlugin/form/complete_info_popin.html.twig', ], ]); - - $this->prependDoctrineMigrations($container); - } - - /** - * Verify if a given namespace is already extended - * - * @param string $namespace The namespace to verify - * @param array $configurations The given configurations - */ - protected function isPathAlreadyInConfiguration(string $namespace, array $configurations): bool - { - foreach ($configurations as $configuration) { - foreach ($configuration as $parameter => $values) { - if ('paths' === $parameter && in_array($namespace, $values, true)) { - return true; - } - } - } - - return false; } protected function getMigrationsNamespace(): string From 8b7391c197874b6fd677e41b1e7803898f1c1aaa Mon Sep 17 00:00:00 2001 From: maxperei Date: Mon, 28 Apr 2025 18:17:47 +0200 Subject: [PATCH 014/112] feat(display): [oney] simulation pop-in on cart summary --- assets/controllers/oney/popin_controller.js | 10 ++-- assets/shop/oney_cart/index.js | 11 ---- config/twig_hooks/shop.yaml | 4 ++ templates/oney/cart/pay_with_oney.html.twig | 62 +++++++++++---------- 4 files changed, 44 insertions(+), 43 deletions(-) delete mode 100644 assets/shop/oney_cart/index.js diff --git a/assets/controllers/oney/popin_controller.js b/assets/controllers/oney/popin_controller.js index 6ad46ddb..e8cc4554 100644 --- a/assets/controllers/oney/popin_controller.js +++ b/assets/controllers/oney/popin_controller.js @@ -106,11 +106,13 @@ export default class extends Controller { $(this.element).on("click", (e) => { e.preventDefault(); e.stopPropagation(); - if (!$(this.popinTarget).is(":empty") && $(this.popinTarget).text().trim() === this.storage) { - $(this.popinTarget).fadeIn(); - return; + if (this.hasEligibleUrlValue) { + if (!$(this.popinTarget).is(":empty") && $(this.popinTarget).text().trim() === this.storage) { + $(this.popinTarget).fadeIn(); + return; + } } - // content isn't loaded yet + // content isn't loaded yet or cart route this.toggleLoader(); this.load(); }); diff --git a/assets/shop/oney_cart/index.js b/assets/shop/oney_cart/index.js deleted file mode 100644 index 36e2733d..00000000 --- a/assets/shop/oney_cart/index.js +++ /dev/null @@ -1,11 +0,0 @@ -const Cart = { - init() { - Cart.position(); - }, - position() { - let el = $(".oney-info"); - el.next().insertBefore(el); - }, -}; - -document.addEventListener("DOMContentLoaded", Cart.init, false); diff --git a/config/twig_hooks/shop.yaml b/config/twig_hooks/shop.yaml index a3537890..83dd4c17 100644 --- a/config/twig_hooks/shop.yaml +++ b/config/twig_hooks/shop.yaml @@ -4,3 +4,7 @@ sylius_twig_hooks: pay_with_oney: template: '@PayPlugSyliusPayPlugPlugin/oney/product/pay_with_oney.html.twig' priority: 101 + 'sylius_shop.cart.index.content.form.sections.general#right': + pay_with_oney: + template: '@PayPlugSyliusPayPlugPlugin/oney/cart/pay_with_oney.html.twig' + priority: 1 \ No newline at end of file diff --git a/templates/oney/cart/pay_with_oney.html.twig b/templates/oney/cart/pay_with_oney.html.twig index f22394dd..c68e8ae9 100644 --- a/templates/oney/cart/pay_with_oney.html.twig +++ b/templates/oney/cart/pay_with_oney.html.twig @@ -15,35 +15,41 @@ {% set data = oney_ineligible_reasons() %} {% set logo_name = logo_disabled %} {% endif %} -
+
+
+ {{ 'sylius.ui.loading'|trans }} +
{{ 'payplug_sylius_payplug_plugin.ui.or_pay_with_oney'|trans }} - -
-
+ +
+ {% if data is not empty %} +
+ + + +
+
+ {% for reason in data.reasons %} +

{{ reason|trans(data.trans_params) }}

+ {% endfor %} +
+ {% endif %}
-
{% if data is not empty %} - -
- {% for reason in data.reasons %} -

{{ reason|trans(data.trans_params) }}

- {% endfor %} -
- {% endif %}
- - - -
{% endif %} From 636ca8c1b59124769fdadc394d0cc58499f09a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jib=C3=A9=20Barth?= Date: Tue, 29 Apr 2025 09:40:28 +0200 Subject: [PATCH 015/112] chore(state_machine): Use StateMachineInterface from sylius on ApplePayProvider And reorder private/public functions --- .../Payment/ApplePayPaymentProvider.php | 207 ++++++++---------- 1 file changed, 97 insertions(+), 110 deletions(-) diff --git a/src/Provider/Payment/ApplePayPaymentProvider.php b/src/Provider/Payment/ApplePayPaymentProvider.php index 2f6aeea4..d495c8a8 100644 --- a/src/Provider/Payment/ApplePayPaymentProvider.php +++ b/src/Provider/Payment/ApplePayPaymentProvider.php @@ -15,7 +15,7 @@ use PayPlug\SyliusPayPlugPlugin\Exception\Payment\PaymentNotCompletedException; use PayPlug\SyliusPayPlugPlugin\Gateway\ApplePayGatewayFactory; use PayPlug\SyliusPayPlugPlugin\Repository\PaymentMethodRepositoryInterface; -use SM\StateMachine\StateMachineInterface; +use Sylius\Abstraction\StateMachine\StateMachineInterface; use Sylius\Bundle\PayumBundle\Model\GatewayConfigInterface; use Sylius\Component\Core\Model\ChannelInterface; use Sylius\Component\Core\Model\OrderInterface; @@ -37,11 +37,9 @@ class ApplePayPaymentProvider { - public $stateMachineFactory; - public function __construct( private PaymentFactoryInterface $paymentFactory, - // private StateMachineFactoryInterface $stateMachineFactory; + private StateMachineInterface $stateMachine, private PaymentMethodRepositoryInterface $paymentMethodRepository, private PayPlugPaymentDataCreator $paymentDataCreator, #[Autowire('@sylius_payplug_plugin.api_client.apple_pay')] @@ -70,7 +68,7 @@ public function provide(Request $request, OrderInterface $order): PaymentInterfa $payment = $this->initApplePaySyliusPaymentState($order); Assert::notNull($order->getBillingAddress()); - if ($customer = $order->getBillingAddress()->getCustomer() instanceof \Sylius\Component\Customer\Model\CustomerInterface) { + if (($customer = $order->getBillingAddress()->getCustomer()) instanceof \Sylius\Component\Customer\Model\CustomerInterface) { $order->setCustomer($customer); } @@ -111,6 +109,91 @@ public function provide(Request $request, OrderInterface $order): PaymentInterfa return $payment; } + public function patch(Request $request, OrderInterface $order): PaymentInterface + { + $lastPayment = $order->getLastPayment(PaymentInterface::STATE_NEW); + + if (!$lastPayment instanceof PaymentInterface) { + throw new LogicException(); + } + + $paymentMethod = $lastPayment->getMethod(); + + Assert::isInstanceOf($paymentMethod, PaymentMethodInterface::class); + Assert::isInstanceOf($paymentMethod->getGatewayConfig(), GatewayConfigInterface::class); + + if (ApplePayGatewayFactory::FACTORY_NAME !== $paymentMethod->getGatewayConfig()->getFactoryName()) { + throw new LogicException(); + } + + $paymentResource = $this->applePayClient->retrieve($lastPayment->getDetails()['payment_id']); + + try { + $applePay = []; + $applePay['payment_token'] = $request->get('token'); + + $data = [ + ApplePayGatewayFactory::PAYMENT_METHOD_APPLE_PAY => $applePay, + ]; + + /** @var Payment $response */ + $response = $paymentResource->update($data); + $details = $lastPayment->getDetails(); + + if (!$response->is_paid) { + $this->applyRequiredPaymentTransition($lastPayment, PaymentInterface::STATE_FAILED); + + throw new PaymentNotCompletedException(); + } + + $details['status'] = PaymentInterface::STATE_COMPLETED; + $details['created_at'] = $response->created_at; + + $order = $lastPayment->getOrder(); + Assert::isInstanceOf($order, OrderInterface::class); + + $this->orderTokenAssigner->assignTokenValueIfNotSet($order); + + $this->entityManager->flush(); + + $this->applyRequiredPaymentTransition($lastPayment, PaymentInterface::STATE_COMPLETED); + + if ($this->isResourceIsAuthorized($response)) { + $details['status'] = PayPlugApiClientInterface::STATUS_AUTHORIZED; + } + + $lastPayment->setDetails($details); + + return $lastPayment; + } catch (\Exception) { + $paymentResource->abort(); + $this->applyRequiredPaymentTransition($lastPayment, PaymentInterface::STATE_FAILED); + + throw new PaymentNotCompletedException(); + } + } + + public function cancel(OrderInterface $order): void + { + $lastPayment = $order->getLastPayment(PaymentInterface::STATE_NEW); + + if (!$lastPayment instanceof PaymentInterface) { + throw new LogicException(); + } + + $paymentMethod = $lastPayment->getMethod(); + + Assert::isInstanceOf($paymentMethod, PaymentMethodInterface::class); + Assert::isInstanceOf($paymentMethod->getGatewayConfig(), GatewayConfigInterface::class); + + if (ApplePayGatewayFactory::FACTORY_NAME !== $paymentMethod->getGatewayConfig()->getFactoryName()) { + throw new LogicException(); + } + + $this->applyRequiredPaymentTransition($lastPayment, PaymentInterface::STATE_CANCELLED); + $this->entityManager->flush(); + } + /** * @throws NotProvidedOrderPaymentException */ @@ -152,118 +235,43 @@ private function getPayment(OrderInterface $order): PaymentInterface return $this->paymentFactory->createWithAmountAndCurrencyCode($order->getTotal(), $order->getCurrencyCode()); } - public function applyRequiredPaymentTransition(PaymentInterface $payment, string $targetState): void + private function applyRequiredPaymentTransition(PaymentInterface $payment, string $targetState): void { if ($targetState === $payment->getState()) { return; } - /** @var StateMachineInterface $stateMachine */ - $stateMachine = $this->stateMachineFactory->get($payment, PaymentTransitions::GRAPH); - /** @phpstan-ignore-next-line */ - $targetTransition = $stateMachine->getTransitionToState($targetState); + $targetTransition = $this->stateMachine->getTransitionToState($payment, PaymentTransitions::GRAPH, $targetState); if (null !== $targetTransition) { - $stateMachine->apply($targetTransition); + $this->stateMachine->apply($payment,PaymentTransitions::GRAPH, $targetTransition); } } - public function applyRequiredOrderPaymentTransition(OrderInterface $order, string $targetState): void + private function applyRequiredOrderPaymentTransition(OrderInterface $order, string $targetState): void { if ($targetState === $order->getPaymentState()) { return; } - /** @var StateMachineInterface $stateMachine */ - $stateMachine = $this->stateMachineFactory->get($order, OrderPaymentTransitions::GRAPH); - - /** @phpstan-ignore-next-line */ - $targetTransition = $stateMachine->getTransitionToState($targetState); + $targetTransition = $this->stateMachine->getTransitionToState($order, OrderPaymentTransitions::GRAPH, $targetState); if (null !== $targetTransition) { - $stateMachine->apply($targetTransition); + $this->stateMachine->apply($order,OrderPaymentTransitions::GRAPH, $targetTransition); } } - public function applyRequiredOrderCheckoutTransition(OrderInterface $order, string $targetState): void + private function applyRequiredOrderCheckoutTransition(OrderInterface $order, string $targetState): void { if ($targetState === $order->getPaymentState()) { return; } - /** @var StateMachineInterface $stateMachine */ - $stateMachine = $this->stateMachineFactory->get($order, OrderCheckoutTransitions::GRAPH); - - /** @phpstan-ignore-next-line */ - $targetTransition = $stateMachine->getTransitionToState($targetState); + $targetTransition = $this->stateMachine->getTransitionToState($order, OrderCheckoutTransitions::GRAPH, $targetState); if (null !== $targetTransition) { - $stateMachine->apply($targetTransition); - } - } - - public function patch(Request $request, OrderInterface $order): PaymentInterface - { - $lastPayment = $order->getLastPayment(PaymentInterface::STATE_NEW); - - if (!$lastPayment instanceof PaymentInterface) { - throw new LogicException(); - } - - $paymentMethod = $lastPayment->getMethod(); - - Assert::isInstanceOf($paymentMethod, PaymentMethodInterface::class); - Assert::isInstanceOf($paymentMethod->getGatewayConfig(), GatewayConfigInterface::class); - - if (ApplePayGatewayFactory::FACTORY_NAME !== $paymentMethod->getGatewayConfig()->getFactoryName()) { - throw new LogicException(); - } - - $paymentResource = $this->applePayClient->retrieve($lastPayment->getDetails()['payment_id']); - - try { - $applePay = []; - $applePay['payment_token'] = $request->get('token'); - - $data = [ - ApplePayGatewayFactory::PAYMENT_METHOD_APPLE_PAY => $applePay, - ]; - - /** @var Payment $response */ - $response = $paymentResource->update($data); - $details = $lastPayment->getDetails(); - - if (!$response->is_paid) { - $this->applyRequiredPaymentTransition($lastPayment, PaymentInterface::STATE_FAILED); - - throw new PaymentNotCompletedException(); - } - - $details['status'] = PaymentInterface::STATE_COMPLETED; - $details['created_at'] = $response->created_at; - - $order = $lastPayment->getOrder(); - Assert::isInstanceOf($order, OrderInterface::class); - - $this->orderTokenAssigner->assignTokenValueIfNotSet($order); - - $this->entityManager->flush(); - - $this->applyRequiredPaymentTransition($lastPayment, PaymentInterface::STATE_COMPLETED); - - if ($this->isResourceIsAuthorized($response)) { - $details['status'] = PayPlugApiClientInterface::STATUS_AUTHORIZED; - } - - $lastPayment->setDetails($details); - - return $lastPayment; - } catch (\Exception) { - $paymentResource->abort(); - $this->applyRequiredPaymentTransition($lastPayment, PaymentInterface::STATE_FAILED); - - throw new PaymentNotCompletedException(); + $this->stateMachine->apply($order,OrderCheckoutTransitions::GRAPH, $targetTransition); } } @@ -287,25 +295,4 @@ private function isResourceIsAuthorized(IVerifiableAPIResource $paymentResource) return $paymentResource->__isset('authorization') && $paymentResource->__get('authorization') instanceof PaymentAuthorization && null !== $paymentResource->__get('authorization')->__get('expires_at') && $now < $now->setTimestamp($paymentResource->__get('authorization')->__get('expires_at')); } - - public function cancel(OrderInterface $order): void - { - $lastPayment = $order->getLastPayment(PaymentInterface::STATE_NEW); - - if (!$lastPayment instanceof PaymentInterface) { - throw new LogicException(); - } - - $paymentMethod = $lastPayment->getMethod(); - - Assert::isInstanceOf($paymentMethod, PaymentMethodInterface::class); - Assert::isInstanceOf($paymentMethod->getGatewayConfig(), GatewayConfigInterface::class); - - if (ApplePayGatewayFactory::FACTORY_NAME !== $paymentMethod->getGatewayConfig()->getFactoryName()) { - throw new LogicException(); - } - - $this->applyRequiredPaymentTransition($lastPayment, PaymentInterface::STATE_CANCELLED); - $this->entityManager->flush(); - } } From 65235c9af49b0e3d0d5ab2b60fba3fb7ac0f897c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jib=C3=A9=20Barth?= Date: Tue, 29 Apr 2025 09:43:35 +0200 Subject: [PATCH 016/112] chore(state_machine): Use StateMachineInterface from sylius on CaptureAuthorizedPaymentCommand --- src/Command/CaptureAuthorizedPaymentCommand.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Command/CaptureAuthorizedPaymentCommand.php b/src/Command/CaptureAuthorizedPaymentCommand.php index b2afec29..29e43591 100644 --- a/src/Command/CaptureAuthorizedPaymentCommand.php +++ b/src/Command/CaptureAuthorizedPaymentCommand.php @@ -7,6 +7,7 @@ use Doctrine\ORM\EntityManagerInterface; use PayPlug\SyliusPayPlugPlugin\Repository\PaymentRepositoryInterface; use Psr\Log\LoggerInterface; +use Sylius\Abstraction\StateMachine\StateMachineInterface; use Sylius\Component\Payment\PaymentTransitions; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; @@ -17,10 +18,8 @@ #[AsCommand(name: 'payplug:capture-authorized-payments', description: 'Capture payplug authorized payments older than X days (default 6)')] class CaptureAuthorizedPaymentCommand extends Command { - public $stateMachineFactory; - public function __construct( - // private Factory $stateMachineFactory, + private StateMachineInterface $stateMachine, private PaymentRepositoryInterface $paymentRepository, private EntityManagerInterface $entityManager, private LoggerInterface $logger, @@ -49,7 +48,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int } foreach ($payments as $i => $payment) { - $stateMachine = $this->stateMachineFactory->get($payment, PaymentTransitions::GRAPH); $this->logger->info('[Payplug] Capturing payment {paymentId} (order #{orderNumber})', [ 'paymentId' => $payment->getId(), 'orderNumber' => $payment->getOrder()?->getNumber() ?? 'N/A', @@ -57,7 +55,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->writeln(sprintf('Capturing payment %d (order #%s)', $payment->getId(), $payment->getOrder()?->getNumber() ?? 'N/A')); try { - $stateMachine->apply(PaymentTransitions::TRANSITION_COMPLETE); + $this->stateMachine->apply($payment, PaymentTransitions::GRAPH, PaymentTransitions::TRANSITION_COMPLETE); } catch (\Throwable $e) { $this->logger->critical('[Payplug] Error while capturing payment {paymentId}', [ 'paymentId' => $payment->getId(), From 1bd4ed890aa10904bbadddf37433376dcc9950a2 Mon Sep 17 00:00:00 2001 From: Thomas VERMOT-GAUCHY Date: Thu, 24 Apr 2025 15:37:53 +0200 Subject: [PATCH 017/112] PPSYL-136 - sylius v2 - Adapt Account > Saved cards to upgrade (only tested empty for now) --- config/twig_hooks/twig_hooks.yaml | 13 ++++++ config/ui.yaml | 30 +------------ src/EventListener/AccountMenuListener.php | 2 +- .../SavedCards/Index/_header.html.twig | 4 +- .../SavedCards/Index/_subcontent.html.twig | 5 ++- templates/card/index.html.twig | 6 +-- templates/card/layout.html.twig | 44 +++++++++---------- templates/stylesheets/saved_cards.html.twig | 2 +- 8 files changed, 43 insertions(+), 63 deletions(-) create mode 100644 config/twig_hooks/twig_hooks.yaml diff --git a/config/twig_hooks/twig_hooks.yaml b/config/twig_hooks/twig_hooks.yaml new file mode 100644 index 00000000..0e4b6ca2 --- /dev/null +++ b/config/twig_hooks/twig_hooks.yaml @@ -0,0 +1,13 @@ +sylius_twig_hooks: + hooks: + 'sylius_shop.base#stylesheets': + payplug_styles: + template: '@PayPlugSyliusPayPlugPlugin/stylesheets/saved_cards.html.twig' + priority: 1 + 'sylius.shop.account.saved_cards.index.subcontent': + header: + template: '@SyliusShop/Account/SavedCards/Index/_header.html.twig' + priority: 20 + subcontent: + template: "@SyliusShop/Account/SavedCards/Index/_subcontent.html.twig" + priority: 10 diff --git a/config/ui.yaml b/config/ui.yaml index 720d44d5..8f25bae9 100644 --- a/config/ui.yaml +++ b/config/ui.yaml @@ -21,34 +21,6 @@ sylius_ui: blocks: oney_common: template: '@PayPlugSyliusPayPlugPlugin/stylesheets/oney_common.html.twig' - sylius.shop.account.saved_cards.index.header.content: - blocks: - legacy: - template: "@SyliusUi/Block/_legacySonataEvent.html.twig" - context: - event: sylius.shop.account.saved_cards.index.header - sylius.shop.account.saved_cards.layout.stylesheets: - blocks: - saved_cards: - template: '@PayPlugSyliusPayPlugPlugin/stylesheets/saved_cards.html.twig' - sylius.shop.account.saved_cards.index.subcontent: - blocks: - header: - template: '@SyliusShop/Account/SavedCards/Index/_header.html.twig' - priority: 20 - after_content_header_legacy: - template: "@SyliusUi/Block/_legacySonataEvent.html.twig" - priority: 15 - context: - event: sylius.shop.account.order.index.after_content_header - subcontent: - template: "@SyliusShop/Account/SavedCards/Index/_subcontent.html.twig" - priority: 10 - after_grid_legacy: - template: "@SyliusUi/Block/_legacySonataEvent.html.twig" - priority: 5 - context: - event: sylius.shop.account.order.index.after_grid sylius.admin.payment_method.create.stylesheets: &cssEvt blocks: payment_methods_css: @@ -60,4 +32,4 @@ sylius_ui: template: '@PayPlugSyliusPayPlugPlugin/stylesheets/select_payment_css.html.twig' select_payment_js: template: '@PayPlugSyliusPayPlugPlugin/javascripts/select_payment_js.html.twig' - sylius.shop.order.select_payment.before_form: *selectPayment \ No newline at end of file + sylius.shop.order.select_payment.before_form: *selectPayment diff --git a/src/EventListener/AccountMenuListener.php b/src/EventListener/AccountMenuListener.php index 9bc1cdbb..e563bf1c 100644 --- a/src/EventListener/AccountMenuListener.php +++ b/src/EventListener/AccountMenuListener.php @@ -19,7 +19,7 @@ public function addAccountMenuItems(MenuBuilderEvent $event): void ]) ->setAttribute('type', 'link') ->setLabel('payplug_sylius_payplug_plugin.ui.account.saved_cards.title') - ->setLabelAttribute('icon', 'credit card') + ->setLabelAttribute('icon', 'tabler:credit-card') ; } } diff --git a/templates/SyliusShopBundle/Account/SavedCards/Index/_header.html.twig b/templates/SyliusShopBundle/Account/SavedCards/Index/_header.html.twig index f9f75099..f63e5e3c 100644 --- a/templates/SyliusShopBundle/Account/SavedCards/Index/_header.html.twig +++ b/templates/SyliusShopBundle/Account/SavedCards/Index/_header.html.twig @@ -1,6 +1,4 @@

{{ 'payplug_sylius_payplug_plugin.ui.account.saved_cards.title'|trans }}
{{ 'payplug_sylius_payplug_plugin.ui.account.saved_cards.sub_title'|trans }}
- - {{ sylius_template_event('sylius.shop.account.saved_cards.index.header.content') }} -

\ No newline at end of file + diff --git a/templates/SyliusShopBundle/Account/SavedCards/Index/_subcontent.html.twig b/templates/SyliusShopBundle/Account/SavedCards/Index/_subcontent.html.twig index e3fdf002..d3569426 100644 --- a/templates/SyliusShopBundle/Account/SavedCards/Index/_subcontent.html.twig +++ b/templates/SyliusShopBundle/Account/SavedCards/Index/_subcontent.html.twig @@ -1,5 +1,6 @@ -{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} -{% import '@SyliusUi/Macro/messages.html.twig' as messages %} +{% import '@SyliusShop/shared/buttons.html.twig' as buttons %} +{% import '@SyliusShop/shared/messages.html.twig' as messages %} +{% set savedCards = get_hookable_context().savedCards %}
diff --git a/templates/card/index.html.twig b/templates/card/index.html.twig index 68614718..0cb79c26 100644 --- a/templates/card/index.html.twig +++ b/templates/card/index.html.twig @@ -1,10 +1,10 @@ {% extends '@PayPlugSyliusPayPlugPlugin/card/layout.html.twig' %} -{% import '@SyliusUi/Macro/messages.html.twig' as messages %} -{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} +{% import '@SyliusShop/shared/messages.html.twig' as messages %} +{% import '@SyliusShop/shared/buttons.html.twig' as buttons %} {% block title %}{{ 'payplug_sylius_payplug_plugin.ui.account.saved_cards.title'|trans }} | {{ parent() }}{% endblock %} {% block subcontent %} - {{ sylius_template_event('sylius.shop.account.saved_cards.index.subcontent', {'savedCards': savedCards}) }} + {% hook 'sylius.shop.account.saved_cards.index.subcontent' with { _prefixes: [], savedCards: savedCards } %} {% endblock %} diff --git a/templates/card/layout.html.twig b/templates/card/layout.html.twig index fc9f4bf4..c89bef1d 100644 --- a/templates/card/layout.html.twig +++ b/templates/card/layout.html.twig @@ -1,32 +1,28 @@ -{% extends '@SyliusShop/Account/layout.html.twig' %} +{% extends '@SyliusShop/account/common/index.html.twig' %} -{% block stylesheets %} - {{ parent() }} - {{ sylius_template_event('sylius.shop.account.saved_cards.layout.stylesheets') }} -{% endblock %} +{% from '@SyliusShop/shared/breadcrumbs.html.twig' import breadcrumbs as breadcrumbs %} {% block content %} - {% block breadcrumb %} - - {% endblock %} - -
-
- {{ sylius_template_event('sylius.shop.account.layout.menu') }} -
-
- {{ sylius_template_event('sylius.shop.account.layout.before_subcontent') }} - - {% block subcontent %} +
+
+ {% block breadcrumb %} +
+ {{ breadcrumbs([ + { label: 'sylius.ui.home'|trans, path: path('sylius_shop_homepage')}, + { label: 'sylius.ui.my_account'|trans, path: path('sylius_shop_account_dashboard')}, + { label: 'payplug_sylius_payplug_plugin.ui.account.saved_cards.title'|trans, active: true} + ]) }} +
{% endblock %} - {{ sylius_template_event('sylius.shop.account.layout.after_subcontent') }} +
+ {% hook 'sylius_shop.account.common.index.content.menu' %} +
+ +
+ {% block subcontent %} + {% endblock %} +
{% endblock %} diff --git a/templates/stylesheets/saved_cards.html.twig b/templates/stylesheets/saved_cards.html.twig index f027c015..19671027 100644 --- a/templates/stylesheets/saved_cards.html.twig +++ b/templates/stylesheets/saved_cards.html.twig @@ -1 +1 @@ -{% include '@SyliusUi/_stylesheets.html.twig' with {'path': 'bundles/payplugsyliuspayplugplugin/assets/shop/account/index.css'} %} \ No newline at end of file + From acb4c0e6978b842e43a712be1fa2481117200e9d Mon Sep 17 00:00:00 2001 From: Thomas VERMOT-GAUCHY Date: Thu, 24 Apr 2025 18:04:28 +0200 Subject: [PATCH 018/112] PPSYL-136 - sylius v2 - Checkout payment - Move style from block to hook --- config/twig_hooks/twig_hooks.yaml | 4 ++++ config/ui.yaml | 2 -- templates/stylesheets/select_payment_css.html.twig | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config/twig_hooks/twig_hooks.yaml b/config/twig_hooks/twig_hooks.yaml index 0e4b6ca2..a1e4c08e 100644 --- a/config/twig_hooks/twig_hooks.yaml +++ b/config/twig_hooks/twig_hooks.yaml @@ -11,3 +11,7 @@ sylius_twig_hooks: subcontent: template: "@SyliusShop/Account/SavedCards/Index/_subcontent.html.twig" priority: 10 + + 'sylius_shop.shared.form.select_payment.payment.choice.details': + select_payment_css: + template: '@PayPlugSyliusPayPlugPlugin/stylesheets/select_payment_css.html.twig' diff --git a/config/ui.yaml b/config/ui.yaml index 8f25bae9..f6d595ad 100644 --- a/config/ui.yaml +++ b/config/ui.yaml @@ -28,8 +28,6 @@ sylius_ui: sylius.admin.payment_method.update.stylesheets: *cssEvt sylius.shop.checkout.select_payment.before_form: &selectPayment blocks: - select_payment_css: - template: '@PayPlugSyliusPayPlugPlugin/stylesheets/select_payment_css.html.twig' select_payment_js: template: '@PayPlugSyliusPayPlugPlugin/javascripts/select_payment_js.html.twig' sylius.shop.order.select_payment.before_form: *selectPayment diff --git a/templates/stylesheets/select_payment_css.html.twig b/templates/stylesheets/select_payment_css.html.twig index 55cfa340..a3475eca 100644 --- a/templates/stylesheets/select_payment_css.html.twig +++ b/templates/stylesheets/select_payment_css.html.twig @@ -1 +1 @@ -{% include '@SyliusUi/_stylesheets.html.twig' with {'path': 'bundles/payplugsyliuspayplugplugin/assets/shop/payment/index.css'} %} + From 95678ae404a675b63253610628577bf569b5e95a Mon Sep 17 00:00:00 2001 From: Thomas VERMOT-GAUCHY Date: Mon, 28 Apr 2025 10:58:40 +0200 Subject: [PATCH 019/112] PPSYL-136 - sylius v2 - Checkout payment - Move template in hook (+ separate in sub-hook by payment method) --- config/twig_hooks/twig_hooks.yaml | 24 ++- .../Checkout/SelectPayment/_choice.html.twig | 143 ++---------------- .../_payplug_american_express_block.html.twig | 20 +++ .../_payplug_apple_pay_block.html.twig | 51 +++++++ .../_payplug_bancontact_block.html.twig | 18 +++ .../SelectPayment/_payplug_block.html.twig | 40 +++++ .../_payplug_oney_block.html.twig | 43 ++++++ templates/form/integrated.html.twig | 4 +- 8 files changed, 211 insertions(+), 132 deletions(-) create mode 100644 templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_american_express_block.html.twig create mode 100644 templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_apple_pay_block.html.twig create mode 100644 templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_bancontact_block.html.twig create mode 100644 templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_block.html.twig create mode 100644 templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_oney_block.html.twig diff --git a/config/twig_hooks/twig_hooks.yaml b/config/twig_hooks/twig_hooks.yaml index a1e4c08e..ed8cf378 100644 --- a/config/twig_hooks/twig_hooks.yaml +++ b/config/twig_hooks/twig_hooks.yaml @@ -12,6 +12,26 @@ sylius_twig_hooks: template: "@SyliusShop/Account/SavedCards/Index/_subcontent.html.twig" priority: 10 + 'sylius_shop.shared.form.select_payment.payment': + select_payment_css: + template: '@PayPlugSyliusPayPlugPlugin/stylesheets/select_payment_css.html.twig' + 'sylius_shop.shared.form.select_payment.payment.choice.details': - select_payment_css: - template: '@PayPlugSyliusPayPlugPlugin/stylesheets/select_payment_css.html.twig' + payplug_choice: + template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig' + + 'sylius_shop.checkout.select_payment.content.form.select_payment.payment.choice.details#payplug': + payplug_block: + template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_payplug_block.html.twig' + 'sylius_shop.checkout.select_payment.content.form.select_payment.payment.choice.details#payplug_oney': + payplug_oney_block: + template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_payplug_oney_block.html.twig' + 'sylius_shop.checkout.select_payment.content.form.select_payment.payment.choice.details#payplug_bancontact': + payplug_bancontact_block: + template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_payplug_bancontact_block.html.twig' + 'sylius_shop.checkout.select_payment.content.form.select_payment.payment.choice.details#payplug_apple_pay': + payplug_apple_pay_block: + template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_payplug_apple_pay_block.html.twig' + 'sylius_shop.checkout.select_payment.content.form.select_payment.payment.choice.details#payplug_american_express': + payplug_american_express_block: + template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_payplug_american_express_block.html.twig' diff --git a/templates/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig b/templates/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig index 0ee200c8..39b1ee67 100644 --- a/templates/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig +++ b/templates/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig @@ -1,135 +1,22 @@ +{% set form = hookable_metadata.context.form %} +{% set method = hookable_metadata.context.method %} +{% set order = hookable_metadata.context.order %} +{% set factoryName = method.gatewayConfig.factoryName %} + {% set oneyFactoryName = constant('PayPlug\\SyliusPayPlugPlugin\\Gateway\\OneyGatewayFactory::FACTORY_NAME') %} {% set payplugFactoryName = constant('PayPlug\\SyliusPayPlugPlugin\\Gateway\\PayplugGatewayFactory::FACTORY_NAME') %} {% set bancontactFactoryName = constant('PayPlug\\SyliusPayPlugPlugin\\Gateway\\BancontactGatewayFactory::FACTORY_NAME') %} {% set applePayFactoryName = constant('PayPlug\\SyliusPayPlugPlugin\\Gateway\\ApplePayGatewayFactory::FACTORY_NAME') %} {% set americanExpressFactoryName = constant('PayPlug\\SyliusPayPlugPlugin\\Gateway\\AmericanExpressGatewayFactory::FACTORY_NAME') %} -{% set checkboxClass = '' %} -{% if method.gatewayConfig.factoryName == oneyFactoryName %} - {% set checkboxClass = 'checkbox-oney' %} -{% elseif method.gatewayConfig.factoryName == payplugFactoryName %} - {% set checkboxClass = 'checkbox-payplug' %} -{% elseif method.gatewayConfig.factoryName == bancontactFactoryName %} - {% set checkboxClass = 'checkbox-bancontact' %} -{% elseif method.gatewayConfig.factoryName == applePayFactoryName %} - {% set checkboxClass = 'checkbox-applepay' %} -{% elseif method.gatewayConfig.factoryName == americanExpressFactoryName %} - {% set checkboxClass = 'checkbox-american-express' %} +{% if factoryName == oneyFactoryName %} + {% hook '#payplug_oney' %} +{% elseif factoryName == payplugFactoryName %} + {% hook '#payplug' %} +{% elseif factoryName == bancontactFactoryName %} + {% hook '#payplug_bancontact' %} +{% elseif factoryName == applePayFactoryName %} + {% hook '#payplug_apple_pay' %} +{% elseif factoryName == americanExpressFactoryName %} + {% hook '#payplug_american_express' %} {% endif %} - -{% set showOney = false %} -{% set hasSavedCards = false %} - -{% if method.gatewayConfig.factoryName == oneyFactoryName and form.parent.parent.oney_payment_choice is defined %} - {% set showOney = true %} -{% elseif is_granted('ROLE_USER') - and method.gatewayConfig.factoryName == payplugFactoryName - and form.parent.parent.payplug_card_choice is defined - and is_save_card_enabled(method) - and sylius.customer.cards is not empty -%} - {% set hasSavedCards = true %} -{% endif %} - -
-
-
- {{ form_widget(form, sylius_test_form_attribute('payment-method-select')) }} -
-
-
- - {% if method.gatewayConfig.factoryName == oneyFactoryName %} - - {% elseif method.gatewayConfig.factoryName == payplugFactoryName %} - {{ form_label(form, null, {'label_attr': {'data-test-payment-method-label': '', 'data-gateway': 'payplug'}}) }} - {% elseif method.gatewayConfig.factoryName == applePayFactoryName %} -
- -
- {% elseif method.gatewayConfig.factoryName == americanExpressFactoryName %} -
- -
- {% elseif method.gatewayConfig.factoryName == bancontactFactoryName %} -
- -
- {% else %} - {{ form_label(form, null, {'label_attr': {'data-test-payment-method-label': ''}}) }} - {% endif %} -
- {% if method.description is not null %} -
-

{{ method.description }}

-
- {% endif %} - {% if showOney %} -
- {{ form_row(form.parent.parent.oney_payment_choice) }} -
- {% if app.session is not null and app.session.get('oney_has_error') == true %} - - {% endif %} - {% elseif hasSavedCards %} -
- {{ form_row(form.parent.parent.payplug_card_choice) }} -
- {% endif %} - {% if method.gatewayConfig.factoryName is same as payplugFactoryName and method.gatewayConfig.config.integratedPayment is defined and method.gatewayConfig.config.integratedPayment is same as true %} - {% include '@PayPlugSyliusPayPlugPlugin/form/integrated.html.twig' with { - 'paymentMethod': method, - 'payment': order.getLastPayment('cart'), - 'hasSavedCards': hasSavedCards, - } %} - {% endif %} - {% if method.gatewayConfig.factoryName == applePayFactoryName %} - - - - {% endif %} -
-
diff --git a/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_american_express_block.html.twig b/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_american_express_block.html.twig new file mode 100644 index 00000000..ffc75650 --- /dev/null +++ b/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_american_express_block.html.twig @@ -0,0 +1,20 @@ +{% set form = hookable_metadata.context.form %} +{% set method = hookable_metadata.context.method %} +{% set order = hookable_metadata.context.order %} +{% set factoryName = method.gatewayConfig.factoryName %} +{% set code = method.code %} + +{% set americanExpressFactoryName = constant('PayPlug\\SyliusPayPlugPlugin\\Gateway\\AmericanExpressGatewayFactory::FACTORY_NAME') %} +{% set checkboxClass = 'checkbox-american-express' %} + + + diff --git a/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_apple_pay_block.html.twig b/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_apple_pay_block.html.twig new file mode 100644 index 00000000..97779abc --- /dev/null +++ b/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_apple_pay_block.html.twig @@ -0,0 +1,51 @@ +{% set form = hookable_metadata.context.form %} +{% set method = hookable_metadata.context.method %} +{% set order = hookable_metadata.context.order %} +{% set factoryName = method.gatewayConfig.factoryName %} +{% set code = method.code %} + +{% set applePayFactoryName = constant('PayPlug\\SyliusPayPlugPlugin\\Gateway\\ApplePayGatewayFactory::FACTORY_NAME') %} +{% set checkboxClass = 'checkbox-applepay' %} + +
+ +
+ +
+
+ + + {# TODO: Move in controller ? #} + + +
+ diff --git a/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_bancontact_block.html.twig b/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_bancontact_block.html.twig new file mode 100644 index 00000000..528fa2b8 --- /dev/null +++ b/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_bancontact_block.html.twig @@ -0,0 +1,18 @@ +{% set form = hookable_metadata.context.form %} +{% set method = hookable_metadata.context.method %} +{% set order = hookable_metadata.context.order %} +{% set factoryName = method.gatewayConfig.factoryName %} +{% set code = method.code %} + +{% set bancontactFactoryName = constant('PayPlug\\SyliusPayPlugPlugin\\Gateway\\BancontactGatewayFactory::FACTORY_NAME') %} +{% set checkboxClass = 'checkbox-bancontact' %} + + diff --git a/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_block.html.twig b/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_block.html.twig new file mode 100644 index 00000000..26b27e94 --- /dev/null +++ b/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_block.html.twig @@ -0,0 +1,40 @@ +{% set form = hookable_metadata.context.form %} +{% set method = hookable_metadata.context.method %} +{% set order = hookable_metadata.context.order %} +{% set factoryName = method.gatewayConfig.factoryName %} +{% set code = method.code %} + +{% set payplugFactoryName = constant('PayPlug\\SyliusPayPlugPlugin\\Gateway\\PayplugGatewayFactory::FACTORY_NAME') %} +{% set checkboxClass = 'checkbox-payplug' %} + +{% set hasSavedCards = false %} +{% if is_granted('ROLE_USER') + and form.parent.parent.payplug_card_choice is defined + and is_save_card_enabled(method) + and sylius.customer.cards is not empty +%} + {% set hasSavedCards = true %} +{% endif %} + +
+ + {{ form_label(form, null, {'label_attr': {'data-test-payment-method-label': '', 'data-gateway': 'payplug'}}) }} + + + {% if hasSavedCards %} + {# TODO: Is it ok to have form_row? #} +
+ {{ form_row(form.parent.parent.payplug_card_choice) }} +
+ {% endif %} + + {% if method.gatewayConfig.config.integratedPayment is defined and method.gatewayConfig.config.integratedPayment is same as true %} + {# TODO: Use hook? #} + {% include '@PayPlugSyliusPayPlugPlugin/form/integrated.html.twig' with { + 'paymentMethod': method, + 'payment': order.getLastPayment('cart'), + 'hasSavedCards': hasSavedCards, + } %} + {% endif %} +
+ diff --git a/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_oney_block.html.twig b/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_oney_block.html.twig new file mode 100644 index 00000000..985b4be0 --- /dev/null +++ b/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_oney_block.html.twig @@ -0,0 +1,43 @@ +{% set form = hookable_metadata.context.form %} +{% set method = hookable_metadata.context.method %} +{% set order = hookable_metadata.context.order %} +{% set factoryName = method.gatewayConfig.factoryName %} +{% set code = method.code %} + +{% set oneyFactoryName = constant('PayPlug\\SyliusPayPlugPlugin\\Gateway\\OneyGatewayFactory::FACTORY_NAME') %} +{% set checkboxClass = 'checkbox-oney' %} + +{% set showOney = false %} +{% if form.parent.parent.oney_payment_choice is defined %} + {% set showOney = true %} +{% endif %} + +
+ + {% if factoryName == oneyFactoryName %} + + {% endif %} + + + {% if showOney %} + {# TODO: Remove that. It is in another hook +
+ {{ form_row(form.parent.parent.oney_payment_choice) }} +
#} + {% if app.session is not null and app.session.get('oney_has_error') == true %} + {# TODO: Move that in controller?#} + + {% endif %} + {% endif %} +
+ diff --git a/templates/form/integrated.html.twig b/templates/form/integrated.html.twig index b1a30243..732cee38 100644 --- a/templates/form/integrated.html.twig +++ b/templates/form/integrated.html.twig @@ -116,5 +116,5 @@ -{% include '@SyliusUi/_javascripts.html.twig' with {'path': 'bundles/payplugsyliuspayplugplugin/assets/shop/payment/integrated.js'} %} -{% include '@SyliusUi/_stylesheets.html.twig' with {'path': 'bundles/payplugsyliuspayplugplugin/assets/shop/payment/integrated.css'} %} + + From c3fcbd2fb5fa8d310939d735a70ea5a3fbed0aba Mon Sep 17 00:00:00 2001 From: Thomas VERMOT-GAUCHY Date: Mon, 28 Apr 2025 14:58:15 +0200 Subject: [PATCH 020/112] PPSYL-136 - sylius v2 - Checkout payment - Replace 'integrated payment' script by stimulus controller (improvements are stille possible in it) --- assets/package.json | 6 + .../integrated-payment_controller.js | 247 ++++++++++++++++++ assets/shop/payment/integrated.js | 1 + .../SelectPayment/_payplug_block.html.twig | 2 +- 4 files changed, 255 insertions(+), 1 deletion(-) create mode 100644 assets/shop/controllers/integrated-payment_controller.js diff --git a/assets/package.json b/assets/package.json index bee944de..f19b4552 100644 --- a/assets/package.json +++ b/assets/package.json @@ -24,6 +24,12 @@ "@payplug/sylius-payplug-plugin/dist/shop/oney_common/index.css": true, "@payplug/sylius-payplug-plugin/dist/shop/oney_popin/index.css": true } + }, + "integrated-payment": { + "main": "shop/controllers/integrated-payment_controller.js", + "webpackMode": "lazy", + "fetch": "lazy", + "enabled": true } } }, diff --git a/assets/shop/controllers/integrated-payment_controller.js b/assets/shop/controllers/integrated-payment_controller.js new file mode 100644 index 00000000..f1dced3a --- /dev/null +++ b/assets/shop/controllers/integrated-payment_controller.js @@ -0,0 +1,247 @@ +import { Controller } from '@hotwired/stimulus'; + +export default class extends Controller { + static values = { + code: String, + factoryName: String, + } + + connect() { + this.options = { + api: null, + cartId: null, + form: {}, + fieldsValid: { + cardHolder: false, + pan: false, + cvv: false, + exp: false, + }, + fieldsEmpty: { + cardHolder: true, + pan: true, + cvv: true, + exp: true, + }, + inputStyle: { + default: { + color: '#2B343D', + fontFamily: 'Poppins, Arial, sans-serif', + fontSize: '14px', + textAlign: 'left', + '::placeholder': { + color: '#969a9f', + }, + ':focus': { + color: '#2B343D', + } + }, + invalid: { + color: '#E91932' + } + }, + save_card: false, + schemes: null, + scheme: null, + }; + + // Verify if we have required data + // TODO: Pass as param + if (payplug_integrated_payment_params === undefined) { + return; + } + + if (payplug_integrated_payment_params.has_saved_cards) { + document.querySelectorAll('.payment-choice__input, .payment-item input[type=radio]:not([name=schemeOptions])') + .forEach((element) => { + element.addEventListener('change', (e) => { // TODO: function + if ( + 'payplug_choice_card_other' === e.currentTarget.id + && e.currentTarget.checked + || e.target.value === payplug_integrated_payment_params.payment_method_code + && document.querySelector('#payplug_choice_card_other').checked + ) { + this.openFields(); // TODO: this.openFields() + return; + } + this.closeFields(); + }) + }) + return; + } + + const paplugIsChecked = this.getPaymentMethodSelectors({ methodCode: payplug_integrated_payment_params.payment_method_code, checked: true }); + if (paplugIsChecked.length) { + this.openFields(); + } + + const selectPaymentMethodsField= this.getPaymentMethodSelectors(); + selectPaymentMethodsField.forEach((element) => { + // On payment method select, open or close card fields + element.addEventListener('change', (e) => { + if (payplug_integrated_payment_params.payment_method_code === e.currentTarget.value && e.currentTarget.checked) { + this.openFields(); + return; + } + this.closeFields(); + }) + }); + } + + getPaymentMethodSelectors({ methodCode, checked } = {}) { + // const baseSelector = '[id*=sylius_checkout_select_payment_payments]'; // old id + const baseSelector = '[id*=sylius_shop_checkout_select_payment_payments]'; + + if (methodCode) { + if (checked) { + return document.querySelectorAll(`${baseSelector}[value=${methodCode}]:checked`); + } + return document.querySelectorAll(`${baseSelector}[value=${methodCode}]`); + } + return document.querySelectorAll(baseSelector); + } + + openFields() { + document.querySelector('.payplugIntegratedPayment').classList.add('payplugIntegratedPayment--loaded'); + document.querySelector('button[type=submit]').classList.add('disabled'); + if (null === this.options.api) { + this.load(); + } + } + closeFields() { + document.querySelector('.payplugIntegratedPayment').classList.remove('payplugIntegratedPayment--loaded'); + document.querySelector('button[type=submit]').classList.remove('disabled'); + } + + load() { + // TODO: integratedPaymentApi??? + const integratedPaymentApi = new Payplug.IntegratedPayment(payplug_integrated_payment_params.is_test_mode); + this.options.api = integratedPaymentApi; // = new Payplug.IntegratedPayment(payplug_integrated_payment_params.is_test_mode); + + integratedPaymentApi.setDisplayMode3ds(Payplug.DisplayMode3ds.LIGHTBOX); + + this.options.form.cardHolder = integratedPaymentApi.cardHolder( + document.querySelector('.cardHolder-input-container'), + { + default: this.options.inputStyle.default, + placeholder: payplug_integrated_payment_params.cardholder + } + ); + this.options.form.pan = integratedPaymentApi.cardNumber( + document.querySelector('.pan-input-container'), + { + default: this.options.inputStyle.default, + placeholder: payplug_integrated_payment_params.pan + } + ); + this.options.form.cvv = integratedPaymentApi.cvv( + document.querySelector('.cvv-input-container'), + { + default: this.options.inputStyle.default, + placeholder: payplug_integrated_payment_params.cvv + } + ); + this.options.form.exp = integratedPaymentApi.expiration( + document.querySelector('.exp-input-container'), + { + default: this.options.inputStyle.default, + placeholder: payplug_integrated_payment_params.exp + } + ); + this.options.schemes = integratedPaymentApi.getSupportedSchemes(); + this.bindEvents(); + this.fieldValidation(); + } + + bindEvents() { + document.querySelector('#paid').addEventListener('click', (event) => { + event.preventDefault(); + + this.options.api.validateForm(); // integratedPaymentApi.validateForm(); + }); + this.options.api.onValidateForm(async (aaa) => { // integratedPaymentApi.onValidateForm(async ({isFormValid}) => { + const {isFormValid} = aaa; + if (isFormValid) { + this.toggleLoader(); + const saveCardElement = document.querySelector('#savecard'); + if (null !== saveCardElement) { + this.options.save_card = saveCardElement.checked; + } + const chosenScheme = document.querySelector('[name=schemeOptions]:checked'); + this.options.scheme = Payplug.Scheme.AUTO; + if (null !== chosenScheme) { + this.options.scheme = chosenScheme.value; + } + if (payplug_integrated_payment_params.payment_id !== undefined) { + integratedPaymentApi.pay(payplug_integrated_payment_params.payment_id, this.options.scheme, {save_card: this.options.save_card}); + return; + } + const response = await fetch(payplug_integrated_payment_params.routes.init_payment, {method: 'POST'}); + const data = await response.json(); + this.options.api.pay(data.payment_id, this.options.scheme, {save_card: this.options.save_card}); // integratedPaymentApi.pay(data.payment_id, this.options.scheme, {save_card: this.options.save_card}); + } + }); + this.options.api.onCompleted((event) => { // integratedPaymentApi.onCompleted((event) => { + if (event.error) { + console.error(event.error); + return; + } + document.querySelector('input[name=payplug_integrated_payment_token]').value = event.token; + document.querySelector('form[name=sylius_checkout_select_payment]').submit(); + }); + } + + fieldValidation () { + Object.keys(this.options.form).forEach((key) => { + const field = this.options.form[key]; + field.onChange((err) => { + if (err.error) { + document.querySelector(`.payplugIntegratedPayment__error--${key}`).classList.remove('payplugIntegratedPayment__error--hide'); + document.querySelector(`.${key}-input-container`).classList.add('payplugIntegratedPayment__container--invalid'); + if (err.error.name === "FIELD_EMPTY") { + document.querySelector(`.payplugIntegratedPayment__error--${key}`).querySelector(".emptyField").classList.remove('payplugIntegratedPayment__error--hide'); + document.querySelector(`.payplugIntegratedPayment__error--${key}`).querySelector(".invalidField").classList.add('payplugIntegratedPayment__error--hide'); + } else { + document.querySelector(`.payplugIntegratedPayment__error--${key}`).querySelector(".invalidField").classList.remove('payplugIntegratedPayment__error--hide'); + document.querySelector(`.payplugIntegratedPayment__error--${key}`).querySelector(".emptyField").classList.add('payplugIntegratedPayment__error--hide'); + } + } else { + document.querySelector(`.payplugIntegratedPayment__error--${key}`).classList.add('payplugIntegratedPayment__error--hide'); + document.querySelector(`.${key}-input-container`).classList.remove('payplugIntegratedPayment__container--invalid'); + document.querySelector(`.payplugIntegratedPayment__error--${key}`).querySelector(".invalidField").classList.add('payplugIntegratedPayment__error--hide'); + document.querySelector(`.payplugIntegratedPayment__error--${key}`).querySelector(".emptyField").classList.add('payplugIntegratedPayment__error--hide'); + this.options.fieldsValid[key] = true; + this.options.fieldsEmpty[key] = false; + } + }); + }) + } + fieldValidationNOT_WORKING () { + $.each(this.options.form, function (key, field) { + field.onChange(function(err) { + if (err.error) { + document.querySelector(`.payplugIntegratedPayment__error--${key}`).classList.remove('payplugIntegratedPayment__error--hide'); + document.querySelector(`.${key}-input-container`).classList.add('payplugIntegratedPayment__container--invalid'); + if (err.error.name === "FIELD_EMPTY") { + document.querySelector(`.payplugIntegratedPayment__error--${key}`).querySelector(".emptyField").classList.remove('payplugIntegratedPayment__error--hide'); + document.querySelector(`.payplugIntegratedPayment__error--${key}`).querySelector(".invalidField").classList.add('payplugIntegratedPayment__error--hide'); + } else { + document.querySelector(`.payplugIntegratedPayment__error--${key}`).querySelector(".invalidField").classList.remove('payplugIntegratedPayment__error--hide'); + document.querySelector(`.payplugIntegratedPayment__error--${key}`).querySelector(".emptyField").classList.add('payplugIntegratedPayment__error--hide'); + } + } else { + document.querySelector(`.payplugIntegratedPayment__error--${key}`).classList.add('payplugIntegratedPayment__error--hide'); + document.querySelector(`.${key}-input-container`).classList.remove('payplugIntegratedPayment__container--invalid'); + document.querySelector(`.payplugIntegratedPayment__error--${key}`).querySelector(".invalidField").classList.add('payplugIntegratedPayment__error--hide'); + document.querySelector(`.payplugIntegratedPayment__error--${key}`).querySelector(".emptyField").classList.add('payplugIntegratedPayment__error--hide'); + this.options.fieldsValid[key] = true; + this.options.fieldsEmpty[key] = false; + } + }); + }); + } + + toggleLoader() { + document.querySelector('.payplugIntegratedPayment').querySelector('.dimmer').classList.toggle('active'); + } +} diff --git a/assets/shop/payment/integrated.js b/assets/shop/payment/integrated.js index 861f56c4..ffb29bec 100644 --- a/assets/shop/payment/integrated.js +++ b/assets/shop/payment/integrated.js @@ -1,3 +1,4 @@ +// TODO: Delete this file (moved to integrated-payment_controller.js) const IntegratedPayment = { options: { api: null, diff --git a/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_block.html.twig b/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_block.html.twig index 26b27e94..649d9706 100644 --- a/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_block.html.twig +++ b/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_block.html.twig @@ -16,7 +16,7 @@ {% set hasSavedCards = true %} {% endif %} -
+
{{ form_label(form, null, {'label_attr': {'data-test-payment-method-label': '', 'data-gateway': 'payplug'}}) }} From 30c92607ab8d608424ca8cc94d0c9e180ff44128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jib=C3=A9=20Barth?= Date: Tue, 29 Apr 2025 09:50:48 +0200 Subject: [PATCH 021/112] chore(state_machine): Use StateMachineInterface from sylius on PaymentStateResolver --- src/Resolver/PaymentStateResolver.php | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/Resolver/PaymentStateResolver.php b/src/Resolver/PaymentStateResolver.php index 022394db..53e21586 100644 --- a/src/Resolver/PaymentStateResolver.php +++ b/src/Resolver/PaymentStateResolver.php @@ -10,7 +10,7 @@ use PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientInterface; use PayPlug\SyliusPayPlugPlugin\Gateway\PayPlugGatewayFactory; use Payum\Core\Model\GatewayConfigInterface; -use SM\StateMachine\StateMachineInterface; +use Sylius\Abstraction\StateMachine\StateMachineInterface; use Sylius\Component\Core\Model\PaymentInterface; use Sylius\Component\Core\Model\PaymentMethodInterface; use Sylius\Component\Payment\PaymentTransitions; @@ -18,9 +18,8 @@ final class PaymentStateResolver implements PaymentStateResolverInterface { - public $stateMachineFactory; - public function __construct( + private StateMachineInterface $stateMachine, #[Autowire('@payplug_sylius_payplug_plugin.api_client.payplug')] private PayPlugApiClientInterface $payPlugApiClient, private EntityManagerInterface $paymentEntityManager, @@ -40,43 +39,38 @@ public function resolve(PaymentInterface $payment): void } $details = $payment->getDetails(); - if (!isset($details['payment_id'])) { return; } $gatewayConfig = $paymentMethod->getGatewayConfig()->getConfig(); - $this->payPlugApiClient->initialise($gatewayConfig['secretKey']); - - $paymentStateMachine = $this->stateMachineFactory->get($payment, PaymentTransitions::GRAPH); - $payment = $this->payPlugApiClient->retrieve((string) $details['payment_id']); switch (true) { case $payment->is_paid: - $this->applyTransition($paymentStateMachine, PaymentTransitions::TRANSITION_COMPLETE); + $this->applyTransition($payment, PaymentTransitions::TRANSITION_COMPLETE); break; case null !== $payment->failure: - $this->applyTransition($paymentStateMachine, PaymentTransitions::TRANSITION_FAIL); + $this->applyTransition($payment, PaymentTransitions::TRANSITION_FAIL); break; case $this->isAuthorized($payment): - $this->applyTransition($paymentStateMachine, PaymentTransitions::TRANSITION_AUTHORIZE); + $this->applyTransition($payment, PaymentTransitions::TRANSITION_AUTHORIZE); break; default: - $this->applyTransition($paymentStateMachine, PaymentTransitions::TRANSITION_PROCESS); + $this->applyTransition($payment, PaymentTransitions::TRANSITION_PROCESS); } $this->paymentEntityManager->flush(); } - private function applyTransition(StateMachineInterface $paymentStateMachine, string $transition): void + private function applyTransition(Payment $payment, string $transition): void { - if ($paymentStateMachine->can($transition)) { - $paymentStateMachine->apply($transition); + if ($this->stateMachine->can($payment, PaymentTransitions::GRAPH, $transition)) { + $this->stateMachine->apply($payment, PaymentTransitions::GRAPH, $transition); } } From d7b07886ac8238c941f9c96df5f01cb3215576e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jib=C3=A9=20Barth?= Date: Tue, 29 Apr 2025 10:01:55 +0200 Subject: [PATCH 022/112] chore(state_machine): Use StateMachineInterface from sylius on StatusAction And migrate winzou additional step to a symfony workflow one --- config/config.yml | 2 +- config/state_machine.yml | 13 ++++++++++--- src/Action/StatusAction.php | 10 ++++------ .../Transition/OrderPaymentTransitions.php | 8 ++++---- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/config/config.yml b/config/config.yml index fa2e0683..a106e595 100644 --- a/config/config.yml +++ b/config/config.yml @@ -1,5 +1,5 @@ imports: -# - { resource: "state_machine.yml" } + - { resource: "state_machine.yml" } - { resource: "resources.yaml" } # - { resource: "ui.yaml" } - { resource: "twig_hooks/*.yaml" } diff --git a/config/state_machine.yml b/config/state_machine.yml index 2181757b..2781aef2 100644 --- a/config/state_machine.yml +++ b/config/state_machine.yml @@ -1,3 +1,10 @@ -imports: - - { resource: "state_machine/sylius_payment.yml" } - - { resource: "state_machine/sylius_order_payment.yaml" } +framework: + workflows: + !php/const Sylius\Component\Core\OrderPaymentTransitions::GRAPH: + transitions: + oney_request_payment: # Allow to request payment from authorized (for Oney) + from: + - cart + - authorized + to: + - awaiting_payment diff --git a/src/Action/StatusAction.php b/src/Action/StatusAction.php index 7d43cb6c..e5a9d9bb 100644 --- a/src/Action/StatusAction.php +++ b/src/Action/StatusAction.php @@ -21,6 +21,7 @@ use Payum\Core\GatewayAwareTrait; use Payum\Core\Request\GetHttpRequest; use Payum\Core\Request\GetStatusInterface; +use Sylius\Abstraction\StateMachine\StateMachineInterface; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\Model\PaymentInterface; use Symfony\Component\DependencyInjection\Attribute\AsAlias; @@ -62,6 +63,7 @@ final class StatusAction implements ActionInterface, GatewayAwareInterface, ApiA use ApiAwareTrait; public function __construct( + private StateMachineInterface $stateMachine, private RefundPaymentHandlerInterface $refundPaymentHandler, private PaymentNotificationHandler $paymentNotificationHandler, private RequestStack $requestStack, @@ -177,14 +179,10 @@ private function markOrderPaymentAsAwaitingPayment($request): void /** @var OrderInterface $order */ $order = $payment->getOrder(); - $stateMachine = $this->stateMachineFactory->get($order, OrderPaymentTransitions::GRAPH); - - if (!$stateMachine->can(OrderPaymentTransitions::TRANSITION_REQUEST_PAYMENT)) { + if (!$this->stateMachine->can($order, OrderPaymentTransitions::GRAPH, OrderPaymentTransitions::TRANSITION_ONEY_REQUEST_PAYMENT)) { return; } - $this->stateMachineFactory - ->get($order, OrderPaymentTransitions::GRAPH) - ->apply(OrderPaymentTransitions::TRANSITION_REQUEST_PAYMENT); + $this->stateMachine->apply($order, OrderPaymentTransitions::GRAPH, OrderPaymentTransitions::TRANSITION_ONEY_REQUEST_PAYMENT); } } diff --git a/src/StateMachine/Transition/OrderPaymentTransitions.php b/src/StateMachine/Transition/OrderPaymentTransitions.php index 5ff74ed6..3711db32 100644 --- a/src/StateMachine/Transition/OrderPaymentTransitions.php +++ b/src/StateMachine/Transition/OrderPaymentTransitions.php @@ -4,9 +4,9 @@ namespace PayPlug\SyliusPayPlugPlugin\StateMachine\Transition; -interface OrderPaymentTransitions -{ - public const GRAPH = 'payplug_sylius_order_payment'; +use Sylius\Component\Core\OrderPaymentTransitions as BaseOrderPaymentTransitions; - public const TRANSITION_REQUEST_PAYMENT = 'request_payment'; +interface OrderPaymentTransitions extends BaseOrderPaymentTransitions +{ + public const TRANSITION_ONEY_REQUEST_PAYMENT = 'oney_request_payment'; } From 2e79dae219f6ceb26d8fc926ff87adb01e3a320b Mon Sep 17 00:00:00 2001 From: maxperei Date: Tue, 29 Apr 2025 10:08:52 +0200 Subject: [PATCH 023/112] fix(route): [path] missing `{paymentMethodId}` param in action initPaymentAction url --- src/Controller/IntegratedPaymentController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/IntegratedPaymentController.php b/src/Controller/IntegratedPaymentController.php index 8c60d622..e4dbf6f0 100644 --- a/src/Controller/IntegratedPaymentController.php +++ b/src/Controller/IntegratedPaymentController.php @@ -49,7 +49,7 @@ public function __construct( * * @see https://docs.payplug.com/api/integratedref.html#trigger-a-payment */ - #[Route(path: '/{_locale}/payplug/integrated-payment/init', name: 'payplug_sylius_integrated_payment_init', methods: ['GET', 'POST'])] + #[Route(path: '/{_locale}/payplug/integrated-payment/init/{paymentMethodId}', name: 'payplug_sylius_integrated_payment_init', methods: ['GET', 'POST'])] public function initPaymentAction(Request $request, int $paymentMethodId): Response { $paymentMethod = $this->paymentMethodRepository->find($paymentMethodId); From ff8ec3ea6a3bf5cae3dc03e08f64e42a23886a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jib=C3=A9=20Barth?= Date: Tue, 29 Apr 2025 10:25:19 +0200 Subject: [PATCH 024/112] chore(state_machine): Use StateMachineInterface from sylius on OrderController Remove the __construct call, use #[Required] attribute instead --- src/Controller/OrderController.php | 90 ++++++------------------------ 1 file changed, 16 insertions(+), 74 deletions(-) diff --git a/src/Controller/OrderController.php b/src/Controller/OrderController.php index f7c357bb..9423337d 100644 --- a/src/Controller/OrderController.php +++ b/src/Controller/OrderController.php @@ -4,24 +4,11 @@ namespace PayPlug\SyliusPayPlugPlugin\Controller; -use Doctrine\Persistence\ObjectManager; use PayPlug\SyliusPayPlugPlugin\Exception\Payment\PaymentNotCompletedException; use PayPlug\SyliusPayPlugPlugin\Provider\Payment\ApplePayPaymentProvider; use Psr\Log\LoggerInterface; +use Sylius\Abstraction\StateMachine\StateMachineInterface; use Sylius\Bundle\OrderBundle\Controller\OrderController as BaseOrderController; -use Sylius\Bundle\ResourceBundle\Controller\AuthorizationCheckerInterface; -use Sylius\Bundle\ResourceBundle\Controller\EventDispatcherInterface; -use Sylius\Bundle\ResourceBundle\Controller\FlashHelperInterface; -use Sylius\Bundle\ResourceBundle\Controller\NewResourceFactoryInterface; -use Sylius\Bundle\ResourceBundle\Controller\RedirectHandlerInterface; -use Sylius\Bundle\ResourceBundle\Controller\RequestConfigurationFactoryInterface; -use Sylius\Bundle\ResourceBundle\Controller\ResourceDeleteHandlerInterface; -use Sylius\Bundle\ResourceBundle\Controller\ResourceFormFactoryInterface; -use Sylius\Bundle\ResourceBundle\Controller\ResourcesCollectionProviderInterface; -use Sylius\Bundle\ResourceBundle\Controller\ResourceUpdateHandlerInterface; -use Sylius\Bundle\ResourceBundle\Controller\SingleResourceProviderInterface; -use Sylius\Bundle\ResourceBundle\Controller\StateMachineInterface; -use Sylius\Bundle\ResourceBundle\Controller\ViewHandlerInterface; use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\OrderCheckoutStates; @@ -29,9 +16,6 @@ use Sylius\Component\Core\OrderPaymentStates; use Sylius\Component\Payment\Model\PaymentInterface; use Sylius\Component\Resource\Exception\UpdateHandlingException; -use Sylius\Component\Resource\Factory\FactoryInterface; -use Sylius\Component\Resource\Metadata\MetadataInterface; -use Sylius\Component\Resource\Repository\RepositoryInterface; use Sylius\Component\Resource\ResourceActions; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; @@ -41,59 +25,24 @@ use Symfony\Component\Lock\LockFactory; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Core\Exception\AccessDeniedException; +use Symfony\Contracts\Service\Attribute\Required; use Webmozart\Assert\Assert; #[AsController] final class OrderController extends BaseOrderController { - public $stateMachineFactory; - private const APPLE_ERROR_RESPONSE_CODE = 0; private const APPLE_SUCCESS_RESPONSE_CODE = 1; - public function __construct( - MetadataInterface $metadata, - RequestConfigurationFactoryInterface $requestConfigurationFactory, - ?ViewHandlerInterface $viewHandler, - RepositoryInterface $repository, - FactoryInterface $factory, - NewResourceFactoryInterface $newResourceFactory, - ObjectManager $manager, - SingleResourceProviderInterface $singleResourceProvider, - ResourcesCollectionProviderInterface $resourcesFinder, - ResourceFormFactoryInterface $resourceFormFactory, - RedirectHandlerInterface $redirectHandler, - FlashHelperInterface $flashHelper, - AuthorizationCheckerInterface $authorizationChecker, - EventDispatcherInterface $eventDispatcher, - ?StateMachineInterface $stateMachine, - ResourceUpdateHandlerInterface $resourceUpdateHandler, - ResourceDeleteHandlerInterface $resourceDeleteHandler, - private ApplePayPaymentProvider $applePayPaymentProvider, - private LockFactory $lockFactory, - private LoggerInterface $logger, - ) { - parent::__construct( - $metadata, - $requestConfigurationFactory, - $viewHandler, - $repository, - $factory, - $newResourceFactory, - $manager, - $singleResourceProvider, - $resourcesFinder, - $resourceFormFactory, - $redirectHandler, - $flashHelper, - $authorizationChecker, - $eventDispatcher, - $stateMachine, - $resourceUpdateHandler, - $resourceDeleteHandler, - ); - } + #[Required] + private StateMachineInterface $stateMachineAbstraction; + #[Required] + private ApplePayPaymentProvider $applePayPaymentProvider; + #[Required] + private LockFactory $lockFactory; + #[Required] + private LoggerInterface $logger; #[Route( path: '/payplug/apple-pay/prepare/{orderId}', @@ -156,10 +105,8 @@ public function initiateApplePaySessionAction(Request $request): Response return $initializeEventResponse; } - $orderCheckoutStateMachine = $this->stateMachineFactory->get($resource, OrderCheckoutTransitions::GRAPH); - - if ($orderCheckoutStateMachine->can('select_payment')) { - $orderCheckoutStateMachine->apply('select_payment'); + if ($this->stateMachineAbstraction->can($resource, OrderCheckoutTransitions::GRAPH, OrderCheckoutTransitions::TRANSITION_SELECT_PAYMENT)) { + $this->stateMachineAbstraction->apply($resource, OrderCheckoutTransitions::GRAPH, OrderCheckoutTransitions::TRANSITION_SELECT_PAYMENT); } $payment = $this->applePayPaymentProvider->provide($request, $resource); @@ -297,10 +244,8 @@ public function confirmApplePayPaymentAction(Request $request): Response $order = $lastPayment->getOrder(); Assert::isInstanceOf($order, OrderInterface::class); - $orderCheckoutStateMachine = $this->stateMachineFactory->get($order, OrderCheckoutTransitions::GRAPH); - - if ($orderCheckoutStateMachine->can('complete')) { - $orderCheckoutStateMachine->apply('complete'); + if ($this->stateMachineAbstraction->can($order, OrderCheckoutTransitions::GRAPH, OrderCheckoutTransitions::TRANSITION_COMPLETE)) { + $this->stateMachineAbstraction->apply($order, OrderCheckoutTransitions::GRAPH, OrderCheckoutTransitions::TRANSITION_COMPLETE); } $this->manager->flush(); @@ -393,12 +338,9 @@ public function cancelApplePaySessionAction(Request $request): Response ]); } - $orderCheckoutStateMachine = $this->stateMachineFactory->get($resource, OrderCheckoutTransitions::GRAPH); - - if ($orderCheckoutStateMachine->can('select_shipping')) { - $orderCheckoutStateMachine->apply('select_shipping'); + if ($this->stateMachineAbstraction->can($resource, OrderCheckoutTransitions::GRAPH, OrderCheckoutTransitions::TRANSITION_SELECT_SHIPPING)) { + $this->stateMachineAbstraction->apply($resource, OrderCheckoutTransitions::GRAPH, OrderCheckoutTransitions::TRANSITION_SELECT_SHIPPING); } - $this->manager->flush(); $request->getSession()->getFlashBag()->add('error', 'sylius.payment.cancelled'); From 82e8feaf8f4e97ef369d5fb208a685f950be4cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jib=C3=A9=20Barth?= Date: Tue, 29 Apr 2025 10:27:47 +0200 Subject: [PATCH 025/112] chore(state_machine): Use StateMachineInterface from sylius on PostPaymentSelectEventSubscriber --- .../PostPaymentSelectEventSubscriber.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/EventSubscriber/PostPaymentSelectEventSubscriber.php b/src/EventSubscriber/PostPaymentSelectEventSubscriber.php index 4b8e2e68..9991e0b3 100644 --- a/src/EventSubscriber/PostPaymentSelectEventSubscriber.php +++ b/src/EventSubscriber/PostPaymentSelectEventSubscriber.php @@ -5,6 +5,7 @@ namespace PayPlug\SyliusPayPlugPlugin\EventSubscriber; use Doctrine\ORM\EntityManagerInterface; +use Sylius\Abstraction\StateMachine\StateMachineInterface; use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\Model\PaymentInterface; @@ -18,8 +19,6 @@ final class PostPaymentSelectEventSubscriber implements EventSubscriberInterface { - public $stateMachineFactory; - private const CHECKOUT_ROUTE = 'sylius_shop_checkout_select_payment'; private const UPDATE_ORDER_PAYMENT_ROUTE = 'sylius_shop_order_show'; @@ -29,7 +28,7 @@ final class PostPaymentSelectEventSubscriber implements EventSubscriberInterface public function __construct( private RequestStack $requestStack, private EntityManagerInterface $entityManager, - // private FactoryInterface $stateMachineFactory, + private StateMachineInterface $stateMachine, ) { } @@ -131,9 +130,8 @@ private function getToken(Request $request): string private function applyToComplete(OrderInterface $order): void { - $stateMachine = $this->stateMachineFactory->get($order, OrderCheckoutTransitions::GRAPH); - if ($stateMachine->can(OrderCheckoutTransitions::TRANSITION_COMPLETE)) { - $stateMachine->apply(OrderCheckoutTransitions::TRANSITION_COMPLETE); + if ($this->stateMachine->can($order, OrderCheckoutTransitions::GRAPH, OrderCheckoutTransitions::TRANSITION_COMPLETE)) { + $this->stateMachine->apply($order, OrderCheckoutTransitions::GRAPH, OrderCheckoutTransitions::TRANSITION_COMPLETE); } $this->entityManager->flush(); From 39bf580c4ee17bb4dd1bcc4a1a271293d75c2841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jib=C3=A9=20Barth?= Date: Tue, 29 Apr 2025 10:29:33 +0200 Subject: [PATCH 026/112] chore(state_machine): Use StateMachineInterface from sylius on OrderPaymentProcessor --- src/Processor/OrderPaymentProcessor.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Processor/OrderPaymentProcessor.php b/src/Processor/OrderPaymentProcessor.php index 716afe6b..f1d7721a 100644 --- a/src/Processor/OrderPaymentProcessor.php +++ b/src/Processor/OrderPaymentProcessor.php @@ -5,6 +5,7 @@ namespace PayPlug\SyliusPayPlugPlugin\Processor; use PayPlug\SyliusPayPlugPlugin\Gateway\ApplePayGatewayFactory; +use Sylius\Abstraction\StateMachine\StateMachineInterface; use Sylius\Bundle\PayumBundle\Model\GatewayConfigInterface; use Sylius\Component\Core\Model\PaymentInterface; use Sylius\Component\Core\Model\PaymentMethodInterface; @@ -18,11 +19,10 @@ #[AsDecorator('sylius.order_processing.order_payment_processor.checkout')] final class OrderPaymentProcessor implements OrderProcessorInterface { - public $stateMachineFactory; - public function __construct( #[AutowireDecorated] private OrderProcessorInterface $baseOrderPaymentProcessor, + private StateMachineInterface $stateMachine ) { } @@ -45,8 +45,7 @@ public function process(OrderInterface $order): void null !== $payment && ApplePayGatewayFactory::FACTORY_NAME !== $this->getFactoryName($payment) ) { - $stateMachine = $this->stateMachineFactory->get($payment, PaymentTransitions::GRAPH); - $stateMachine->apply(PaymentTransitions::TRANSITION_CANCEL); + $this->stateMachine->apply($payment, PaymentTransitions::GRAPH, PaymentTransitions::TRANSITION_CANCEL); } $this->baseOrderPaymentProcessor->process($order); From f9efa637036609b890c229cfa64ab7258c0561f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jib=C3=A9=20Barth?= Date: Tue, 29 Apr 2025 10:35:36 +0200 Subject: [PATCH 027/112] chore(state_machine): Use StateMachineInterface from sylius on RefundPaymentGeneratedHandler --- src/MessageHandler/RefundPaymentGeneratedHandler.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/MessageHandler/RefundPaymentGeneratedHandler.php b/src/MessageHandler/RefundPaymentGeneratedHandler.php index 5cc222e2..1a70a72d 100644 --- a/src/MessageHandler/RefundPaymentGeneratedHandler.php +++ b/src/MessageHandler/RefundPaymentGeneratedHandler.php @@ -18,6 +18,7 @@ use PayPlug\SyliusPayPlugPlugin\Repository\RefundHistoryRepositoryInterface; use Payum\Core\Model\GatewayConfigInterface; use Psr\Log\LoggerInterface; +use Sylius\Abstraction\StateMachine\StateMachineInterface; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\Model\PaymentInterface; use Sylius\Component\Core\Model\PaymentMethodInterface; @@ -35,14 +36,12 @@ final class RefundPaymentGeneratedHandler { - public $stateMachineFactory; - public function __construct( private EntityManagerInterface $entityManager, private PaymentRepositoryInterface $paymentRepository, private RepositoryInterface $refundPaymentRepository, private RefundHistoryRepositoryInterface $payplugRefundHistoryRepository, - // private FactoryInterface $stateMachineFactory, + private StateMachineInterface $stateMachine, private RefundPaymentProcessor $refundPaymentProcessor, private LoggerInterface $logger, private RequestStack $requestStack, @@ -84,8 +83,7 @@ public function __invoke(RefundPaymentGenerated $message): void ) { /** @var RefundPayment $refundPayment */ $refundPayment = $this->refundPaymentRepository->find($message->id()); - $stateMachine = $this->stateMachineFactory->get($refundPayment, RefundPaymentTransitions::GRAPH); - $stateMachine->apply(RefundPaymentTransitions::TRANSITION_COMPLETE); + $this->stateMachine->apply($refundPayment, RefundPaymentTransitions::GRAPH, RefundPaymentTransitions::TRANSITION_COMPLETE); $this->entityManager->flush(); $refundHistory->setProcessed(true); @@ -115,8 +113,7 @@ private function processRefund(PaymentInterface $payment, RefundPaymentGenerated /** @var RefundPayment $refundPayment */ $refundPayment = $this->refundPaymentRepository->find($message->id()); - $stateMachine = $this->stateMachineFactory->get($refundPayment, RefundPaymentTransitions::GRAPH); - $stateMachine->apply(RefundPaymentTransitions::TRANSITION_COMPLETE); + $this->stateMachine->apply($refundPayment, RefundPaymentTransitions::GRAPH, RefundPaymentTransitions::TRANSITION_COMPLETE); $this->entityManager->flush(); } From 087c4626a957bd10712c80033ffef08d0057a430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jib=C3=A9=20Barth?= Date: Tue, 29 Apr 2025 10:59:24 +0200 Subject: [PATCH 028/112] chore(state_machine): Update PaymentsProcessor to add a WorkflowEventComplete --- config/state_machine/sylius_payment.yml | 16 ---------------- src/PaymentProcessing/AbortPaymentProcessor.php | 14 ++++++++++++++ .../CaptureAuthorizedPaymentProcessor.php | 14 ++++++++++++++ src/PaymentProcessing/RefundPaymentProcessor.php | 14 ++++++++++++++ 4 files changed, 42 insertions(+), 16 deletions(-) delete mode 100644 config/state_machine/sylius_payment.yml diff --git a/config/state_machine/sylius_payment.yml b/config/state_machine/sylius_payment.yml deleted file mode 100644 index 7a335e8e..00000000 --- a/config/state_machine/sylius_payment.yml +++ /dev/null @@ -1,16 +0,0 @@ -winzou_state_machine: - sylius_payment: - callbacks: - before: - payplug_sylius_payplug_plugin_refund_process: - on: ["refund"] - do: ["@PayPlug\\SyliusPayPlugPlugin\\PaymentProcessing\\RefundPaymentHandler", "process"] - args: ["object"] - payplug_sylius_payplug_plugin_failed_process: - on: ["fail"] - do: ["@PayPlug\\SyliusPayPlugPlugin\\PaymentProcessing\\AbortPaymentProcessor", "process"] - args: ["object"] - payplug_sylius_payplug_plugin_complete: - on: ["complete"] - do: ["@PayPlug\\SyliusPayPlugPlugin\\PaymentProcessing\\CaptureAuthorizedPaymentProcessor", "process"] - args: ["object"] diff --git a/src/PaymentProcessing/AbortPaymentProcessor.php b/src/PaymentProcessing/AbortPaymentProcessor.php index d4e24ef3..60cf8d48 100644 --- a/src/PaymentProcessing/AbortPaymentProcessor.php +++ b/src/PaymentProcessing/AbortPaymentProcessor.php @@ -7,8 +7,11 @@ use Payplug\Exception\HttpException; use PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientInterface; use Sylius\Component\Core\Model\PaymentInterface; +use Sylius\Component\Payment\PaymentTransitions; use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; use Symfony\Component\DependencyInjection\Attribute\Autowire; +use Symfony\Component\Workflow\Attribute\AsCompletedListener; +use Symfony\Component\Workflow\Event\CompletedEvent; #[Autoconfigure(public: true)] class AbortPaymentProcessor @@ -19,6 +22,17 @@ public function __construct( ) { } + #[AsCompletedListener(workflow: PaymentTransitions::GRAPH, transition: PaymentTransitions::TRANSITION_FAIL)] + public function onFailedCompleteTransitionEvent(CompletedEvent $event): void + { + $subject = $event->getSubject(); + if (!$subject instanceof PaymentInterface) { + return; + } + + $this->process($subject); + } + public function process(PaymentInterface $payment): void { try { diff --git a/src/PaymentProcessing/CaptureAuthorizedPaymentProcessor.php b/src/PaymentProcessing/CaptureAuthorizedPaymentProcessor.php index 62dab965..09f66337 100644 --- a/src/PaymentProcessing/CaptureAuthorizedPaymentProcessor.php +++ b/src/PaymentProcessing/CaptureAuthorizedPaymentProcessor.php @@ -11,6 +11,9 @@ use Payum\Core\Bridge\Spl\ArrayObject; use Sylius\Component\Core\Model\PaymentInterface; use Sylius\Component\Core\Model\PaymentMethodInterface; +use Sylius\Component\Payment\PaymentTransitions; +use Symfony\Component\Workflow\Attribute\AsCompletedListener; +use Symfony\Component\Workflow\Event\CompletedEvent; final class CaptureAuthorizedPaymentProcessor { @@ -20,6 +23,17 @@ public function __construct( ) { } + #[AsCompletedListener(workflow: PaymentTransitions::GRAPH, transition: PaymentTransitions::TRANSITION_COMPLETE)] + public function onCompletePaymentTransitionEvent(CompletedEvent $event): void + { + $subject = $event->getSubject(); + if (!$subject instanceof PaymentInterface) { + return; + } + + $this->process($subject); + } + public function process(PaymentInterface $payment): void { $details = new ArrayObject($payment->getDetails()); diff --git a/src/PaymentProcessing/RefundPaymentProcessor.php b/src/PaymentProcessing/RefundPaymentProcessor.php index cd30e9c8..3525e7fb 100644 --- a/src/PaymentProcessing/RefundPaymentProcessor.php +++ b/src/PaymentProcessing/RefundPaymentProcessor.php @@ -17,12 +17,15 @@ use Psr\Log\LoggerInterface; use Sylius\Component\Core\Model\PaymentInterface; use Sylius\Component\Core\Model\PaymentMethodInterface; +use Sylius\Component\Payment\PaymentTransitions; use Sylius\Component\Resource\Exception\UpdateHandlingException; use Sylius\Component\Resource\Repository\RepositoryInterface; use Sylius\RefundPlugin\Entity\RefundPayment; use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\Workflow\Attribute\AsCompletedListener; +use Symfony\Component\Workflow\Event\CompletedEvent; use Symfony\Contracts\Translation\TranslatorInterface; #[Autoconfigure(public: true)] @@ -41,6 +44,17 @@ public function __construct( ) { } + #[AsCompletedListener(workflow: PaymentTransitions::GRAPH, transition: PaymentTransitions::TRANSITION_REFUND)] + public function onRefundCompleteTransitionEvent(CompletedEvent $event): void + { + $subject = $event->getSubject(); + if (!$subject instanceof PaymentInterface) { + return; + } + + $this->process($subject); + } + public function process(PaymentInterface $payment): void { $this->prepare($payment); From 992f0c683ed0c6376f3d3b152d077273e2475a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jib=C3=A9=20Barth?= Date: Tue, 29 Apr 2025 10:59:56 +0200 Subject: [PATCH 029/112] chore(state_machine): Clean old winzou state machine --- .../state_machine/sylius_order_payment.yaml | 51 ------------------- 1 file changed, 51 deletions(-) delete mode 100644 config/state_machine/sylius_order_payment.yaml diff --git a/config/state_machine/sylius_order_payment.yaml b/config/state_machine/sylius_order_payment.yaml deleted file mode 100644 index 9daf1f00..00000000 --- a/config/state_machine/sylius_order_payment.yaml +++ /dev/null @@ -1,51 +0,0 @@ -winzou_state_machine: - payplug_sylius_order_payment: - class: "%sylius.model.order.class%" - property_path: paymentState - graph: payplug_sylius_order_payment - state_machine_class: "%sylius.state_machine.class%" - states: - cart: ~ - awaiting_payment: ~ - partially_authorized: ~ - authorized: ~ - partially_paid: ~ - cancelled: ~ - paid: ~ - partially_refunded: ~ - refunded: ~ - transitions: - request_payment: - from: [ cart, authorized ] - to: awaiting_payment - partially_authorize: - from: [ awaiting_payment, partially_authorized ] - to: partially_authorized - authorize: - from: [ awaiting_payment, partially_authorized ] - to: authorized - partially_pay: - from: [ awaiting_payment, partially_paid, partially_authorized ] - to: partially_paid - cancel: - from: [ awaiting_payment, authorized, partially_authorized ] - to: cancelled - pay: - from: [ awaiting_payment, partially_paid, authorized ] - to: paid - partially_refund: - from: [ paid, partially_paid, partially_refunded ] - to: partially_refunded - refund: - from: [ paid, partially_paid, partially_refunded ] - to: refunded - callbacks: - after: - sylius_order_paid: - on: [ "pay" ] - do: [ "@sylius.inventory.order_inventory_operator", "sell" ] - args: [ "object" ] - sylius_resolve_state: - on: [ "pay" ] - do: [ "@sylius.state_resolver.order", "resolve" ] - args: [ "object" ] From e6b2a3a77c103c43082add3b437235dedbe2ece0 Mon Sep 17 00:00:00 2001 From: Thomas VERMOT-GAUCHY Date: Tue, 29 Apr 2025 11:15:43 +0200 Subject: [PATCH 030/112] PPSYL-136 - sylius v2 - Checkout payment - Integrated - Fix js --- .../integrated-payment_controller.js | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/assets/shop/controllers/integrated-payment_controller.js b/assets/shop/controllers/integrated-payment_controller.js index f1dced3a..bad8e389 100644 --- a/assets/shop/controllers/integrated-payment_controller.js +++ b/assets/shop/controllers/integrated-payment_controller.js @@ -114,41 +114,39 @@ export default class extends Controller { } load() { - // TODO: integratedPaymentApi??? - const integratedPaymentApi = new Payplug.IntegratedPayment(payplug_integrated_payment_params.is_test_mode); - this.options.api = integratedPaymentApi; // = new Payplug.IntegratedPayment(payplug_integrated_payment_params.is_test_mode); + this.options.api = new Payplug.IntegratedPayment(payplug_integrated_payment_params.is_test_mode); - integratedPaymentApi.setDisplayMode3ds(Payplug.DisplayMode3ds.LIGHTBOX); + this.options.api.setDisplayMode3ds(Payplug.DisplayMode3ds.LIGHTBOX); - this.options.form.cardHolder = integratedPaymentApi.cardHolder( + this.options.form.cardHolder = this.options.api.cardHolder( document.querySelector('.cardHolder-input-container'), { default: this.options.inputStyle.default, placeholder: payplug_integrated_payment_params.cardholder } ); - this.options.form.pan = integratedPaymentApi.cardNumber( + this.options.form.pan = this.options.api.cardNumber( document.querySelector('.pan-input-container'), { default: this.options.inputStyle.default, placeholder: payplug_integrated_payment_params.pan } ); - this.options.form.cvv = integratedPaymentApi.cvv( + this.options.form.cvv = this.options.api.cvv( document.querySelector('.cvv-input-container'), { default: this.options.inputStyle.default, placeholder: payplug_integrated_payment_params.cvv } ); - this.options.form.exp = integratedPaymentApi.expiration( + this.options.form.exp = this.options.api.expiration( document.querySelector('.exp-input-container'), { default: this.options.inputStyle.default, placeholder: payplug_integrated_payment_params.exp } ); - this.options.schemes = integratedPaymentApi.getSupportedSchemes(); + this.options.schemes = this.options.api.getSupportedSchemes(); this.bindEvents(); this.fieldValidation(); } @@ -157,9 +155,9 @@ export default class extends Controller { document.querySelector('#paid').addEventListener('click', (event) => { event.preventDefault(); - this.options.api.validateForm(); // integratedPaymentApi.validateForm(); + this.options.api.validateForm(); }); - this.options.api.onValidateForm(async (aaa) => { // integratedPaymentApi.onValidateForm(async ({isFormValid}) => { + this.options.api.onValidateForm(async (aaa) => { const {isFormValid} = aaa; if (isFormValid) { this.toggleLoader(); @@ -173,21 +171,21 @@ export default class extends Controller { this.options.scheme = chosenScheme.value; } if (payplug_integrated_payment_params.payment_id !== undefined) { - integratedPaymentApi.pay(payplug_integrated_payment_params.payment_id, this.options.scheme, {save_card: this.options.save_card}); + this.options.api.pay(payplug_integrated_payment_params.payment_id, this.options.scheme, {save_card: this.options.save_card}); return; } const response = await fetch(payplug_integrated_payment_params.routes.init_payment, {method: 'POST'}); const data = await response.json(); - this.options.api.pay(data.payment_id, this.options.scheme, {save_card: this.options.save_card}); // integratedPaymentApi.pay(data.payment_id, this.options.scheme, {save_card: this.options.save_card}); + this.options.api.pay(data.payment_id, this.options.scheme, {save_card: this.options.save_card}); } }); - this.options.api.onCompleted((event) => { // integratedPaymentApi.onCompleted((event) => { + this.options.api.onCompleted((event) => { if (event.error) { console.error(event.error); return; } document.querySelector('input[name=payplug_integrated_payment_token]').value = event.token; - document.querySelector('form[name=sylius_checkout_select_payment]').submit(); + document.querySelector('form[name=sylius_shop_checkout_select_payment]').submit(); }); } From 4d5ba5a9d901574865b0fc2b221a22084e261d0c Mon Sep 17 00:00:00 2001 From: Thomas VERMOT-GAUCHY Date: Tue, 29 Apr 2025 14:04:48 +0200 Subject: [PATCH 031/112] PPSYL-136 - sylius v2 - Checkout payment - Oney integration --- assets/package.json | 6 + .../controllers/oney-payment_controller.js | 140 ++++++++++++++++++ .../_payplug_oney_block.html.twig | 9 +- ...lius_checkout_select_payment_row.html.twig | 5 +- 4 files changed, 153 insertions(+), 7 deletions(-) create mode 100644 assets/shop/controllers/oney-payment_controller.js diff --git a/assets/package.json b/assets/package.json index f19b4552..1b184c6d 100644 --- a/assets/package.json +++ b/assets/package.json @@ -30,6 +30,12 @@ "webpackMode": "lazy", "fetch": "lazy", "enabled": true + }, + "oney-payment": { + "main": "shop/controllers/oney-payment_controller.js", + "webpackMode": "lazy", + "fetch": "lazy", + "enabled": true } } }, diff --git a/assets/shop/controllers/oney-payment_controller.js b/assets/shop/controllers/oney-payment_controller.js new file mode 100644 index 00000000..3bd8c278 --- /dev/null +++ b/assets/shop/controllers/oney-payment_controller.js @@ -0,0 +1,140 @@ +import { Controller } from '@hotwired/stimulus'; +import $ from 'jquery'; + +export default class extends Controller { + connect() { + this.options = { + trigger: '.payment-method-choice', + completeInfo: { + modal: '.oney-complete-info-popin', + area: '.ui.grid', + }, + }; + + this.toggleGateway(); + if (typeof completeInfoRoute !== 'undefined') { + this.modalAppear(); + } + + this.tabs(); + window.addEventListener('resize', () => { + setTimeout(this.tabs, 100); + }); + + this.tabsHandler(); + + const form = document.querySelector('form[name="sylius_shop_checkout_select_payment"]'); + form.addEventListener('submit', (event) => { + this.handleForm(); + }); + } + + toggleGateway() { + const paymentMethodSelector = $(this.options.trigger); + const paymentMethodInputId = paymentMethodSelector.data('payment-input-id'); + const checkedPaymentMethodInput = $(`#${paymentMethodInputId}:checked`); + + if (checkedPaymentMethodInput.length) { + $(`.payment-method-choice[data-payment-input-id="${paymentMethodInputId}"]`).show(); + } + + //document.querySelectorAll('input[id*="sylius_shop_checkout_select_payment_payments"]').addEventListener('change', (event) => {alert('change!')}); + const $inputs = $('input[id*=sylius_shop_checkout_select_payment_payments]'); + $inputs.on('change', (event) => { + const clickedPaymentMethodId = $(event.currentTarget).attr('id'); + $('.payment-method-choice').slideUp(); // Hide others + $(`.payment-method-choice[data-payment-input-id="${clickedPaymentMethodId}"]`).slideDown(); // Show current + }); + } + + tabs() { + if (window.innerWidth <= 991) { + $('.oney-payment-choice__item').hide(); + setTimeout(() => { + $.each($('.oney-payment-choice__input'), (k, el) => { + if ($(el).is(':checked')) { + $(el).parent().show(); + $(`a.tablink[data-id=${$(el).val()}]`).addClass('active'); + } + }); + }, 1); + } else { + $('.oney-payment-choice__item').show(); + $('a.tablink').removeClass('active'); + } + } + tabsHandler() { + const $tabLinks = $('a.tablink'); + $.each($tabLinks, (k, el) => { + $(el).click(function (evt) { + $('a.tablink').removeClass('active'); + $(this).addClass('active'); + $('.oney-payment-choice__item').hide(); + $(`#${$(this).data('id')}`).show(); + $(`input[value=${$(this).data('id')}`).prop('checked', true); + }); + }); + } + + modalAppear() { + const self = this; + let path = completeInfoRoute; + $.get(path).then((data) => { + $('body .pusher').append('
'); + $(self.options.completeInfo.area).addClass("inactive"); + $(self.options.completeInfo.area).parent().append(data); + self.modalEvents(); + }); + } + modalFadeaway() { + $(this.options.completeInfo.modal).fadeOut(300, () => { + $(this.options.completeInfo.area).removeClass('inactive'); + $('.overlay').hide(); + }); + } + modalSubmit(evt) { + const self = this; + evt.preventDefault(); + $(evt.currentTarget).addClass('loading'); + + $.ajax({ + method: 'post', + url: completeInfoRoute, + data: $(evt.currentTarget).serialize(), + success: function (res) { + if (Array.isArray(res)) { + $(`${self.options.completeInfo.modal}__content`).fadeOut(() => { + $(`${self.options.completeInfo.modal}__success`).show(); + }); + setTimeout(() => { + self.modalFadeaway(); + }, 2500); + } else { + $(self.options.completeInfo.modal).html(res); + } + self.modalEvents(); + }, + error: function (res) { + console.log(res); + }, + }); + } + modalEvents() { + $('.close').on('click', () => { + this.modalFadeaway(); + }); + $('form[name=form]').on('submit', (e) => { + this.modalSubmit(e); + }); + } + handleForm() { + if ($('.checkbox-oney :radio:checked').length) { + $('.checkbox-payplug').closest('.payment-item').find('.payment-choice__input:checked').prop('checked', false); + } else if ($('.checkbox-payplug :radio:checked').length) { + $('.checkbox-oney').closest('.payment-item').find('.payment-choice__input:checked').prop('checked', false); + } + + $('input#payplug_choice_card_other').attr('disabled', true); + $('form[name="sylius_shop_checkout_select_payment_payments"]').submit(); // old id: sylius_checkout_select_payment + } +} diff --git a/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_oney_block.html.twig b/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_oney_block.html.twig index 985b4be0..894d0498 100644 --- a/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_oney_block.html.twig +++ b/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_oney_block.html.twig @@ -12,7 +12,7 @@ {% set showOney = true %} {% endif %} -
+
{% if factoryName == oneyFactoryName %} {% if showOney %} - {# TODO: Remove that. It is in another hook -
- {{ form_row(form.parent.parent.oney_payment_choice) }} -
#} +
+ {{ form_row(form.parent.parent.oney_payment_choice) }} +
{% if app.session is not null and app.session.get('oney_has_error') == true %} {# TODO: Move that in controller?#} - -
-
-
+
+
+ {{ 'sylius.ui.loading'|trans }}
@@ -41,15 +43,15 @@
{{ 'payplug_sylius_payplug_plugin.ui.integrated_payment.scheme.label'|trans }}
@@ -110,11 +112,8 @@
- - - From 9dcfe62249e6a2acf52a4e5bf7c327cc493bf6b5 Mon Sep 17 00:00:00 2001 From: maxperei Date: Tue, 24 Jun 2025 09:07:43 +0200 Subject: [PATCH 049/112] fix(checkout): [storefront] rework select payment --- assets/admin/payment_method/index.scss | 8 - assets/package.json | 8 +- assets/shop/account/index.scss | 105 ----- .../checkout-select-payment_controller.js | 48 +++ .../integrated-payment_controller.js | 32 +- .../controllers/oney-payment_controller.js | 38 +- .../controllers/oney-popin_controller.js} | 0 .../controllers/payment-logo_controller.js | 1 + .../shop => shop/dist}/oney_common/index.css | 0 .../shop => shop/dist}/oney_popin/index.css | 0 .../dist}/payment/account.039342ad.svg | 0 .../dist}/payment/calendar.3c23bb16.svg | 0 .../dist}/payment/card.0d2bd9bc.svg | 0 .../dist}/payment/cb-dark.888aec45.svg | 0 .../dist}/payment/cb.ccd964e9.svg | 0 .../shop => shop/dist}/payment/integrated.css | 0 .../dist}/payment/lock.fe8a73cd.svg | 0 .../payment/mastercard-dark.8977e440.svg | 0 .../dist}/payment/mastercard.7dd4ce0b.svg | 0 .../dist}/payment/visa-dark.87c34e0f.svg | 0 .../dist}/payment/visa.d11a46f6.svg | 0 assets/shop/oney_common/index.js | 5 - assets/shop/oney_common/index.scss | 52 --- assets/shop/payment/index.scss | 360 ------------------ config/twig_hooks/shop.yaml | 37 +- public/assets/admin/payment_method/index.css | 1 - public/assets/shop/account/index.css | 1 - public/assets/shop/oney_cart/index.js | 1 - public/assets/shop/oney_common/index.css | 1 - public/assets/shop/oney_common/index.js | 1 - public/assets/shop/oney_popin/index.css | 1 - public/assets/shop/oney_popin/index.js | 1 - public/assets/shop/payment/index.css | 1 - public/assets/shop/payment/index.js | 1 - public/assets/shop/payment/integrated.js | 1 - src/Controller/CardController.php | 5 +- src/Controller/OneySimulationPopin.php | 4 +- src/Controller/OrderController.php | 3 + src/Processor/OrderPaymentProcessor.php | 2 +- .../Payment/ApplePayPaymentProvider.php | 6 +- .../SavedCards/Index/_header.html.twig | 4 - .../Order/Show/_payment.html.twig | 43 --- .../SelectPayment/_navigation.html.twig | 17 - .../SyliusShopBundle/Order/show.html.twig | 6 - .../Modal/_confirmation.html.twig | 26 -- ...lius_checkout_select_payment_row.html.twig | 10 +- .../select_payment/payment/choice.html.twig | 14 + .../integrated/index.html.twig} | 1 + .../oney/cart/pay_with_oney.html.twig | 0 templates/{ => shop}/oney/popin.html.twig | 0 .../oney/product/pay_with_oney.html.twig | 0 .../saved_cards}/index.html.twig | 2 +- .../shop/saved_cards/index/_header.html.twig | 4 + .../saved_cards/index}/_subcontent.html.twig | 35 +- .../saved_cards}/layout.html.twig | 0 .../_american_express.html.twig} | 0 .../select_payment/_apple_pay.html.twig} | 0 .../select_payment/_bancontact.html.twig} | 0 .../select_payment/_oney.html.twig} | 0 .../select_payment/_payplug.html.twig} | 2 +- .../select_payment/choice.html.twig} | 1 - 61 files changed, 153 insertions(+), 736 deletions(-) delete mode 100644 assets/admin/payment_method/index.scss delete mode 100644 assets/shop/account/index.scss create mode 100644 assets/shop/controllers/checkout-select-payment_controller.js rename assets/{controllers/oney/popin_controller.js => shop/controllers/oney-popin_controller.js} (100%) rename assets/{dist/shop => shop/dist}/oney_common/index.css (100%) rename assets/{dist/shop => shop/dist}/oney_popin/index.css (100%) rename assets/{dist/shop => shop/dist}/payment/account.039342ad.svg (100%) rename assets/{dist/shop => shop/dist}/payment/calendar.3c23bb16.svg (100%) rename assets/{dist/shop => shop/dist}/payment/card.0d2bd9bc.svg (100%) rename assets/{dist/shop => shop/dist}/payment/cb-dark.888aec45.svg (100%) rename assets/{dist/shop => shop/dist}/payment/cb.ccd964e9.svg (100%) rename assets/{dist/shop => shop/dist}/payment/integrated.css (100%) rename assets/{dist/shop => shop/dist}/payment/lock.fe8a73cd.svg (100%) rename assets/{dist/shop => shop/dist}/payment/mastercard-dark.8977e440.svg (100%) rename assets/{dist/shop => shop/dist}/payment/mastercard.7dd4ce0b.svg (100%) rename assets/{dist/shop => shop/dist}/payment/visa-dark.87c34e0f.svg (100%) rename assets/{dist/shop => shop/dist}/payment/visa.d11a46f6.svg (100%) delete mode 100644 assets/shop/oney_common/index.js delete mode 100644 assets/shop/oney_common/index.scss delete mode 100644 assets/shop/payment/index.scss delete mode 100644 public/assets/admin/payment_method/index.css delete mode 100644 public/assets/shop/account/index.css delete mode 100644 public/assets/shop/oney_cart/index.js delete mode 100644 public/assets/shop/oney_common/index.css delete mode 100644 public/assets/shop/oney_common/index.js delete mode 100644 public/assets/shop/oney_popin/index.css delete mode 100644 public/assets/shop/oney_popin/index.js delete mode 100644 public/assets/shop/payment/index.css delete mode 100644 public/assets/shop/payment/index.js delete mode 100644 public/assets/shop/payment/integrated.js delete mode 100644 templates/Account/SavedCards/Index/_header.html.twig delete mode 100644 templates/SyliusAdminBundle/Order/Show/_payment.html.twig delete mode 100644 templates/SyliusShopBundle/Checkout/SelectPayment/_navigation.html.twig delete mode 100644 templates/SyliusShopBundle/Order/show.html.twig delete mode 100644 templates/SyliusUiBundle/Modal/_confirmation.html.twig create mode 100644 templates/shared/form/select_payment/payment/choice.html.twig rename templates/{form/integrated.html.twig => shop/integrated/index.html.twig} (98%) rename templates/{ => shop}/oney/cart/pay_with_oney.html.twig (100%) rename templates/{ => shop}/oney/popin.html.twig (100%) rename templates/{ => shop}/oney/product/pay_with_oney.html.twig (100%) rename templates/{card => shop/saved_cards}/index.html.twig (83%) create mode 100644 templates/shop/saved_cards/index/_header.html.twig rename templates/{Account/SavedCards/Index => shop/saved_cards/index}/_subcontent.html.twig (79%) rename templates/{card => shop/saved_cards}/layout.html.twig (100%) rename templates/{SyliusShopBundle/Checkout/SelectPayment/_payplug_american_express_block.html.twig => shop/select_payment/_american_express.html.twig} (100%) rename templates/{SyliusShopBundle/Checkout/SelectPayment/_payplug_apple_pay_block.html.twig => shop/select_payment/_apple_pay.html.twig} (100%) rename templates/{SyliusShopBundle/Checkout/SelectPayment/_payplug_bancontact_block.html.twig => shop/select_payment/_bancontact.html.twig} (100%) rename templates/{SyliusShopBundle/Checkout/SelectPayment/_payplug_oney_block.html.twig => shop/select_payment/_oney.html.twig} (100%) rename templates/{SyliusShopBundle/Checkout/SelectPayment/_payplug_block.html.twig => shop/select_payment/_payplug.html.twig} (94%) rename templates/{SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig => shop/select_payment/choice.html.twig} (99%) diff --git a/assets/admin/payment_method/index.scss b/assets/admin/payment_method/index.scss deleted file mode 100644 index 9f3cf3a1..00000000 --- a/assets/admin/payment_method/index.scss +++ /dev/null @@ -1,8 +0,0 @@ -.ui.label > a { - opacity: 1; - color: black; - - &:hover { - text-decoration: underline; - } -} \ No newline at end of file diff --git a/assets/package.json b/assets/package.json index c0017cee..fc4dca94 100644 --- a/assets/package.json +++ b/assets/package.json @@ -16,7 +16,7 @@ "symfony": { "controllers": { "oney-popin": { - "main": "controllers/oney/popin_controller.js", + "main": "shop/controllers/oney-popin_controller.js", "enabled": true, "webpackMode": "lazy", "fetch": "lazy", @@ -45,6 +45,12 @@ "webpackMode": "lazy", "fetch": "lazy", "enabled": true + }, + "checkout-select-payment": { + "main": "shop/controllers/checkout-select-payment_controller.js", + "webpackMode": "lazy", + "fetch": "lazy", + "enabled": true } } }, diff --git a/assets/shop/account/index.scss b/assets/shop/account/index.scss deleted file mode 100644 index 444367f6..00000000 --- a/assets/shop/account/index.scss +++ /dev/null @@ -1,105 +0,0 @@ -@import "../../settings/constants.scss"; - -.sylius-customer-account-saved-cards-grid { - .ui { - &.table { - td { - span { - &.expired { - color: $red; - } - } - } - } - } -} - - -@media screen and (max-width: 767px) { - .ui { - &.segment { - &.sylius-customer-account-saved-cards-grid { - -webkit-box-shadow: none; - box-shadow: none; - background: none; - border: 0; - padding: 0; - } - } - - &.basic { - &.table { - tbody { - tr { - position: relative; - background: #fff; - -webkit-box-shadow: 0 1px 2px 0 rgb(34, 36, 38, 0.15) !important; - box-shadow: 0 1px 2px 0 rgb(34, 36, 38, 0.15) !important; - margin: 1rem 0 2rem 0; - padding: 1em; - border-radius: .28571429rem; - border: 1px solid rgba($darkgrey, 0.26); - - &:first-child { - margin-top: 0; - } - - &:last-child { - margin-bottom: 0; - } - } - } - } - } - } - - .sylius-customer-account-saved-cards-grid { - .ui { - &.table { - td { - &:before { - content: attr(data-label); - float: left; - font-weight: bold; - } - - &[data-label] { - > span { - margin-left: 3px; - } - } - } - - &:not(.unstackable) { - thead { - border: none; - clip: rect(0 0 0 0); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; - } - - tr { - > td { - display: block; - font-weight: normal; - - &.actions { - text-align: right; - margin-top: 1rem; - } - } - - > th, - > td { - padding: 0 !important; - } - } - } - } - } - } -} diff --git a/assets/shop/controllers/checkout-select-payment_controller.js b/assets/shop/controllers/checkout-select-payment_controller.js new file mode 100644 index 00000000..7a029f4c --- /dev/null +++ b/assets/shop/controllers/checkout-select-payment_controller.js @@ -0,0 +1,48 @@ +import { Controller } from '@hotwired/stimulus'; +import $ from 'jquery'; + +/* stimulusFetch: 'lazy' */ +export default class extends Controller { + static targets = ['trigger']; + + connect() { + this.toggleGateway(); + + const form = document.querySelector('form[name="sylius_shop_checkout_select_payment"]'); + form.addEventListener('submit', (event) => { + this.handleForm(); + }); + } + toggleGateway() { + let checkedPaymentMethodInput; + + $(this.triggerTargets).each((k, v) => { + const paymentMethodInputId = $(v).data('payment-input-id'); + checkedPaymentMethodInput = $(`#${paymentMethodInputId}:checked`); + if (checkedPaymentMethodInput.length) { + return false; + } + }) + + if (checkedPaymentMethodInput.length) { + $(`.payment-method-choice[data-payment-input-id="${$(checkedPaymentMethodInput).attr('id')}"]`).show(); + } + + const $inputs = $('input[id*=sylius_shop_checkout_select_payment_payments]'); + $inputs.on('change', (event) => { + const clickedPaymentMethodId = $(event.currentTarget).attr('id'); + $('.payment-method-choice').slideUp(); // Hide others + $(`.payment-method-choice[data-payment-input-id="${clickedPaymentMethodId}"]`).slideDown(); // Show current + }); + } + handleForm() { + if ($('.checkbox-oney :radio:checked').length) { + $('.checkbox-payplug').closest('.payment-item').find('.payment-choice__input:checked').prop('checked', false); + } else if ($('.checkbox-payplug :radio:checked').length) { + $('.checkbox-oney').closest('.payment-item').find('.payment-choice__input:checked').prop('checked', false); + } + + $('input#payplug_choice_card_other').attr('disabled', true); + $('form[name="sylius_shop_checkout_select_payment_payments"]').submit(); + } +} diff --git a/assets/shop/controllers/integrated-payment_controller.js b/assets/shop/controllers/integrated-payment_controller.js index 22b0b4e3..a3392cd7 100644 --- a/assets/shop/controllers/integrated-payment_controller.js +++ b/assets/shop/controllers/integrated-payment_controller.js @@ -1,6 +1,7 @@ import { Controller } from '@hotwired/stimulus'; import WebFont from 'webfontloader'; +/* stimulusFetch: 'lazy' */ export default class extends Controller { static values = { code: String, @@ -59,26 +60,25 @@ export default class extends Controller { } if (payplug_integrated_payment_params.has_saved_cards) { - document.querySelectorAll('.payment-choice__input, .payment-item input[type=radio]:not([name=schemeOptions])') - .forEach((element) => { - element.addEventListener('change', (e) => { // TODO: function - if ( - 'payplug_choice_card_other' === e.currentTarget.id - && e.currentTarget.checked - || e.target.value === payplug_integrated_payment_params.payment_method_code - && document.querySelector('#payplug_choice_card_other').checked - ) { - this.openFields(); // TODO: this.openFields() - return; - } - this.closeFields(); - }) + document.querySelectorAll('.payment-choice__input, .payment-item input[type=radio]:not([name=schemeOptions])').forEach((element) => { + element.addEventListener('change', (e) => { + if ( + 'payplug_choice_card_other' === e.currentTarget.id && + e.currentTarget.checked || + e.target.value === payplug_integrated_payment_params.payment_method_code && + document.querySelector('#payplug_choice_card_other').checked + ) { + this.openFields(); + return; + } + this.closeFields(); }) + }) return; } - const paplugIsChecked = this.getPaymentMethodSelectors({ methodCode: payplug_integrated_payment_params.payment_method_code, checked: true }); - if (paplugIsChecked.length) { + const isChecked = this.getPaymentMethodSelectors({ methodCode: payplug_integrated_payment_params.payment_method_code, checked: true }); + if (isChecked.length) { this.openFields(); } diff --git a/assets/shop/controllers/oney-payment_controller.js b/assets/shop/controllers/oney-payment_controller.js index 3bd8c278..f577e39f 100644 --- a/assets/shop/controllers/oney-payment_controller.js +++ b/assets/shop/controllers/oney-payment_controller.js @@ -1,17 +1,16 @@ import { Controller } from '@hotwired/stimulus'; import $ from 'jquery'; +/* stimulusFetch: 'lazy' */ export default class extends Controller { connect() { this.options = { - trigger: '.payment-method-choice', completeInfo: { modal: '.oney-complete-info-popin', area: '.ui.grid', }, }; - this.toggleGateway(); if (typeof completeInfoRoute !== 'undefined') { this.modalAppear(); } @@ -22,31 +21,7 @@ export default class extends Controller { }); this.tabsHandler(); - - const form = document.querySelector('form[name="sylius_shop_checkout_select_payment"]'); - form.addEventListener('submit', (event) => { - this.handleForm(); - }); } - - toggleGateway() { - const paymentMethodSelector = $(this.options.trigger); - const paymentMethodInputId = paymentMethodSelector.data('payment-input-id'); - const checkedPaymentMethodInput = $(`#${paymentMethodInputId}:checked`); - - if (checkedPaymentMethodInput.length) { - $(`.payment-method-choice[data-payment-input-id="${paymentMethodInputId}"]`).show(); - } - - //document.querySelectorAll('input[id*="sylius_shop_checkout_select_payment_payments"]').addEventListener('change', (event) => {alert('change!')}); - const $inputs = $('input[id*=sylius_shop_checkout_select_payment_payments]'); - $inputs.on('change', (event) => { - const clickedPaymentMethodId = $(event.currentTarget).attr('id'); - $('.payment-method-choice').slideUp(); // Hide others - $(`.payment-method-choice[data-payment-input-id="${clickedPaymentMethodId}"]`).slideDown(); // Show current - }); - } - tabs() { if (window.innerWidth <= 991) { $('.oney-payment-choice__item').hide(); @@ -75,7 +50,6 @@ export default class extends Controller { }); }); } - modalAppear() { const self = this; let path = completeInfoRoute; @@ -127,14 +101,4 @@ export default class extends Controller { this.modalSubmit(e); }); } - handleForm() { - if ($('.checkbox-oney :radio:checked').length) { - $('.checkbox-payplug').closest('.payment-item').find('.payment-choice__input:checked').prop('checked', false); - } else if ($('.checkbox-payplug :radio:checked').length) { - $('.checkbox-oney').closest('.payment-item').find('.payment-choice__input:checked').prop('checked', false); - } - - $('input#payplug_choice_card_other').attr('disabled', true); - $('form[name="sylius_shop_checkout_select_payment_payments"]').submit(); // old id: sylius_checkout_select_payment - } } diff --git a/assets/controllers/oney/popin_controller.js b/assets/shop/controllers/oney-popin_controller.js similarity index 100% rename from assets/controllers/oney/popin_controller.js rename to assets/shop/controllers/oney-popin_controller.js diff --git a/assets/shop/controllers/payment-logo_controller.js b/assets/shop/controllers/payment-logo_controller.js index 4314b433..486cb375 100644 --- a/assets/shop/controllers/payment-logo_controller.js +++ b/assets/shop/controllers/payment-logo_controller.js @@ -1,6 +1,7 @@ import { Controller } from '@hotwired/stimulus'; import $ from 'jquery'; +/* stimulusFetch: 'lazy' */ export default class extends Controller { static values = { inputId: String, diff --git a/assets/dist/shop/oney_common/index.css b/assets/shop/dist/oney_common/index.css similarity index 100% rename from assets/dist/shop/oney_common/index.css rename to assets/shop/dist/oney_common/index.css diff --git a/assets/dist/shop/oney_popin/index.css b/assets/shop/dist/oney_popin/index.css similarity index 100% rename from assets/dist/shop/oney_popin/index.css rename to assets/shop/dist/oney_popin/index.css diff --git a/assets/dist/shop/payment/account.039342ad.svg b/assets/shop/dist/payment/account.039342ad.svg similarity index 100% rename from assets/dist/shop/payment/account.039342ad.svg rename to assets/shop/dist/payment/account.039342ad.svg diff --git a/assets/dist/shop/payment/calendar.3c23bb16.svg b/assets/shop/dist/payment/calendar.3c23bb16.svg similarity index 100% rename from assets/dist/shop/payment/calendar.3c23bb16.svg rename to assets/shop/dist/payment/calendar.3c23bb16.svg diff --git a/assets/dist/shop/payment/card.0d2bd9bc.svg b/assets/shop/dist/payment/card.0d2bd9bc.svg similarity index 100% rename from assets/dist/shop/payment/card.0d2bd9bc.svg rename to assets/shop/dist/payment/card.0d2bd9bc.svg diff --git a/assets/dist/shop/payment/cb-dark.888aec45.svg b/assets/shop/dist/payment/cb-dark.888aec45.svg similarity index 100% rename from assets/dist/shop/payment/cb-dark.888aec45.svg rename to assets/shop/dist/payment/cb-dark.888aec45.svg diff --git a/assets/dist/shop/payment/cb.ccd964e9.svg b/assets/shop/dist/payment/cb.ccd964e9.svg similarity index 100% rename from assets/dist/shop/payment/cb.ccd964e9.svg rename to assets/shop/dist/payment/cb.ccd964e9.svg diff --git a/assets/dist/shop/payment/integrated.css b/assets/shop/dist/payment/integrated.css similarity index 100% rename from assets/dist/shop/payment/integrated.css rename to assets/shop/dist/payment/integrated.css diff --git a/assets/dist/shop/payment/lock.fe8a73cd.svg b/assets/shop/dist/payment/lock.fe8a73cd.svg similarity index 100% rename from assets/dist/shop/payment/lock.fe8a73cd.svg rename to assets/shop/dist/payment/lock.fe8a73cd.svg diff --git a/assets/dist/shop/payment/mastercard-dark.8977e440.svg b/assets/shop/dist/payment/mastercard-dark.8977e440.svg similarity index 100% rename from assets/dist/shop/payment/mastercard-dark.8977e440.svg rename to assets/shop/dist/payment/mastercard-dark.8977e440.svg diff --git a/assets/dist/shop/payment/mastercard.7dd4ce0b.svg b/assets/shop/dist/payment/mastercard.7dd4ce0b.svg similarity index 100% rename from assets/dist/shop/payment/mastercard.7dd4ce0b.svg rename to assets/shop/dist/payment/mastercard.7dd4ce0b.svg diff --git a/assets/dist/shop/payment/visa-dark.87c34e0f.svg b/assets/shop/dist/payment/visa-dark.87c34e0f.svg similarity index 100% rename from assets/dist/shop/payment/visa-dark.87c34e0f.svg rename to assets/shop/dist/payment/visa-dark.87c34e0f.svg diff --git a/assets/dist/shop/payment/visa.d11a46f6.svg b/assets/shop/dist/payment/visa.d11a46f6.svg similarity index 100% rename from assets/dist/shop/payment/visa.d11a46f6.svg rename to assets/shop/dist/payment/visa.d11a46f6.svg diff --git a/assets/shop/oney_common/index.js b/assets/shop/oney_common/index.js deleted file mode 100644 index d4046a0b..00000000 --- a/assets/shop/oney_common/index.js +++ /dev/null @@ -1,5 +0,0 @@ -WebFont.load({ - google: { - families: ["Poppins:400,600"], - }, -}); diff --git a/assets/shop/oney_common/index.scss b/assets/shop/oney_common/index.scss deleted file mode 100644 index c4dbc21e..00000000 --- a/assets/shop/oney_common/index.scss +++ /dev/null @@ -1,52 +0,0 @@ -@import "../../settings/constants.scss"; - -[class*=oney] * { - font: { - family: Poppins, Arial, sans-serif !important; - } - - line-height: 1.25; - - p { - color: $greyish; - margin: 0; - } - - small { - font: { - size: 90%; - } - } -} - -.oney-info { - position: relative; - display: inline-block; - margin: 1em auto .5em; - - span { - vertical-align: text-bottom; - text-transform: uppercase; - font-size: 16px; - } - - > img { - cursor: pointer; - vertical-align: middle; - margin: 0 4px; - } - - &.loading { - pointer-events: none; - } -} - -.oney-logo[src*=without-fees] { - max-width: 190px; -} - -@media screen and (max-width: 768px) { - .oney-logo { - max-width: 230px; - } -} diff --git a/assets/shop/payment/index.scss b/assets/shop/payment/index.scss deleted file mode 100644 index d4815ea6..00000000 --- a/assets/shop/payment/index.scss +++ /dev/null @@ -1,360 +0,0 @@ -@import "../../settings/constants.scss"; - -// @see https://github.com/Sylius/Sylius/blob/1d6650f2da82ccd8970898be29649016ab18b0d0/src/Sylius/Bundle/ShopBundle/Resources/private/scss/theme.scss#L1067 -%label { - display: flex !important; - margin-top: 0 !important; - padding: 1em !important; -} - -.oney-payment-choice, -.payplug-payment-choice { - display: none; - - &__container { - display: flex; - margin: 1rem 0; - } - - &__header { - p { - margin: .5em 0 !important; - color: $black; - } - } - - &__item { - flex: 1 1 auto; - - &--oney_x3_with_fees, - &--oney_x3_without_fees { - margin-right: 1em; - } - - input { - display: none; - - &:checked + label { - border-color: $green; - background-color: transparentize($green, .87); - - &.payplug-payment-choice__label { - border-color: $paypluggreen; - background-color: transparentize($paypluggreen, .87) - } - } - } - - label { - @extend %label; - width: 100%; - height: 100%; - cursor: pointer; - position: relative; - flex-direction: column; - border: 1px solid $lightgrey; - box-shadow: 0 1px 2px 0 transparentize($darkgrey, .85); - border-radius: .28571429rem; - transition: border-color, background-color 300ms ease-in-out; - - img { - vertical-align: text-bottom; - } - } - } - - &__content { - display: contents; - - p { - color: $black; - display: flex; - flex-wrap: wrap; - justify-content: space-between; - border-bottom: 1px solid $lightgrey; - margin: 0 !important; - padding: .75rem 0 !important; - - &:nth-last-of-type(2) { - margin-bottom: 1rem !important; - } - - &:last-of-type { - margin-top: auto !important; - border: none; - margin-bottom: 0 !important; - } - - &.oney-without-fees-financing { - display: inline-block; - } - } - - small { - margin-top: .5rem; - font: { - size: 80%; - } - } - } -} - -.oney-payment-choice { - &__tab { - display: none; - } - - &__header { - margin: 0 auto; - text-align: center; - } -} - -[data-gateway="oney"] { - padding: 0 !important; - margin-top: 10px !important; -} - -.payment-item { - .oney-logo[src*=without-fees] { - max-width: 200px; - } - - apple-pay-button { - --apple-pay-button-width: 222px; - --apple-pay-button-height: 40px; - --apple-pay-button-border-radius: 4px; - --apple-pay-button-padding: 4px 4px; - --apple-pay-button-box-sizing: border-box; - transition: background-color 0.3s ease-in-out; - display: none; - min-width: 140px; - max-width: 100%; - - &.enabled { - display: block; - } - } - - label { - cursor: pointer; - } - - .bancontact-method, - .apple-pay-method, - .american-express-method { - label { - position: relative; - - img { - position: absolute; - left: 100%; - margin-left: 0.5em; - top: -12px; - } - } - } -} - -.payplug-payment-choice { - &__container { - flex-direction: column; - } - - &__item { - margin-bottom: 1em; - } - - &__header { - display: flex; - justify-content: space-between; - align-items: center; - - .card-expiry span { - font-weight: 700; - } - } -} - -.oney-complete-info-popin { - position: fixed !important; - margin: auto !important; - text-align: center; - left: 0; - right: 0; - top: 50%; - transform: translateY(-50%); - max-width: 480px; - z-index: 4; - - &__header { - text-align: right; - - a.close { - > span { - position: absolute; - width: 15px; - height: 2px; - right: .5em; - top: 1em; - margin: 0; - border-radius: 0; - background-color: transparentize($black, .95); - - &:first-of-type { - transform: rotate(45deg); - } - - &:last-of-type { - transform: rotate(-45deg); - - } - } - } - } - - &__content { - text-align: left; - - ul { - list-style: none; - padding: 0; - - li { - display: inline-block; - margin: 0 .14285714em; - padding: .5833em .833em; - font-weight: 700; - border-radius: .28571429rem; - background-color: $red; - border-color: $red; - color: $white; - font-size: .85714286rem; - } - } - } - - &__success { - display: none; - - i.icon { - display: inline-block !important; - color: $neongreen; - } - } -} - -.ui.container { - position: relative; -} - -.inactive { - pointer-events: none; -} - -.overlay { - width: 100%; - height: 100%; - position: absolute; - display: block; - background: transparentize($black, .75); - z-index: 3; -} - -.payment-label-with-image::after { - content: ""; - background-image: var(--logo); - display: inline-block; - width: 60px; - height: 25px; - background-repeat: no-repeat; - background-position: 0 -11px; - background-size: 60px 45px; - float: right; -} - -.bancontacy-label::after{ - margin-left: 5px; -} - -@media screen and (max-width: 991px) { - .oney-payment-choice, - .payplug-payment-choice { - &__container { - display: block; - } - - &__content { - small { - width: 100%; - } - } - } - - .oney-payment-choice { - &__tab { - display: flex; - justify-content: space-between; - - .tablink { - padding: 1rem 0; - flex: 1; - text-align: center; - border: 1px solid $lightgrey; - border-bottom: 0; - - &.active { - border-bottom: 5px solid $green; - } - - p { - color: $black; - } - - &:first-of-type { - border-right: 0; - } - - > .oney-payment__image { - max-width: 120px - } - } - } - - &__header { - display: none; - } - - &__item { - display: none; - - input:checked + label { - border-color: $lightgrey; - background-color: $white; - } - - label { - @extend %label; - border-top-right-radius: 0; - border-top-left-radius: 0; - } - - &--oney_x3_with_fees, - &--oney_x3_without_fees { - margin-bottom: 1rem; - margin-right: 0; - display: block; - } - } - } -} - -@media screen and (max-width: 480px) { - .payplug-payment-choice { - &__header, - &__header .card-type, - &__header .card-expiry { - display: block; - } - } -} diff --git a/config/twig_hooks/shop.yaml b/config/twig_hooks/shop.yaml index 75473ff3..3b6a1346 100644 --- a/config/twig_hooks/shop.yaml +++ b/config/twig_hooks/shop.yaml @@ -2,11 +2,11 @@ sylius_twig_hooks: hooks: 'sylius_shop.product.show.content.info.summary': pay_with_oney: - template: '@PayPlugSyliusPayPlugPlugin/oney/product/pay_with_oney.html.twig' + template: '@PayPlugSyliusPayPlugPlugin/shop/oney/product/pay_with_oney.html.twig' priority: 101 'sylius_shop.cart.index.content.form.sections.general#right': pay_with_oney: - template: '@PayPlugSyliusPayPlugPlugin/oney/cart/pay_with_oney.html.twig' + template: '@PayPlugSyliusPayPlugPlugin/shop/oney/cart/pay_with_oney.html.twig' priority: 1 'sylius_shop.account.saved_card#stylesheets': payplug_styles: @@ -14,10 +14,10 @@ sylius_twig_hooks: priority: 1 'sylius.shop.account.saved_cards.index.subcontent': header: - template: '@PayPlugSyliusPayPlugPlugin/Account/SavedCards/Index/_header.html.twig' + template: '@PayPlugSyliusPayPlugPlugin/shop/saved_cards/index/_header.html.twig' priority: 20 subcontent: - template: "@PayPlugSyliusPayPlugPlugin/Account/SavedCards/Index/_subcontent.html.twig" + template: "@PayPlugSyliusPayPlugPlugin/shop/saved_cards/index/_subcontent.html.twig" priority: 10 @@ -30,21 +30,26 @@ sylius_twig_hooks: select_payment_css: template: '@PayPlugSyliusPayPlugPlugin/stylesheets/select_payment_css.html.twig' + 'sylius_shop.shared.form.select_payment.payment': + choice: + template: '@PayPlugSyliusPayPlugPlugin/shared/form/select_payment/payment/choice.html.twig' + priority: 0 + 'sylius_shop.shared.form.select_payment.payment.choice.details': - payplug_choice: - template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig' + choice: + template: '@PayPlugSyliusPayPlugPlugin/shop/select_payment/choice.html.twig' 'sylius_shop.shared.form.select_payment.payment.choice.details#payplug': - payplug_block: - template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_payplug_block.html.twig' + payplug: + template: '@PayPlugSyliusPayPlugPlugin/shop/select_payment/_payplug.html.twig' 'sylius_shop.shared.form.select_payment.payment.choice.details#payplug_oney': - payplug_oney_block: - template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_payplug_oney_block.html.twig' + oney: + template: '@PayPlugSyliusPayPlugPlugin/shop/select_payment/_oney.html.twig' 'sylius_shop.shared.form.select_payment.payment.choice.details#payplug_bancontact': - payplug_bancontact_block: - template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_payplug_bancontact_block.html.twig' + bancontact: + template: '@PayPlugSyliusPayPlugPlugin/shop/select_payment/_bancontact.html.twig' 'sylius_shop.shared.form.select_payment.payment.choice.details#payplug_apple_pay': - payplug_apple_pay_block: - template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_payplug_apple_pay_block.html.twig' + apple_pay: + template: '@PayPlugSyliusPayPlugPlugin/shop/select_payment/_apple_pay.html.twig' 'sylius_shop.shared.form.select_payment.payment.choice.details#payplug_american_express': - payplug_american_express_block: - template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_payplug_american_express_block.html.twig' + american_express: + template: '@PayPlugSyliusPayPlugPlugin/shop/select_payment/_american_express.html.twig' diff --git a/public/assets/admin/payment_method/index.css b/public/assets/admin/payment_method/index.css deleted file mode 100644 index e3f88634..00000000 --- a/public/assets/admin/payment_method/index.css +++ /dev/null @@ -1 +0,0 @@ -.ui.label>a{opacity:1;color:#000}.ui.label>a:hover{text-decoration:underline} \ No newline at end of file diff --git a/public/assets/shop/account/index.css b/public/assets/shop/account/index.css deleted file mode 100644 index 12c5c6ec..00000000 --- a/public/assets/shop/account/index.css +++ /dev/null @@ -1 +0,0 @@ -.sylius-customer-account-saved-cards-grid .ui.table td span.expired{color:#db2828}@media screen and (max-width:767px){.ui.segment.sylius-customer-account-saved-cards-grid{-webkit-box-shadow:none;box-shadow:none;background:0 0;border:0;padding:0}.ui.basic.table tbody tr{background:#fff;border:1px solid #22242642;border-radius:.285714rem;margin:1rem 0 2rem;padding:1em;position:relative;box-shadow:0 1px 2px #22242626!important}.ui.basic.table tbody tr:first-child{margin-top:0}.ui.basic.table tbody tr:last-child{margin-bottom:0}.sylius-customer-account-saved-cards-grid .ui.table td:before{content:attr(data-label);float:left;font-weight:700}.sylius-customer-account-saved-cards-grid .ui.table td[data-label]>span{margin-left:3px}.sylius-customer-account-saved-cards-grid .ui.table:not(.unstackable) thead{clip:rect(0 0 0 0);height:1px;width:1px;border:none;margin:-1px;padding:0;position:absolute;overflow:hidden}.sylius-customer-account-saved-cards-grid .ui.table:not(.unstackable) tr>td{font-weight:400;display:block}.sylius-customer-account-saved-cards-grid .ui.table:not(.unstackable) tr>td.actions{text-align:right;margin-top:1rem}.sylius-customer-account-saved-cards-grid .ui.table:not(.unstackable) tr>th,.sylius-customer-account-saved-cards-grid .ui.table:not(.unstackable) tr>td{padding:0!important}} \ No newline at end of file diff --git a/public/assets/shop/oney_cart/index.js b/public/assets/shop/oney_cart/index.js deleted file mode 100644 index 7c1dcdf0..00000000 --- a/public/assets/shop/oney_cart/index.js +++ /dev/null @@ -1 +0,0 @@ -!function(){const n={init(){n.position()},position(){let n=$(".oney-info");n.next().insertBefore(n)}};document.addEventListener("DOMContentLoaded",n.init,!1)}(); \ No newline at end of file diff --git a/public/assets/shop/oney_common/index.css b/public/assets/shop/oney_common/index.css deleted file mode 100644 index 84b84648..00000000 --- a/public/assets/shop/oney_common/index.css +++ /dev/null @@ -1 +0,0 @@ -[class*=oney] *{line-height:1.25;font-family:Poppins,Arial,sans-serif!important}[class*=oney] * p{color:#66727f;margin:0}[class*=oney] * small{font-size:90%}.oney-info{margin:1em auto .5em;display:inline-block;position:relative}.oney-info span{vertical-align:text-bottom;text-transform:uppercase;font-size:16px}.oney-info>img{cursor:pointer;vertical-align:middle;margin:0 4px}.oney-info.loading{pointer-events:none}.oney-logo[src*=without-fees]{max-width:190px}@media screen and (max-width:768px){.oney-logo{max-width:230px}} \ No newline at end of file diff --git a/public/assets/shop/oney_common/index.js b/public/assets/shop/oney_common/index.js deleted file mode 100644 index df241c0e..00000000 --- a/public/assets/shop/oney_common/index.js +++ /dev/null @@ -1 +0,0 @@ -WebFont.load({google:{families:["Poppins:400,600"]}}); \ No newline at end of file diff --git a/public/assets/shop/oney_popin/index.css b/public/assets/shop/oney_popin/index.css deleted file mode 100644 index ecaf7bff..00000000 --- a/public/assets/shop/oney_popin/index.css +++ /dev/null @@ -1 +0,0 @@ -.oney-popin{z-index:99;max-width:20em;background-color:#fff;padding:10px;display:none;position:absolute;top:0;left:calc(-20em - 32px);transform:translateY(calc(10px - 33.3333%))}.oney-popin:after{content:"";height:0;width:0;border-top:20px solid #0000;border-bottom:20px solid #0000;display:inline-block;position:absolute;top:calc(33.3333% - 10px);right:-20px}.oney-popin.enabled{border:1px solid #81bc00}.oney-popin.enabled hr{border-color:#81bc00}.oney-popin.enabled:after{border-left:20px solid #81bc00}.oney-popin.enabled a.close>span{background:#81bc00}.oney-popin.enabled .oney-popin__content>p{color:#81bc00}.oney-popin.disabled{border:1px solid #ccc}.oney-popin.disabled hr{border-color:#ccc}.oney-popin.disabled:after{border-left:20px solid #ccc}.oney-popin.disabled a.close>span{background:#ccc}.oney-popin.disabled .oney-popin__content>p{color:#66727f}.oney-popin__header{text-align:right}.oney-popin__header a.close{width:40px;height:40px;position:absolute;top:0;right:0}.oney-popin__header a.close>span{width:15px;height:2px;border-radius:0;margin:0;position:absolute;top:1em;right:.5em}.oney-popin__header a.close>span:first-of-type{transform:rotate(55deg)}.oney-popin__header a.close>span:last-of-type{transform:rotate(-55deg)}.oney-popin__content>p:not(.reasons){text-transform:uppercase;margin-bottom:0;font-size:16px}.oney-popin__content>p:not(.reasons):last-of-type{margin-bottom:1em}.oney-popin__content>p.reasons{max-width:95%}.oney-popin__footer{margin-top:1em}.oney-popin__footer>p{text-align:justify}.oney-popin section{align-items:flex-start;display:flex}.oney-popin img{height:auto;margin-right:.5em}.oney-popin hr{border-style:solid none none;border-width:1px 0 0;border-bottom-color:currentColor;border-left-color:currentColor;border-right-color:currentColor;margin:1.25em 0}@media screen and (max-width:768px){.oney-popin{top:60px;left:0;transform:none}.oney-popin__header a.close{padding:10px 50px}.oney-popin:after{top:-30px;right:calc(50% - 10px);transform:rotate(-90deg)}} \ No newline at end of file diff --git a/public/assets/shop/oney_popin/index.js b/public/assets/shop/oney_popin/index.js deleted file mode 100644 index d68003ec..00000000 --- a/public/assets/shop/oney_popin/index.js +++ /dev/null @@ -1 +0,0 @@ -!function(){const t={handlers:{info:".oney-info",popin:".oney-popin",codes:"#payplug-product-variant-codes"},triggers:{option:"cartItem_variant",quantity:"cartItem_quantity"},productMeta:[],storage:[],init(){"undefined"!=typeof productMeta&&t.watch(),t.fade(),t.closeHandler()},watch(){for(const t in this.triggers){const e=$(`[id*=${this.triggers[t]}`);e.length>0&&this.handleProductOptionsChange(e,t),productMeta[t]=e.val(),e.on("input",this.debounce((a=>{a.preventDefault(),e.length>0&&this.handleProductOptionsChange(e,t),productMeta[t]=$(a.currentTarget).val(),this.check()}),500))}this.productMeta=productMeta},handleProductOptionsChange(t,e){if("option"===e){let e="";return t.each(((t,a)=>{const n=$(a),s=n.find("option:selected").val();e+=`[data-${n.attr("data-option")}="${s}"]`})),productMeta.product_variant_code=$(this.handlers.codes).find(e).attr("data-value")}},check(){const t=this;this.storage=[],$.ajax({url:this.productMeta.url,data:this.productMeta,success:function(e){$(t.handlers.info).find("img:first").attr("src",t.productMeta.img[e.isEligible]),e.isEligible?$(t.handlers.popin).removeClass("disabled").addClass("enabled"):$(t.handlers.popin).removeClass("enabled").addClass("disabled")}})},debounce(t,e){let a;return function(...n){clearTimeout(a),a=setTimeout((()=>{clearTimeout(a),t(...n)}),e)}},fade(){$(this.handlers.info).on("click",(t=>{t.preventDefault(),t.stopPropagation(),$(this.handlers.popin).is(":empty")||$(this.handlers.popin).text().trim()!==this.storage?(this.toggleLoader(),this.load()):$(this.handlers.popin).fadeIn()}))},load(){const e=this;$.ajax({url:$(this.handlers.popin).data("popin-url"),data:this.productMeta,success:function(t){t.includes(translations.reason)&&$(e.handlers.popin).removeClass("enabled").addClass("disabled"),e.storage=$(t).text().trim(),$(e.handlers.popin).html(t)},error:function(){$(e.handlers.popin).removeClass("enabled").addClass("disabled").html(`\n
\n \n \n \n
\n
\n

${translations.reason}

\n
\n `)},complete:function(){e.toggleLoader(),$(e.handlers.popin).fadeIn(),t.closeHandler()}})},toggleLoader(){$(this.handlers.info).toggleClass("loading").find(".dimmer").toggleClass("active")},closeHandler(){$("html").not(this.handlers.popin).on("click",(t=>{t.stopPropagation(),$(this.handlers.popin).fadeOut()})),$(this.handlers.popin).find("a.close").on("click",(t=>{t.stopPropagation(),$(this.handlers.popin).fadeOut()}))}};document.addEventListener("DOMContentLoaded",t.init,!1)}(); \ No newline at end of file diff --git a/public/assets/shop/payment/index.css b/public/assets/shop/payment/index.css deleted file mode 100644 index 3b919ea5..00000000 --- a/public/assets/shop/payment/index.css +++ /dev/null @@ -1 +0,0 @@ -.oney-payment-choice__item label,.payplug-payment-choice__item label{margin-top:0!important;padding:1em!important;display:flex!important}.oney-payment-choice,.payplug-payment-choice{display:none}.oney-payment-choice__container,.payplug-payment-choice__container{margin:1rem 0;display:flex}.oney-payment-choice__header p,.payplug-payment-choice__header p{color:#000;margin:.5em 0!important}.oney-payment-choice__item,.payplug-payment-choice__item{flex:auto}.oney-payment-choice__item--oney_x3_with_fees,.oney-payment-choice__item--oney_x3_without_fees,.payplug-payment-choice__item--oney_x3_with_fees,.payplug-payment-choice__item--oney_x3_without_fees{margin-right:1em}.oney-payment-choice__item input,.payplug-payment-choice__item input{display:none}.oney-payment-choice__item input:checked+label,.payplug-payment-choice__item input:checked+label{background-color:#81bc0021;border-color:#81bc00}.oney-payment-choice__item input:checked+label.payplug-payment-choice__label,.payplug-payment-choice__item input:checked+label.payplug-payment-choice__label{background-color:#8fd2b821;border-color:#8fd2b8}.oney-payment-choice__item label,.payplug-payment-choice__item label{width:100%;height:100%;cursor:pointer;border:1px solid #ccc;border-radius:.285714rem;flex-direction:column;transition:border-color,background-color .3s ease-in-out;position:relative;box-shadow:0 1px 2px #22242626}.oney-payment-choice__item label img,.payplug-payment-choice__item label img{vertical-align:text-bottom}.oney-payment-choice__content,.payplug-payment-choice__content{display:contents}.oney-payment-choice__content p,.payplug-payment-choice__content p{color:#000;border-bottom:1px solid #ccc;flex-wrap:wrap;justify-content:space-between;display:flex;margin:0!important;padding:.75rem 0!important}.oney-payment-choice__content p:nth-last-of-type(2),.payplug-payment-choice__content p:nth-last-of-type(2){margin-bottom:1rem!important}.oney-payment-choice__content p:last-of-type,.payplug-payment-choice__content p:last-of-type{border:none;margin-top:auto!important;margin-bottom:0!important}.oney-payment-choice__content p.oney-without-fees-financing,.payplug-payment-choice__content p.oney-without-fees-financing{display:inline-block}.oney-payment-choice__content small,.payplug-payment-choice__content small{margin-top:.5rem;font-size:80%}.oney-payment-choice__tab{display:none}.oney-payment-choice__header{text-align:center;margin:0 auto}[data-gateway=oney]{margin-top:10px!important;padding:0!important}.payment-item .oney-logo[src*=without-fees]{max-width:200px}.payment-item apple-pay-button{--apple-pay-button-width:222px;--apple-pay-button-height:40px;--apple-pay-button-border-radius:4px;--apple-pay-button-padding:4px 4px;--apple-pay-button-box-sizing:border-box;min-width:140px;max-width:100%;transition:background-color .3s ease-in-out;display:none}.payment-item apple-pay-button.enabled{display:block}.payment-item label{cursor:pointer}.payment-item .bancontact-method label,.payment-item .apple-pay-method label,.payment-item .american-express-method label{position:relative}.payment-item .bancontact-method label img,.payment-item .apple-pay-method label img,.payment-item .american-express-method label img{margin-left:.5em;position:absolute;top:-12px;left:100%}.payplug-payment-choice__container{flex-direction:column}.payplug-payment-choice__item{margin-bottom:1em}.payplug-payment-choice__header{justify-content:space-between;align-items:center;display:flex}.payplug-payment-choice__header .card-expiry span{font-weight:700}.oney-complete-info-popin{text-align:center;max-width:480px;z-index:4;top:50%;left:0;right:0;transform:translateY(-50%);margin:auto!important;position:fixed!important}.oney-complete-info-popin__header{text-align:right}.oney-complete-info-popin__header a.close>span{width:15px;height:2px;background-color:#0000000d;border-radius:0;margin:0;position:absolute;top:1em;right:.5em}.oney-complete-info-popin__header a.close>span:first-of-type{transform:rotate(45deg)}.oney-complete-info-popin__header a.close>span:last-of-type{transform:rotate(-45deg)}.oney-complete-info-popin__content{text-align:left}.oney-complete-info-popin__content ul{padding:0;list-style:none}.oney-complete-info-popin__content ul li{color:#fff;background-color:#db2828;border-color:#db2828;border-radius:.285714rem;margin:0 .142857em;padding:.5833em .833em;font-size:.857143rem;font-weight:700;display:inline-block}.oney-complete-info-popin__success{display:none}.oney-complete-info-popin__success i.icon{color:#21ba45;display:inline-block!important}.ui.container{position:relative}.inactive{pointer-events:none}.overlay{width:100%;height:100%;z-index:3;background:#00000040;display:block;position:absolute}.payment-label-with-image::after{content:"";background-image:var(--logo);display:inline-block;width:60px;height:25px;background-repeat:no-repeat;background-position:0 -11px;background-size:60px 45px;float:right}.bancontacy-label::after{margin-left:5px}@media screen and (max-width:991px){.oney-payment-choice__container,.payplug-payment-choice__container{display:block}.oney-payment-choice__content small,.payplug-payment-choice__content small{width:100%}.oney-payment-choice__tab{justify-content:space-between;display:flex}.oney-payment-choice__tab .tablink{text-align:center;border:1px solid #ccc;border-bottom:0;flex:1;padding:1rem 0}.oney-payment-choice__tab .tablink.active{border-bottom:5px solid #81bc00}.oney-payment-choice__tab .tablink p{color:#000}.oney-payment-choice__tab .tablink:first-of-type{border-right:0}.oney-payment-choice__tab .tablink>.oney-payment__image{max-width:120px}.oney-payment-choice__header,.oney-payment-choice__item{display:none}.oney-payment-choice__item input:checked+label{background-color:#fff;border-color:#ccc}.oney-payment-choice__item label{border-top-left-radius:0;border-top-right-radius:0}.oney-payment-choice__item--oney_x3_with_fees,.oney-payment-choice__item--oney_x3_without_fees{margin-bottom:1rem;margin-right:0;display:block}}@media screen and (max-width:480px){.payplug-payment-choice__header,.payplug-payment-choice__header .card-type,.payplug-payment-choice__header .card-expiry{display:block}} diff --git a/public/assets/shop/payment/index.js b/public/assets/shop/payment/index.js deleted file mode 100644 index 0a48be74..00000000 --- a/public/assets/shop/payment/index.js +++ /dev/null @@ -1 +0,0 @@ -!function(){const e={options:{trigger:".payment-method-choice",completeInfo:{modal:".oney-complete-info-popin",area:".ui.grid"}},init(t){void 0===t&&(t=this.options),this.options=$.extend(!0,{},t),e.toggleGateway(),"undefined"!=typeof completeInfoRoute&&e.modalAppear(),e.tabs(),$(window).on("resize",(()=>{setTimeout(e.tabs,100)})),e.tabsHandler(),e.applePayHandler(),$('form[name="sylius_checkout_select_payment"]').on("submit",(()=>{e.handleForm()}))},toggleGateway(){const e=$(this.options.trigger).data("payment-input-id");$(`#${e}:checked`).length&&$(`.payment-method-choice[data-payment-input-id="${e}"]`).show(),$("input[id*=sylius_checkout_select_payment]").on("change",(e=>{const t=$(e.currentTarget).attr("id");$(".payment-method-choice").slideUp(),$(`.payment-method-choice[data-payment-input-id="${t}"]`).slideDown()}))},tabs(){window.innerWidth<=991?($(".oney-payment-choice__item").hide(),setTimeout((()=>{$.each($(".oney-payment-choice__input"),((e,t)=>{$(t).is(":checked")&&($(t).parent().show(),$(`a.tablink[data-id=${$(t).val()}]`).addClass("active"))}))}),1)):($(".oney-payment-choice__item").show(),$("a.tablink").removeClass("active"))},tabsHandler(){$.each($("a.tablink"),((e,t)=>{$(t).click((function(e){$("a.tablink").removeClass("active"),$(this).addClass("active"),$(".oney-payment-choice__item").hide(),$(`#${$(this).data("id")}`).show(),$(`input[value=${$(this).data("id")}`).prop("checked",!0)}))}))},disableNextStepButton(){const e=$('form[name="sylius_checkout_select_payment"] .select-payment-submit #next-step');e.replaceWith($("",{id:"next-step",class:"ui large disabled icon labeled button",html:e.html()}))},enableNextStepButton(){const e=$('form[name="sylius_checkout_select_payment"] .select-payment-submit #next-step');e.replaceWith($(" - -
- {% endif %} -
diff --git a/templates/SyliusShopBundle/Checkout/SelectPayment/_navigation.html.twig b/templates/SyliusShopBundle/Checkout/SelectPayment/_navigation.html.twig deleted file mode 100644 index 2bc14319..00000000 --- a/templates/SyliusShopBundle/Checkout/SelectPayment/_navigation.html.twig +++ /dev/null @@ -1,17 +0,0 @@ -{% set enabled = order.payments|length %} - -
-
- {% if sylius_is_shipping_required(order) %} - {{ 'sylius.ui.change_shipping_method'|trans }} - {% else %} - {{ 'sylius.ui.change_address'|trans }} - {% endif %} -
-
- -
-
diff --git a/templates/SyliusShopBundle/Order/show.html.twig b/templates/SyliusShopBundle/Order/show.html.twig deleted file mode 100644 index a6e90703..00000000 --- a/templates/SyliusShopBundle/Order/show.html.twig +++ /dev/null @@ -1,6 +0,0 @@ -{% extends '@!SyliusShop/Order/show.html.twig' %} - -{% block content %} - {{ sylius_template_event('sylius.shop.order.select_payment.before_form') }} - {{ parent() }} -{% endblock %} \ No newline at end of file diff --git a/templates/SyliusUiBundle/Modal/_confirmation.html.twig b/templates/SyliusUiBundle/Modal/_confirmation.html.twig deleted file mode 100644 index 5e0dc0fa..00000000 --- a/templates/SyliusUiBundle/Modal/_confirmation.html.twig +++ /dev/null @@ -1,26 +0,0 @@ -{% set currentRoute = payplug_get_current_route() %} - diff --git a/templates/form/sylius_checkout_select_payment_row.html.twig b/templates/form/sylius_checkout_select_payment_row.html.twig index c5978d44..26daee22 100644 --- a/templates/form/sylius_checkout_select_payment_row.html.twig +++ b/templates/form/sylius_checkout_select_payment_row.html.twig @@ -66,7 +66,7 @@
{% endblock %} -{% block _sylius_checkout_select_payment_payments_entry_payplug_card_choice_row %} +{% block payplug_saved_cards %}
{% for card in sylius.customer.cards %} {% set cardExpirationDate = ("%04d"|format(card.expirationYear) ~ '-' ~ "%02d"|format(card.expirationMonth))|date("Y-m") %} @@ -110,3 +110,11 @@
{% endblock %} + +{% block _sylius_shop_checkout_select_payment_payments_entry_payplug_card_choice_row %} + {{ block('payplug_saved_cards') }} +{% endblock %} + +{% block _sylius_checkout_select_payment_payments_entry_payplug_card_choice_row %} + {{ block('payplug_saved_cards') }} +{% endblock %} diff --git a/templates/shared/form/select_payment/payment/choice.html.twig b/templates/shared/form/select_payment/payment/choice.html.twig new file mode 100644 index 00000000..19a28816 --- /dev/null +++ b/templates/shared/form/select_payment/payment/choice.html.twig @@ -0,0 +1,14 @@ +{% set form = hookable_metadata.context.form %} + +
+ {{ form_errors(form.method) }} + + {% for key, choice_form in form.method %} + {% hook 'choice' with { 'form': choice_form, 'method': form.method.vars.choices[key].data } %} + {% else %} + {% hook 'choice#unavailable' %} + {% endfor %} +
diff --git a/templates/form/integrated.html.twig b/templates/shop/integrated/index.html.twig similarity index 98% rename from templates/form/integrated.html.twig rename to templates/shop/integrated/index.html.twig index 39885494..1329c28e 100644 --- a/templates/form/integrated.html.twig +++ b/templates/shop/integrated/index.html.twig @@ -41,6 +41,7 @@
{{ 'payplug_sylius_payplug_plugin.ui.integrated_payment.scheme.label'|trans }}
+ {# @todo: adding radio prop name will lead to an invalid model name but it doesn't matter for now #}
+ {% endif %} +
+
\ No newline at end of file diff --git a/templates/card/layout.html.twig b/templates/shop/saved_cards/layout.html.twig similarity index 100% rename from templates/card/layout.html.twig rename to templates/shop/saved_cards/layout.html.twig diff --git a/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_american_express_block.html.twig b/templates/shop/select_payment/_american_express.html.twig similarity index 100% rename from templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_american_express_block.html.twig rename to templates/shop/select_payment/_american_express.html.twig diff --git a/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_apple_pay_block.html.twig b/templates/shop/select_payment/_apple_pay.html.twig similarity index 100% rename from templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_apple_pay_block.html.twig rename to templates/shop/select_payment/_apple_pay.html.twig diff --git a/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_bancontact_block.html.twig b/templates/shop/select_payment/_bancontact.html.twig similarity index 100% rename from templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_bancontact_block.html.twig rename to templates/shop/select_payment/_bancontact.html.twig diff --git a/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_oney_block.html.twig b/templates/shop/select_payment/_oney.html.twig similarity index 100% rename from templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_oney_block.html.twig rename to templates/shop/select_payment/_oney.html.twig diff --git a/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_block.html.twig b/templates/shop/select_payment/_payplug.html.twig similarity index 94% rename from templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_block.html.twig rename to templates/shop/select_payment/_payplug.html.twig index d8b9f912..b419d6c2 100644 --- a/templates/SyliusShopBundle/Checkout/SelectPayment/_payplug_block.html.twig +++ b/templates/shop/select_payment/_payplug.html.twig @@ -33,7 +33,7 @@ {% endif %} {% if integratedPayment %} - {% include '@PayPlugSyliusPayPlugPlugin/form/integrated.html.twig' with { + {% include '@PayPlugSyliusPayPlugPlugin/shop/integrated/index.html.twig' with { 'paymentMethod': method, 'payment': order.getLastPayment('cart'), 'hasSavedCards': hasSavedCards, diff --git a/templates/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig b/templates/shop/select_payment/choice.html.twig similarity index 99% rename from templates/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig rename to templates/shop/select_payment/choice.html.twig index b0fff535..dbda00d3 100644 --- a/templates/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig +++ b/templates/shop/select_payment/choice.html.twig @@ -10,4 +10,3 @@ {% set americanExpressFactoryName = constant('PayPlug\\SyliusPayPlugPlugin\\Gateway\\AmericanExpressGatewayFactory::FACTORY_NAME') %} {% hook '#' ~ factoryName %} - From be2bf50ccf0541a1622387ed36e3f5626a9e40c3 Mon Sep 17 00:00:00 2001 From: maxperei Date: Tue, 24 Jun 2025 13:06:54 +0200 Subject: [PATCH 050/112] feat(checkout): [oney] complete info --- assets/package.json | 3 + .../controllers/oney-payment_controller.js | 80 +++--- assets/shop/dist/payment/index.css | 252 ++++++++++++++++++ config/twig_hooks/shop.yaml | 4 + templates/form/complete_info_popin.html.twig | 30 +-- ...lius_checkout_select_payment_row.html.twig | 1 + templates/shared/modal/index.html.twig | 14 + templates/shop/select_payment/_oney.html.twig | 29 +- .../shop/select_payment/_payplug.html.twig | 6 +- 9 files changed, 339 insertions(+), 80 deletions(-) create mode 100644 assets/shop/dist/payment/index.css create mode 100644 templates/shared/modal/index.html.twig diff --git a/assets/package.json b/assets/package.json index fc4dca94..530a870f 100644 --- a/assets/package.json +++ b/assets/package.json @@ -48,6 +48,9 @@ }, "checkout-select-payment": { "main": "shop/controllers/checkout-select-payment_controller.js", + "autoimport": { + "@payplug/sylius-payplug-plugin/dist/shop/payment/index.css": true + }, "webpackMode": "lazy", "fetch": "lazy", "enabled": true diff --git a/assets/shop/controllers/oney-payment_controller.js b/assets/shop/controllers/oney-payment_controller.js index f577e39f..291f7c4b 100644 --- a/assets/shop/controllers/oney-payment_controller.js +++ b/assets/shop/controllers/oney-payment_controller.js @@ -3,18 +3,12 @@ import $ from 'jquery'; /* stimulusFetch: 'lazy' */ export default class extends Controller { + static values = { + modal: String, + area: String, + route: String, + } connect() { - this.options = { - completeInfo: { - modal: '.oney-complete-info-popin', - area: '.ui.grid', - }, - }; - - if (typeof completeInfoRoute !== 'undefined') { - this.modalAppear(); - } - this.tabs(); window.addEventListener('resize', () => { setTimeout(this.tabs, 100); @@ -50,55 +44,51 @@ export default class extends Controller { }); }); } - modalAppear() { - const self = this; - let path = completeInfoRoute; + routeValueChanged() { + if (!this.hasRouteValue) { + return; + } + + let path = this.routeValue; $.get(path).then((data) => { - $('body .pusher').append('
'); - $(self.options.completeInfo.area).addClass("inactive"); - $(self.options.completeInfo.area).parent().append(data); - self.modalEvents(); - }); - } - modalFadeaway() { - $(this.options.completeInfo.modal).fadeOut(300, () => { - $(this.options.completeInfo.area).removeClass('inactive'); - $('.overlay').hide(); + const modalTpl = document.querySelector('.modal'); + this.modal = new window.bootstrap.Modal(modalTpl); + $(modalTpl).find('.modal-body').html(data); + this.modal.show(); + $('form[name=form]').on('submit', (e) => { + this.modalSubmit(e); + }); }); } modalSubmit(evt) { - const self = this; evt.preventDefault(); - $(evt.currentTarget).addClass('loading'); - + if (!this.hasRouteValue) { + return; + } + $('.sylius-shop-loader').toggleClass("d-none"); $.ajax({ method: 'post', - url: completeInfoRoute, + url: this.routeValue, data: $(evt.currentTarget).serialize(), - success: function (res) { + success: (res) => { if (Array.isArray(res)) { - $(`${self.options.completeInfo.modal}__content`).fadeOut(() => { - $(`${self.options.completeInfo.modal}__success`).show(); + $('.sylius-shop-loader').toggleClass("d-none"); + $(`${this.modalValue}__content`).fadeOut(() => { + $(`${this.modalValue}__success`).show(); }); setTimeout(() => { - self.modalFadeaway(); + this.modal.hide(); + window.location.reload(); }, 2500); - } else { - $(self.options.completeInfo.modal).html(res); } - self.modalEvents(); }, - error: function (res) { - console.log(res); + error: (res) => { + $('.sylius-shop-loader').toggleClass("d-none"); + $(this.modalValue).html(res.responseText); + $('form[name=form]').on('submit', (e) => { + this.modalSubmit(e); + }); }, }); } - modalEvents() { - $('.close').on('click', () => { - this.modalFadeaway(); - }); - $('form[name=form]').on('submit', (e) => { - this.modalSubmit(e); - }); - } } diff --git a/assets/shop/dist/payment/index.css b/assets/shop/dist/payment/index.css new file mode 100644 index 00000000..bb6bfa52 --- /dev/null +++ b/assets/shop/dist/payment/index.css @@ -0,0 +1,252 @@ +.oney-payment-choice__item label, .payplug-payment-choice__item label { + margin-top: 0 !important; + padding: 1em !important; + display: flex !important +} + +.oney-payment-choice, .payplug-payment-choice { + display: none +} + +.oney-payment-choice__container, .payplug-payment-choice__container { + margin: 1rem 0; + display: flex +} + +.oney-payment-choice__header p, .payplug-payment-choice__header p { + color: #000; + margin: .5em 0 !important +} + +.oney-payment-choice__item, .payplug-payment-choice__item { + flex: auto +} + +.oney-payment-choice__item--oney_x3_with_fees, .oney-payment-choice__item--oney_x3_without_fees, .payplug-payment-choice__item--oney_x3_with_fees, .payplug-payment-choice__item--oney_x3_without_fees { + margin-right: 1em +} + +.oney-payment-choice__item input, .payplug-payment-choice__item input { + display: none +} + +.oney-payment-choice__item input:checked + label, .payplug-payment-choice__item input:checked + label { + background-color: #81bc0021; + border-color: #81bc00 +} + +.oney-payment-choice__item input:checked + label.payplug-payment-choice__label, .payplug-payment-choice__item input:checked + label.payplug-payment-choice__label { + background-color: #8fd2b821; + border-color: #8fd2b8 +} + +.oney-payment-choice__item label, .payplug-payment-choice__item label { + width: 100%; + height: 100%; + cursor: pointer; + border: 1px solid #ccc; + border-radius: .285714rem; + flex-direction: column; + transition: border-color, background-color .3s ease-in-out; + position: relative; + box-shadow: 0 1px 2px #22242626 +} + +.oney-payment-choice__item label img, .payplug-payment-choice__item label img { + vertical-align: text-bottom +} + +.oney-payment-choice__content, .payplug-payment-choice__content { + display: contents +} + +.oney-payment-choice__content p, .payplug-payment-choice__content p { + color: #000; + border-bottom: 1px solid #ccc; + flex-wrap: wrap; + justify-content: space-between; + display: flex; + margin: 0 !important; + padding: .75rem 0 !important +} + +.oney-payment-choice__content p:nth-last-of-type(2), .payplug-payment-choice__content p:nth-last-of-type(2) { + margin-bottom: 1rem !important +} + +.oney-payment-choice__content p:last-of-type, .payplug-payment-choice__content p:last-of-type { + border: none; + margin-top: auto !important; + margin-bottom: 0 !important +} + +.oney-payment-choice__content p.oney-without-fees-financing, .payplug-payment-choice__content p.oney-without-fees-financing { + display: inline-block +} + +.oney-payment-choice__content small, .payplug-payment-choice__content small { + margin-top: .5rem; + font-size: 80% +} + +.oney-payment-choice__tab { + display: none +} + +.oney-payment-choice__header { + text-align: center; + margin: 0 auto +} + +[data-gateway=oney] { + margin-top: 10px !important; + padding: 0 !important +} + +.payment-item .oney-logo[src*=without-fees] { + max-width: 200px +} + +.payment-item apple-pay-button { + --apple-pay-button-width: 222px; + --apple-pay-button-height: 40px; + --apple-pay-button-border-radius: 4px; + --apple-pay-button-padding: 4px 4px; + --apple-pay-button-box-sizing: border-box; + min-width: 140px; + max-width: 100%; + transition: background-color .3s ease-in-out; + display: none +} + +.payment-item apple-pay-button.enabled { + display: block +} + +.payment-item label { + cursor: pointer +} + +.payment-item .bancontact-method label, .payment-item .apple-pay-method label, .payment-item .american-express-method label { + position: relative +} + +.payment-item .bancontact-method label img, .payment-item .apple-pay-method label img, .payment-item .american-express-method label img { + margin-left: .5em; + position: absolute; + top: -12px; + left: 100% +} + +.payplug-payment-choice__container { + flex-direction: column +} + +.payplug-payment-choice__item { + margin-bottom: 1em +} + +.payplug-payment-choice__header { + justify-content: space-between; + align-items: center; + display: flex +} + +.payplug-payment-choice__header .card-expiry span { + font-weight: 700 +} + +.oney-complete-info-popin { + max-width: 480px; + margin: auto; +} + +.oney-complete-info-popin__content ul { + padding: 0; + list-style: none +} + +.oney-complete-info-popin__success { + display: none +} + +.payment-label-with-image::after { + content: ""; + background-image: var(--logo); + display: inline-block; + width: 60px; + height: 25px; + background-repeat: no-repeat; + background-position: 0 -11px; + background-size: 60px 45px; + float: right +} + +.bancontact-label::after { + margin-left: 5px +} + +@media screen and (max-width: 991px) { + .oney-payment-choice__container, .payplug-payment-choice__container { + display: block + } + + .oney-payment-choice__content small, .payplug-payment-choice__content small { + width: 100% + } + + .oney-payment-choice__tab { + justify-content: space-between; + display: flex + } + + .oney-payment-choice__tab .tablink { + text-align: center; + border: 1px solid #ccc; + border-bottom: 0; + flex: 1; + padding: 1rem 0 + } + + .oney-payment-choice__tab .tablink.active { + border-bottom: 5px solid #81bc00 + } + + .oney-payment-choice__tab .tablink p { + color: #000 + } + + .oney-payment-choice__tab .tablink:first-of-type { + border-right: 0 + } + + .oney-payment-choice__tab .tablink > .oney-payment__image { + max-width: 120px + } + + .oney-payment-choice__header, .oney-payment-choice__item { + display: none + } + + .oney-payment-choice__item input:checked + label { + background-color: #fff; + border-color: #ccc + } + + .oney-payment-choice__item label { + border-top-left-radius: 0; + border-top-right-radius: 0 + } + + .oney-payment-choice__item--oney_x3_with_fees, .oney-payment-choice__item--oney_x3_without_fees { + margin-bottom: 1rem; + margin-right: 0; + display: block + } +} + +@media screen and (max-width: 480px) { + .payplug-payment-choice__header, .payplug-payment-choice__header .card-type, .payplug-payment-choice__header .card-expiry { + display: block + } +} diff --git a/config/twig_hooks/shop.yaml b/config/twig_hooks/shop.yaml index 3b6a1346..2fd86c0e 100644 --- a/config/twig_hooks/shop.yaml +++ b/config/twig_hooks/shop.yaml @@ -20,6 +20,10 @@ sylius_twig_hooks: template: "@PayPlugSyliusPayPlugPlugin/shop/saved_cards/index/_subcontent.html.twig" priority: 10 + 'sylius_shop.checkout.select_payment': + modal: + template: '@PayPlugSyliusPayPlugPlugin/shared/modal/index.html.twig' + priority: 0 # TODO: check if this is possible only on select_payment page 'sylius_shop.checkout#stylesheets': diff --git a/templates/form/complete_info_popin.html.twig b/templates/form/complete_info_popin.html.twig index b7ec8455..80165aaa 100644 --- a/templates/form/complete_info_popin.html.twig +++ b/templates/form/complete_info_popin.html.twig @@ -1,35 +1,17 @@ -
-
- - - -
+{% form_theme form '@SyliusShop/form/theme.html.twig' %} + +
-
-

{{ 'payplug_sylius_payplug_plugin.form.complete_info.missing_title'|trans }}

-
{{ form_start(form, {'attr': {'class': 'ui form loadable', 'novalidate': 'novalidate'}}) }} {% set phoneField = form.billing_phone ?? form.shipping_phone ?? form.phone ?? null %} {% if phoneField is not null %} -
- - {{ form_widget(phoneField, {attr: {class: 'required'}}) }} - {{ form_errors(phoneField) }} -
+ {{ form_row(phoneField, {attr: {class: 'required'}}) }} {% endif %} {% if form.email is defined %} -
- - {{ form_widget(form.email, {attr: {class: 'required'}}) }} - {{ form_errors(form.email) }} -
+ {{ form_row(form.email, {attr: {class: 'required'}}) }} {% endif %}
- {{ form_widget(form.submit, { label: 'payplug_sylius_payplug_plugin.form.complete_info.submit', attr: { class: 'ui large primary button' }}) }} - {{ 'payplug_sylius_payplug_plugin.ui.cancel'|trans }} + {{ form_row(form.submit, { label: 'payplug_sylius_payplug_plugin.form.complete_info.submit', attr: { class: 'btn btn-primary' }}) }}
{{ form_rest(form) }} {{ form_end(form) }} diff --git a/templates/form/sylius_checkout_select_payment_row.html.twig b/templates/form/sylius_checkout_select_payment_row.html.twig index 26daee22..f6b2ae7b 100644 --- a/templates/form/sylius_checkout_select_payment_row.html.twig +++ b/templates/form/sylius_checkout_select_payment_row.html.twig @@ -23,6 +23,7 @@ + +
\ No newline at end of file diff --git a/templates/shop/select_payment/_oney.html.twig b/templates/shop/select_payment/_oney.html.twig index 894d0498..3536fbf8 100644 --- a/templates/shop/select_payment/_oney.html.twig +++ b/templates/shop/select_payment/_oney.html.twig @@ -12,7 +12,20 @@ {% set showOney = true %} {% endif %} -
+{% set values = { + modal: '.oney-complete-info-popin', + area: 'body[data-route=sylius_shop_checkout_select_payment]' +} %} + +{% if app.session is not null and app.session.get('oney_has_error') == true %} + {% set completeInfoRoute = {route: path('payplug_sylius_oney_complete_info') ~ '?tokenValue=' ~ order.tokenValue} %} + {% set values = values|merge(completeInfoRoute) %} +{% endif %} + +
{% if factoryName == oneyFactoryName %} {% if showOney %} -
+
{{ form_row(form.parent.parent.oney_payment_choice) }}
- {% if app.session is not null and app.session.get('oney_has_error') == true %} - {# TODO: Move that in controller?#} - - {% endif %} {% endif %}
diff --git a/templates/shop/select_payment/_payplug.html.twig b/templates/shop/select_payment/_payplug.html.twig index b419d6c2..98d2b3e1 100644 --- a/templates/shop/select_payment/_payplug.html.twig +++ b/templates/shop/select_payment/_payplug.html.twig @@ -27,7 +27,11 @@ {% if hasSavedCards %} -
+
{{ form_row(form.parent.parent.payplug_card_choice) }}
{% endif %} From 4d2cadd5573cfb9c6e5ac00a6a0ded177e08fcab Mon Sep 17 00:00:00 2001 From: maxperei Date: Tue, 24 Jun 2025 13:19:09 +0200 Subject: [PATCH 051/112] feat(checkout): [applepay] migrate to stimulus --- assets/package.json | 6 + .../shop/controllers/apple-pay_controller.js | 166 ++++++++++ assets/shop/payment/index.js | 287 ------------------ .../shop/select_payment/_apple_pay.html.twig | 8 +- 4 files changed, 178 insertions(+), 289 deletions(-) create mode 100644 assets/shop/controllers/apple-pay_controller.js delete mode 100644 assets/shop/payment/index.js diff --git a/assets/package.json b/assets/package.json index 530a870f..0f85c9ce 100644 --- a/assets/package.json +++ b/assets/package.json @@ -54,6 +54,12 @@ "webpackMode": "lazy", "fetch": "lazy", "enabled": true + }, + "apple-pay": { + "main": "shop/controllers/apple-pay_controller.js", + "webpackMode": "lazy", + "fetch": "lazy", + "enabled": true } } }, diff --git a/assets/shop/controllers/apple-pay_controller.js b/assets/shop/controllers/apple-pay_controller.js new file mode 100644 index 00000000..3575f902 --- /dev/null +++ b/assets/shop/controllers/apple-pay_controller.js @@ -0,0 +1,166 @@ +import { Controller } from '@hotwired/stimulus'; +import $ from 'jquery'; + +/* stimulusFetch: 'lazy' */ +export default class extends Controller { + connect() { + this.applePayHandler(); + } + showApplePayButton() { + const applePayButton = $(document).find("apple-pay-button"); + if (applePayButton.length) { + applePayButton.addClass('enabled'); + } + } + hideApplePayButton() { + const applePayButton = $(document).find("apple-pay-button.enabled"); + if (applePayButton.length) { + applePayButton.removeClass('enabled'); + } + } + applePayHandler() { + const applePayChoice = $(".payment-item .checkbox-applepay input:radio"); + if (applePayChoice) { + if (applePayChoice.is(':checked')) { + this.disableNextStepButton(); + this.showApplePayButton(); + } else { + this.enableNextStepButton(); + this.hideApplePayButton(); + } + } + $(".payment-item .checkbox input:radio").on('change', this.onPaymentMethodChoice); + $(document).find("apple-pay-button").on('click', this.onApplePayButtonClick); + } + onPaymentMethodChoice(event) { + const isApplePay = $(event.currentTarget).closest('.checkbox-applepay').length; + if (isApplePay) { + this.showApplePayButton(); + this.disableNextStepButton(); + } else { + this.hideApplePayButton(); + this.enableNextStepButton(); + } + } + onApplePayButtonClick(event) { + const applePayButton = $(event.currentTarget); + + if (applePaySessionRequestSettings === undefined) { + console.error('Invalid Apple Pay settings!'); + return false; + } + + // Create ApplePaySession + const session = new ApplePaySession(3, applePaySessionRequestSettings); + + session.onvalidatemerchant = async event => { + $.ajax({ + url: applePayButton.data('validate-merchant-route'), + method: 'POST', + cache: false, + data: {}, + success: (authorization) => { + let result = authorization.merchant_session; + console.log(result); + + if (authorization.success === true) { + console.log(authorization.merchant_session); + session.completeMerchantValidation(result); + } else { + session.abort(); + } + }, + error: (XHR, status, error) => { + console.log(XHR, status, error); + session.abort(); + window.location.reload(); + }, + }); + }; + + session.onpaymentauthorized = event => { + $.ajax({ + url: applePayButton.data('payment-authorized-route'), + method: 'POST', + cache: false, + data: { + token: event.payment.token + }, + success: (authorization) => { + try { + var apple_pay_Session_status = ApplePaySession.STATUS_SUCCESS; + + console.log(authorization); + console.log(authorization.data.responseToApple.status); + if (authorization.data.responseToApple.status != 1) { + apple_pay_Session_status = ApplePaySession.STATUS_FAILURE; + } + + const result = { + "status": apple_pay_Session_status + }; + + console.log(apple_pay_Session_status); + console.log(result); + + session.completePayment(result); + + console.log(authorization.data.returnUrl); + window.location.href = authorization.data.returnUrl; + } catch (err) { + console.error(err); + window.location.reload(); + } + }, + error: (XHR, status, error) => { + console.log(XHR, status, error); + session.abort(); + window.location.reload(); + }, + }); + }; + + session.oncancel = event => { + console.log('Cancelling Apple Pay session!'); + + $.ajax({ + url: applePayButton.data('session-cancel-route'), + cache: false, + method: 'POST', + data: {}, + success: (authorization) => { + console.log('Cancelled!'); + console.log(authorization.data.returnUrl); + window.location.href = authorization.data.returnUrl; + }, + error: (XHR, status, error) => { + console.log(XHR, status, error); + window.location.reload(); + }, + }); + }; + + session.begin(); + } + disableNextStepButton() { + const nextStepButton = $('form[name="sylius_shop_checkout_select_payment"] [data-test-next-step]'); + nextStepButton.replaceWith( + $("", { + id: 'next-step', + class: 'btn btn-primary btn-icon', + html: nextStepButton.html() + }) + ); + } + enableNextStepButton() { + const nextStepButton = $('form[name="sylius_shop_checkout_select_payment"] [data-test-next-step]'); + nextStepButton.replaceWith( + $("