I have created a payum payment method. I have set up a payment form that stores the payment details and then I generate the payment security token. This all seems ok so far and payum generates the token in storage.
However, I cannot seem to register it. I don't know where I am supposed to add the actions so they are used when payment method is loaded.
I have the following questions.
- Where do I add a reference to my PaymentFactory? At the moment I load the payum extension in the bundle build method and add an instance of the PaymentFactory to the extension. Is this all I need to do?
- I created a Capture and Status Action. Where do I add those actions to the payment gateway? Do I register them in the PaymentFactory? I added dump and exits to both classes and when I run a payment in the browser, it seems to never hit the action and exit at the point I set.
Any help would be appreciated
Thanks in advance :)
There are several ways to add actions to a payment:
The quickest is using custom factory.
Create a payment factory. This is advanced technic and could be useful if you need custom configuration. For that you have to implement
PaymentFactoryInterface
and register it to Payum extension. You can add actions in the factory directly (require good understanding of symfony container):or you can load an xml file with actions. The actions services has to had a tag
payum.action
. The tag has to have afactory
defined. It has to match the name of the factory you created. Example: paypal_express_checkout_nvp.xml