Adyen / adyen-shopware6

Adyen Payment plugin for Shopware 6
MIT License
21 stars 22 forks source link

[PW-4183] Use EventSubscriber instead of replacing Storefront change payment method route #138

Closed AndreasA closed 3 years ago

AndreasA commented 3 years ago

Is your feature request related to a problem? Please describe. Currently you replace the Storefront change payment method route to ensure you can set the adyen data there.

However, this is can be problematic, if e.g. other plugins would do this too, e.g. multiple payment plugins.

Describe the solution you'd like These are not the only solutions but some possibilities:

acampos1916 commented 3 years ago

Thanks for opening this issue @AndreasA,

Can you point where in the plugin is the change payment method route being replaced? Just to have all the information here.

Ángel

AndreasA commented 3 years ago

This one: https://github.com/Adyen/adyen-shopware6/blob/develop/src/Storefront/Controller/AdyenAccountOrderController.php#L29

it conflicts with: https://github.com/shopware/platform/blob/d56b11d76c23c7133e062807c68b01128fa69185/src/Storefront/Controller/AccountOrderController.php#L194

you use the same route name as the default storefront controller and therefore one of those wins and as plugins are loaded after the core, yours wins.

AndreasA commented 3 years ago

If you use the controller event, you would not event need to annotate your controller with route or similar as you would rewrite the controller on the fly (which is a callable at that point).

acampos1916 commented 3 years ago

Thanks for the info @AndreasA