I've installed Payum in my Symfony 5 project (using these instructions ). When I try to call the route /payment/capture/qrak82BzjIVUnylasjXwwC5q3DKw7EPJYQ1z1IYHaHY
Symfony finds the route but doesn't even arrive to open the relative controller, because it gives me the error:
"Payum\Bundle\PayumBundle\Controller\CaptureController" has no container set, did you forget to define it as a service subscriber"?
I googled for that error, but it seems extremely rare and I don't understand how to fix the problem.
Asked
Active
Viewed 651 times
1

lorenzo89
- 21
- 2
2 Answers
0
I found the answer at https://github.com/Payum/Payum/issues/850
zspine commented 25 days ago
As a temporary fix I have configured the service manually under config/services.yaml
and it works ...
Payum\Bundle\PayumBundle\Controller\CaptureController:
calls:
- [setContainer, ['@service_container']]
Also digging deeper from that post, theres a link to https://github.com/Payum/PayumBundle/issues/507
Having more of the services
config/services.yaml
services:
Payum\Bundle\PayumBundle\Controller\AuthorizeController:
calls:
- method: setContainer
arguments: ['@service_container']
Payum\Bundle\PayumBundle\Controller\CancelController:
calls:
- method: setContainer
arguments: ['@service_container']
Payum\Bundle\PayumBundle\Controller\CaptureController:
calls:
- method: setContainer
arguments: ['@service_container']
Payum\Bundle\PayumBundle\Controller\NotifyController:
calls:
- method: setContainer
arguments: ['@service_container']
Payum\Bundle\PayumBundle\Controller\PayoutController:
calls:
- method: setContainer
arguments: ['@service_container']
Payum\Bundle\PayumBundle\Controller\RefundController:
calls:
- method: setContainer
arguments: ['@service_container']
Payum\Bundle\PayumBundle\Controller\SyncController:
calls:
- method: setContainer
arguments: ['@service_container']
0
Looks like a misconfiguration issue from code owners, you can auto tag entire directory:
# config/services.yaml
Payum\Bundle\PayumBundle\Controller\:
resource: '../vendor/payum/payum-bundle/Controller/*'
tags: ['controller.service_arguments']

Mike Doe
- 16,349
- 11
- 65
- 88