No description
Find a file
Grzegorz Sadowski 9b6799e2b8
Some checks failed
Continuous Integration (Minimal) / Tests (MariaDB) (push) Has been cancelled
Continuous Integration (Minimal) / Static checks (push) Has been cancelled
Continuous Integration (Minimal) / Tests (MySQL) (push) Has been cancelled
Continuous Integration (Minimal) / Javascript Tests (MySQL) (push) Has been cancelled
Continuous Integration (Minimal) / Tests (PostgreSQL) (push) Has been cancelled
Continuous Integration (Minimal) / Frontend (push) Has been cancelled
Continuous Integration (Minimal) / Packages (push) Has been cancelled
[PayumBundle] Remove dependency on RequestConfiguration in PayumPayResponseProvider (#19082)
| Q               | A
|-----------------|-----
| Branch?         | 2.3
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | yes
| Related tickets | none
| License         | MIT

This PR removes the dependency of `PayumPayResponseProvider` on
`RequestConfiguration` (from `Sylius\Bundle\ResourceBundle\Controller`)
to retrieve the after-pay redirect route.

Previously, the redirect route used to build the Payum capture/authorize
token was read at runtime from the `_sylius` routing metadata via
`$requestConfiguration->getParameters()->get('redirect')`. This approach
was coupled to the ResourceBundle routing convention and required the
route definition to carry this information through the request
lifecycle.

---

### Changes

**`PayumPayResponseProvider`**
- Added two constructor parameters: `?string $afterPayUrlRoute` and
`array $afterPayUrlParameters`, injected at compile time.
- Removed the dynamic reading of
`$requestConfiguration->getParameters()->get('redirect')` at runtime.
- Simplified `provideTokenBasedOnPayment()` to use the injected
parameters directly, eliminating its `$redirectOptions` argument.

**`ShopBundle` configuration** (`Configuration.php`)
- Added two new `order_pay` configuration keys dedicated to Payum:
`payum_after_pay_route` (default: `sylius_shop_order_after_pay`) and
`payum_after_pay_route_parameters` (default: `[]`).
- These are intentionally separate from the existing `after_pay_route`
and `after_pay_route_parameters` keys, which are reserved for the
Payment Request flow and carry Payment Request-specific defaults (e.g.
`hash: paymentRequest.getHash()`).

**`ShopBundle` extension** (`SyliusShopExtension.php`)
- Exposes `%sylius_shop.order_pay.payum_after_pay_route%` and
`%sylius_shop.order_pay.payum_after_pay_route_parameters%` as container
parameters.

**`PayumBundle` service definition**
(`integrations/sylius_shop/order_pay/providers.php`)
- The `sylius_shop.provider.order_pay.pay_response.payum` service now
explicitly injects `%sylius_shop.order_pay.payum_after_pay_route%` and
`%sylius_shop.order_pay.payum_after_pay_route_parameters%` as
constructor arguments.

**`ShopBundle` routing** (`order.yml`)
- Removed the `_sylius.redirect` block from the `sylius_shop_order_pay`
route, which is no longer needed since the redirect route is now
resolved through the container parameter.

**`UPGRADE-2.3.md`**
- Documented the routing change and the migration path for projects that
customized the after-pay redirect route via the `_sylius` routing
metadata.

---

### Motivation

- Decouples `PayumPayResponseProvider` from the ResourceBundle
controller infrastructure (`RequestConfiguration`).
- Makes the after-pay redirect route an explicit, inspectable, and
overridable service configuration rather than an implicit routing
convention.
- Aligns with the ongoing effort to reduce reliance on
`Sylius\Bundle\ResourceBundle\Controller` in the PaymentRequest feature.

---

### Backward Compatibility

> ⚠️ The `_sylius: redirect:` block on `sylius_shop_order_pay` is
removed from the routing. Projects that relied on overriding this
routing parameter to customize the Payum after-pay redirect route should
now use the dedicated `sylius_shop` bundle configuration keys instead:
>
> ```yaml
> sylius_shop:
>     order_pay:
>         payum_after_pay_route: sylius_shop_order_after_pay
>         payum_after_pay_route_parameters: []
> ```
>
> Note: `after_pay_route` and `after_pay_route_parameters` are reserved
for the Payment Request flow and should not be used to configure the
Payum redirect.
>
> See `UPGRADE-2.3.md` for details.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Added a migration note explaining that Payum after-pay redirects no
longer rely on `_sylius: redirect:` routing metadata and how to
configure the replacement options.

* **New Features**
* Introduced `sylius_shop.order_pay.payum_after_pay_route` and
`sylius_shop.order_pay.payum_after_pay_route_parameters` to customize
the Payum after-pay redirect target and parameters.

* **Refactor**
* Removed the automatic redirect from `sylius_shop_order_pay`; Payum
after-pay redirect is now driven by the new configuration.

* **Tests**
* Added/updated PHPUnit coverage for the new configuration defaults and
Payum after-pay redirect behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-25 10:58:58 +02:00
.bunnyshell [Bunnyshell] Increase memory limit 2025-06-11 14:47:51 +02:00
.docker [Docker] Refactor: fix entrypoint, align formatting and add semicolon 2024-12-04 09:46:33 +01:00
.github Remove old branches from refactor CI 2026-06-22 08:44:55 +02:00
adr [ADR] Improvements for PHPSpec migration after code review 2025-04-07 10:53:16 +02:00
bin Perform the repository's main directory cleanup 2023-09-21 13:02:23 +02:00
config Use PSR-6 cache pools directly for ORM 3.x compatibility 2026-06-17 14:33:43 +02:00
etc/build Merge branch '1.13' into 2.0 2024-02-05 10:32:37 +01:00
features Resolve conflicts between 2.1 and 2.2 2026-06-02 12:21:47 +02:00
public [maintenance] - Use symfony runtime component 2022-11-02 19:56:55 +01:00
src [PayumBundle] Remove dependency on RequestConfiguration in PayumPayResponseProvider (#19082) 2026-06-25 10:58:58 +02:00
templates [API] Slim down Swagger UI override and drop broken auto-auth JS 2026-05-25 10:44:45 +02:00
tests Make clock datetimeimmutable compatible with datetime type in mapping 2026-06-17 14:33:45 +02:00
translations [Maintenance] Update composer, bundles and symfony lock 2020-09-04 14:29:26 +02:00
.babelrc Bump JS dependencies' versions 2022-09-16 16:40:17 +02:00
.dockerignore [Bunnyshell] Adjust the workflows for Fork PRs 2023-06-30 12:42:49 +03:00
.editorconfig Remove phpspec entirely 2025-05-29 14:23:35 +02:00
.env [CI] Configure runtime mode to prevent error pages in tests 2025-11-27 11:47:49 +01:00
.env.test [CI] Configure runtime mode to prevent error pages in tests 2025-11-27 11:47:49 +01:00
.env.test_cached [CI] Configure runtime mode to prevent error pages in tests 2025-11-27 11:47:49 +01:00
.env.test_cached_payum [CI] Configure runtime mode to prevent error pages in tests 2025-11-27 11:47:49 +01:00
.gitattributes [CI] Drop RoboFile.php export-ignore after robo removal 2026-06-16 13:58:56 +02:00
.gitignore [Behat] Convert main config from YAML to PHP 2026-02-24 15:33:10 +01:00
.npmignore Prepare for releasing @sylius-ui/frontend npm package 2022-11-10 16:58:57 +01:00
.readthedocs.yaml [Documentation] Add configuration file for Read the Docs 2024-01-26 09:58:59 +01:00
AGENTS.md [DX] Improve AI contribution guidelines with reference files and patterns 2026-01-09 14:48:43 +01:00
behat.dist.php [Behat] Convert main config from YAML to PHP 2026-02-24 15:33:10 +01:00
CHANGELOG-2.0.md Generate changelog for v2.0.13 2025-09-09 13:19:38 +02:00
CHANGELOG-2.1.md Generate changelog for v2.1.15 2026-06-02 12:18:44 +02:00
CHANGELOG-2.2.md Generate changelog for v2.2.6 2026-06-02 12:48:14 +02:00
CLAUDE.md Add AGENTS.md 2025-06-12 08:47:56 +02:00
composer-require-checker.json [Payum] Preserve PaymentSecurityToken BC (revert details to untyped, use custom ObjectType) 2026-06-17 14:33:45 +02:00
composer.json [Maintenance] Bump branch aliases to 2.3-dev 2026-06-22 10:34:28 +02:00
CONFLICTS.md Add conflict to api-platform/serializer 4.2.17 2026-02-25 15:18:01 +01:00
docker-compose.test.yml [Docker] Refactor: fix entrypoint, align formatting and add semicolon 2024-12-04 09:46:33 +01:00
docker-compose.yml [Docker] Add env vars to docker-compose.yml 2022-09-13 09:55:54 +02:00
ecs.php Merge branch '1.13' into 2.0 2024-04-16 12:45:01 +02:00
eslint.config.mjs Add eslint no-console rule 2024-12-17 11:12:06 +01:00
LICENSE Update LICENSE, move trademark and logo info to another file 2024-10-07 13:31:21 +02:00
LICENSE_OF_TRADEMARK_AND_LOGO Create LICENSE_OF_TRADEMARK_AND_LOGO 2024-10-07 13:34:05 +02:00
Makefile Remove phpspec entirely 2025-05-29 14:23:35 +02:00
monorepo-builder.php Fix imports in monorepo-builder config file 2025-05-29 14:40:15 +02:00
package.json Change supported versions of Node.js greater or equal than 20 2025-06-03 09:16:42 +02:00
phparkitect.php Remove phpspec entirely 2025-05-29 14:23:35 +02:00
phpstan-baseline.neon [Maintenance][Phpstan] Fix iterable value typing in bundles 2025-10-20 14:34:55 +02:00
phpstan.neon.dist Move DBAL 3.x/4.x compatibility ignore to global phpstan config 2026-06-17 14:33:43 +02:00
phpunit.xml.dist Fix Symfony 7.4 PHPUnit tests: set APP_RUNTIME_MODE=web=1 for KernelBrowser compatibility 2025-11-13 11:50:33 +01:00
README.md Update readme image url 2026-01-29 06:40:31 +01:00
rector.php Apply coderabbitai suggestions 2026-02-11 09:49:41 +01:00
SECURITY.md Refer to release process from SECURITY.md 2019-06-12 22:29:14 +08:00
symfony.lock Update symfony.lock 2026-06-18 06:16:30 +02:00
UPGRADE-2.0.md Fix formatting in UPGRADE-2.0.md 2026-03-06 09:12:45 +01:00
UPGRADE-2.1.md Add upgrade note 2026-04-08 12:52:34 +02:00
UPGRADE-2.2.md Add upgrade file note 2026-04-27 12:49:08 +02:00
UPGRADE-2.3.md feat: update after-pay configuration to use dedicated Payum keys 2026-06-22 13:30:43 +02:00
UPGRADE-API-2.0.md [Upgrade] Refine content 2024-11-21 10:09:30 +01:00
UPGRADE-API-2.1.md Check payment request ownership on POST 2026-06-02 08:50:05 +02:00
UPGRADE-API-2.2.md Update UPGRADE-API-2.2.md 2026-04-06 10:59:01 +02:00
webpack.config.js Lint project files 2024-12-16 13:41:15 +01:00

Sylius is an Open Source eCommerce framework on top of Symfony.

The highest quality of code, strong testing culture, built-in Agile (BDD) workflow and exceptional flexibility make it the best solution for applications tailored to your business requirements. Powerful REST API allows for easy integrations and creating unique customer experience on any device.

We're using full-stack Behavior-Driven-Development, with PHPUnit and Behat.

Enjoy being an eCommerce Developer again!

⚙️ Installation

Install Sylius with Composer (see requirements details).

Follow the Getting started with Sylius tutorial!

📖 Documentation

Documentation is available at docs.sylius.com.

Sylius Plus

Sylius Plus offers modular features like OnePageCheckout and a B2B suite, alongside advanced capabilities such as multi-store management, partial order fulfillment, smooth returns handling, a loyalty system and multi-source inventory. Pick and choose the modules you need to supercharge your eCommerce projects effortlessly.

🤝 Community

Get Sylius support on Slack or Stack Overflow or get professional SLA-backed support and Project Success Assistance with Sylius Plus license! Learn more.

Stay updated by following our Twitter and Facebook.

Would like to help us and build the most developer-friendly eCommerce framework? Start from reading our Contributing Guide!

👮 Security issues

If you think that you have found a security issue in Sylius, please do not use the issue tracker and do not post it publicly. Instead, all security issues must be sent to security@sylius.com.

📦 Plugins and Extensions: Sylius Store

You can find Sylius plugins on our Sylius Store which is a Marketplace with Sylius extensions.

Or search for packages marked as sylius-plugin on Packagist.

📃 License

Sylius is completely free and released under the MIT License.

✍️ Authors

Sylius was originally created by Paweł Jędrzejewski.

Kudos to all Sylius contributors 🙏

... and others!

See the full list of contributors from our awesome community.