diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 83f45ee4..db615520 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -14,37 +14,53 @@ jobs:
tests:
runs-on: ubuntu-latest
- name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, wkhtmltopdf: ${{ matrix.wkhtmltopdf }}"
+ name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, wkhtmltopdf: ${{ matrix.wkhtmltopdf }}, State Machine Adapter ${{ matrix.state_machine_adapter }}"
strategy:
fail-fast: false
matrix:
- php: ["8.0", "8.1"]
- symfony: ["^5.4", "^6.0"]
- sylius: ["~1.11.10", "~1.12.0"]
- node: ["16.x"]
- mysql: ["5.7", "8.0"]
+ php: ["8.1", "8.2"]
+ symfony: ["^5.4.21", "^6.4"]
+ sylius: ["~1.12.0", "~1.13.x-dev",]
+ node: ["20.x"]
+ mysql: ["8.0"]
wkhtmltopdf: ["0.12.6-1"]
+ state_machine_adapter: [ "winzou_state_machine", "symfony_workflow" ]
include:
-
- php: "8.1"
- symfony: "^6.0"
+ php: "8.3"
+ symfony: "^6.4"
+ sylius: "~1.13.x-dev"
+ node: "20.x"
+ mysql: "8.0"
+ wkhtmltopdf: "0.12.6-1"
+ state_machine_adapter: "symfony_workflow"
+ -
+ php: "8.2"
+ symfony: "^6.4"
sylius: "~1.12.0"
- node: "16.x"
+ node: "20.x"
+ mysql: "8.0"
+ wkhtmltopdf: false
+ state_machine_adapter: "winzou_state_machine"
+ -
+ php: "8.2"
+ symfony: "^6.4"
+ sylius: "~1.13.x-dev"
+ node: "20.x"
mysql: "8.0"
wkhtmltopdf: false
+ state_machine_adapter: "symfony_workflow"
exclude:
- - php: "8.0"
- symfony: "^6.0"
-
- - symfony: "^6.0"
- sylius: "~1.11.10"
+ - sylius: "~1.12.0"
+ state_machine_adapter: "symfony_workflow"
env:
APP_ENV: test
DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}"
+ TEST_SYLIUS_STATE_MACHINE_ADAPTER: "${{ matrix.state_machine_adapter }}"
steps:
-
diff --git a/README.md b/README.md
index 946af26c..7d5f6770 100644
--- a/README.md
+++ b/README.md
@@ -73,10 +73,9 @@ Symfony Flex, it's much quicker! :)
## Extension points
-Majority of actions contained in SyliusInvoicingPlugin is executed once an event after changing the state of
-the Order on `winzou_state_machine` is dispatched.
+Majority of actions contained in SyliusInvoicingPlugin is executed once an event after changing the state of the Order.
-Here is the example:
+Here is the example for `Winzou State Machine`:
```yaml
winzou_state_machine:
@@ -92,6 +91,17 @@ winzou_state_machine:
Code placed above is a part of configuration placed in `config.yml` file.
You can customize this file by adding new state machine events listeners or editing existing ones.
+Here is the example for Symfony's `workflow`:
+
+```xml
+
+
+
+
+
+```
+
Apart from that an Invoice model is treated as a Resource.
You can read more about Resources here:
diff --git a/UPGRADE.md b/UPGRADE.md
index 07fd24a7..c23bad1f 100644
--- a/UPGRADE.md
+++ b/UPGRADE.md
@@ -1,4 +1,11 @@
-### UPGRADE FROM 0.23.X TO 0.24.0
+### UPGRADE FROM 0.24.X TO 0.25.0
+
+1. Support for Sylius 1.13 has been added, it is now the recommended Sylius version to use with InvoicingPlugin.
+2. Support for Sylius 1.11 has been dropped, upgrade your application to [Sylius 1.12](https://github.com/Sylius/Sylius/blob/master/UPGRADE-1.12.md).
+ or to [Sylius 1.13](https://github.com/Sylius/Sylius/blob/master/UPGRADE-1.13.md).
+3. Support for PHP 8.0 has been dropped.
+
+### UPGRADE FROM 0.23.1 TO 0.24.0
1. Support for Sylius 1.12 has been added, it is now the recommended Sylius version to use with InvoicingPlugin.
2. Support for Sylius 1.10 has been dropped, upgrade your application to [Sylius 1.11](https://github.com/Sylius/Sylius/blob/master/UPGRADE-1.11.md).
diff --git a/composer.json b/composer.json
index 0788d176..a2194705 100644
--- a/composer.json
+++ b/composer.json
@@ -5,51 +5,51 @@
"description": "Invoicing plugin for Sylius.",
"license": "MIT",
"require": {
- "php": "^8.0",
+ "php": "^8.1",
"knplabs/knp-snappy-bundle": "^1.8",
"ramsey/uuid": "^3.9 || ^4.0",
- "sylius/grid-bundle": "^1.7",
- "sylius/resource-bundle": "^1.6",
- "sylius/sylius": "~1.11.0 || ~1.12.0",
- "symfony/config": "^5.4 || ^6.0",
- "symfony/dependency-injection": "^5.4 || ^6.0",
- "symfony/form": "^5.4 || ^6.0",
- "symfony/framework-bundle": "^5.4 || ^6.0",
- "symfony/http-foundation": "^5.4 || ^6.0",
- "symfony/http-kernel": "^5.4 || ^6.0",
- "symfony/messenger": "^5.4 || ^6.0",
- "symfony/options-resolver": "^5.4 || ^6.0",
- "symfony/routing": "^5.4 || ^6.0"
+ "sylius/grid-bundle": "^1.9",
+ "sylius/resource-bundle": "^1.9",
+ "sylius/sylius": "~1.12.0 || ~1.13.x-dev",
+ "symfony/config": "^5.4 || ^6.4",
+ "symfony/dependency-injection": "^5.4.21 || ^6.4",
+ "symfony/form": "^5.4.21 || ^6.4",
+ "symfony/framework-bundle": "^5.4.21 || ^6.4",
+ "symfony/http-foundation": "^5.4.21 || ^6.4",
+ "symfony/http-kernel": "^5.4.21 || ^6.4",
+ "symfony/messenger": "^5.4.21 || ^6.4",
+ "symfony/options-resolver": "^5.4.21 || ^6.4",
+ "symfony/routing": "^5.4.21 || ^6.4"
},
"require-dev": {
"behat/behat": "^3.6.1",
- "behat/mink-selenium2-driver": "^1.4",
+ "behat/mink-selenium2-driver": "~1.6.0",
"friends-of-behat/exclude-specifications-extension": "^0.2 || ^0.3",
"friends-of-behat/mink": "^1.8",
- "friends-of-behat/mink-browserkit-driver": "^1.3",
+ "friends-of-behat/mink-browserkit-driver": "^1.4",
"friends-of-behat/mink-debug-extension": "^2.0",
- "friends-of-behat/mink-extension": "^2.3",
+ "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",
- "matthiasnoback/symfony-config-test": "^4.0",
- "matthiasnoback/symfony-dependency-injection-test": "^4.1",
- "phpspec/phpspec": "^7.0",
+ "matthiasnoback/symfony-config-test": "^4.2",
+ "matthiasnoback/symfony-dependency-injection-test": "^4.2",
+ "phpspec/phpspec": "^7.2",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-doctrine": "^1.3",
"phpstan/phpstan-symfony": "^1.2",
"phpstan/phpstan-webmozart-assert": "^1.2",
- "phpunit/phpunit": "^8.5",
+ "phpunit/phpunit": "^9.5",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"sylius-labs/coding-standard": "~4.0.0",
- "symfony/browser-kit": "^5.4 || ^6.0",
- "symfony/debug-bundle": "^5.4 || ^6.0",
- "symfony/dotenv": "^5.4 || ^6.0",
+ "symfony/browser-kit": "^5.4.21 || ^6.4",
+ "symfony/debug-bundle": "^5.4.21 || ^6.4",
+ "symfony/dotenv": "^5.4.21 || ^6.4",
"symfony/intl": "^5.4 || ^6.0",
"symfony/webpack-encore-bundle": "^1.15",
- "symfony/web-profiler-bundle": "^5.4 || ^6.0"
+ "symfony/web-profiler-bundle": "^5.4.21 || ^6.4"
},
"autoload": {
"psr-4": {
diff --git a/features/managing_invoices/filtering_invoices.feature b/features/managing_invoices/filtering_invoices.feature
index 6a9dd6bc..ad6b5092 100644
--- a/features/managing_invoices/filtering_invoices.feature
+++ b/features/managing_invoices/filtering_invoices.feature
@@ -12,7 +12,7 @@ Feature: Filtering invoices
And the store has a zone "Germany + France" with code "DE + FR"
And this zone has the "Germany" country member
And this zone has the "France" country member
- And the store has a product "PHP T-Shirt" priced at "€10" available in channel "WEB-DE" and channel "WEB-FR"
+ And the store has a product "PHP T-Shirt" priced at "€10.00" available in channel "WEB-DE" and channel "WEB-FR"
And the store ships everywhere for free for all channels
And the store allows paying offline for all channels
And there is a customer "john.doe@gmail.com" that placed an order "#00000022"
diff --git a/features/managing_invoices/seeing_invoice_with_items_and_shipments_having_promotion_applied.feature b/features/managing_invoices/seeing_invoice_with_items_and_shipments_having_promotion_applied.feature
index f43efa24..cb2863de 100644
--- a/features/managing_invoices/seeing_invoice_with_items_and_shipments_having_promotion_applied.feature
+++ b/features/managing_invoices/seeing_invoice_with_items_and_shipments_having_promotion_applied.feature
@@ -12,7 +12,7 @@ Feature: Seeing an invoice with items having promotion applied
And there is a promotion "50% shipping discount"
And it gives "50%" discount on shipping to every order
And there is a promotion "Anatomy Park Promotion"
- And this promotion gives "$1" off on every product with minimum price at "$5.00"
+ And this promotion gives "$1.00" off on every product with minimum price at "$5.00"
And there is a customer "rick.sanchez@wubba-lubba-dub-dub.com" that placed an order "#00000666"
And the customer "Lucifer Morningstar" addressed it to "Seaside Fwy", "90802" "Los Angeles" in the "United States"
And for the billing address of "Mazikeen Lilim" in the "Pacific Coast Hwy", "90806" "Los Angeles", "United States"
diff --git a/features/managing_invoices/seeing_invoice_with_items_having_promotion_applied.feature b/features/managing_invoices/seeing_invoice_with_items_having_promotion_applied.feature
index b9bca170..04018f9c 100644
--- a/features/managing_invoices/seeing_invoice_with_items_having_promotion_applied.feature
+++ b/features/managing_invoices/seeing_invoice_with_items_having_promotion_applied.feature
@@ -10,7 +10,7 @@ Feature: Seeing an invoice with items and shipment having promotion applied
And the store has "Galaxy Post" shipping method with "$20.00" fee
And the store allows paying with "Space money"
And there is a promotion "Anatomy Park Promotion"
- And this promotion gives "$10" discount to every order with items total at least "$15.00"
+ And this promotion gives "$10.00" discount to every order with items total at least "$15.00"
And there is a customer "rick.sanchez@wubba-lubba-dub-dub.com" that placed an order "#00000666"
And the customer "Lucifer Morningstar" addressed it to "Seaside Fwy", "90802" "Los Angeles" in the "United States"
And for the billing address of "Mazikeen Lilim" in the "Pacific Coast Hwy", "90806" "Los Angeles", "United States"
diff --git a/features/managing_invoices/seeing_invoice_with_taxes_included_in_price_and_promotions_applied.feature b/features/managing_invoices/seeing_invoice_with_taxes_included_in_price_and_promotions_applied.feature
index e0b3d900..4662f1c9 100644
--- a/features/managing_invoices/seeing_invoice_with_taxes_included_in_price_and_promotions_applied.feature
+++ b/features/managing_invoices/seeing_invoice_with_taxes_included_in_price_and_promotions_applied.feature
@@ -12,7 +12,7 @@ Feature: Seeing included in price taxes and promotions applied on an invoice
And the store has "UPS" shipping method with "$10.00" fee
And the store allows paying with "Cash on Delivery"
And there is a promotion "Anatomy Park Promotion"
- And this promotion gives "$10" off on every product with minimum price at "$5.00"
+ And this promotion gives "$10.00" off on every product with minimum price at "$5.00"
And there is a customer "lucy@teamlucifer.com" that placed an order "#00000666"
And the customer bought 2 "PHP T-Shirt" products
And the customer "Lucifer Morningstar" addressed it to "Seaside Fwy", "90802" "Los Angeles" in the "United States"
diff --git a/src/EventListener/Workflow/Payment/ProduceOrderPaymentPaidListener.php b/src/EventListener/Workflow/Payment/ProduceOrderPaymentPaidListener.php
new file mode 100644
index 00000000..bf6f6c4c
--- /dev/null
+++ b/src/EventListener/Workflow/Payment/ProduceOrderPaymentPaidListener.php
@@ -0,0 +1,37 @@
+getSubject();
+ Assert::isInstanceOf($payment, PaymentInterface::class);
+
+ $this->orderPaymentPaidProducer->__invoke($payment);
+ }
+}
diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml
index 4d93ff3a..fda610e9 100644
--- a/src/Resources/config/services.xml
+++ b/src/Resources/config/services.xml
@@ -2,7 +2,7 @@
-
+
@@ -11,7 +11,7 @@
-
+
diff --git a/src/Resources/config/services/actions.xml b/src/Resources/config/services/actions.xml
index f86ea25b..88e74775 100644
--- a/src/Resources/config/services/actions.xml
+++ b/src/Resources/config/services/actions.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/src/Resources/config/services/cli.xml b/src/Resources/config/services/cli.xml
index f79d6628..00975c36 100644
--- a/src/Resources/config/services/cli.xml
+++ b/src/Resources/config/services/cli.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/src/Resources/config/services/converters.xml b/src/Resources/config/services/converters.xml
index c2c75d21..da25fa26 100644
--- a/src/Resources/config/services/converters.xml
+++ b/src/Resources/config/services/converters.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/src/Resources/config/services/fixtures.xml b/src/Resources/config/services/fixtures.xml
index 3dbc5c3d..6199cdb6 100644
--- a/src/Resources/config/services/fixtures.xml
+++ b/src/Resources/config/services/fixtures.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/src/Resources/config/services/generators.xml b/src/Resources/config/services/generators.xml
index 8b8abb92..a819f479 100644
--- a/src/Resources/config/services/generators.xml
+++ b/src/Resources/config/services/generators.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/src/Resources/config/services/events.xml b/src/Resources/config/services/listeners.xml
similarity index 96%
rename from src/Resources/config/services/events.xml
rename to src/Resources/config/services/listeners.xml
index 4e2f50ef..576ea7d8 100644
--- a/src/Resources/config/services/events.xml
+++ b/src/Resources/config/services/listeners.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/src/Resources/config/services/listeners/workflow.xml b/src/Resources/config/services/listeners/workflow.xml
new file mode 100644
index 00000000..4440453b
--- /dev/null
+++ b/src/Resources/config/services/listeners/workflow.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Resources/config/services/ui.xml b/src/Resources/config/services/ui.xml
index 7706cb10..0010bdb5 100644
--- a/src/Resources/config/services/ui.xml
+++ b/src/Resources/config/services/ui.xml
@@ -2,7 +2,7 @@
-
+