These are chat archives for Payum/Payum

11th
Apr 2018
Khairi Husseini
@khusseini
Apr 11 17:25

Hello everyone. I'm tinkering with the payum integration in symfony and added a new factory and a capture action. When I trigger the payment, I get the Exception

Type error: Argument 1 passed to Payum\Core\Gateway::addAction() must implement interface Payum\Core\Action\ActionInterface, string given, called in /var/www/app/vendor/payum/core/Payum/Core/CoreGatewayFactory.php on line 219

The stack trace shows the following call Gateway->addAction('@app.payum_action.payone.capture_order', false)

This is how I registered the factory and the action. What am I doing wrong?

    app.payum.payone.factory:
      class: Payum\Core\Bridge\Symfony\Builder\GatewayFactoryBuilder
      arguments: [Valiton\Payum\Payone\PayoneGatewayFactory]
      tags:
      - name: payum.gateway_factory_builder
        factory: payone

    # Overrides \Valiton\Payum\Payone\Action\CaptureAction
    app.payum_action.payone.capture_order:
      class: AppBundle\Action\Payone\CaptureOrderAction
      arguments:
      - '@coreshop.repository.order'
      - '@coreshop.state_machine_applier'
      tags:
      - name: payum.action
        factory: payone
Khairi Husseini
@khusseini
Apr 11 20:18
Ah oki, the symfony service entry needs to be public because the ContainerAwareCoreGatewayFactory uses the symfony container directly to add the action