I've been looking at a lot of posts but nowhere have I found a solution to my question. There doesn't same to be a single place on the internet that explains how to properly add a new payment gateway to the Sylius Payum Bundle.
I'm using the latest sylius
0.10.*
version and I'd like to add a new payment gateway (Rabobank Omnikassa, a Dutch payment endpoint).
There's some info on how to add a PaymentFactory
for the PayumPayumBundle
, however the folder structure of this bundle is nothing like SyliusPayumBundle
. I've created my own Acme\Bundle\PayumBundle
which overrides from the SyliusPayumBundle
.
I would like to set it up in a similar fashion to the PaypalExpressCheckoutPaymentFactory.
config/payum.yml
Here I'm just testing a few things to get Sylius to find my stuff.
payum:
contexts:
rabobank:
storages:
Sylius\Component\Core\Model\Order:
doctrine:
driver: orm
Sylius\Component\Core\Model\Payment:
doctrine:
driver: orm
custom:
actions:
- Shopfish\Bundle\PayumBundle\Payum\Rabobank\Action\CapturePaymentAction
- Shopfish\Bundle\PayumBundle\Payum\Rabobank\Action\NotifyOrderAction
config/services.xml
I'm not sure what service tags to use where..
<parameters>
<parameter key="shopfish.payum.rabobank.action.capture_payment.class">Shopfish\Bundle\PayumBundle\Payum\Rabobank\Action\CapturePaymentAction</parameter>
<parameter key="shopfish.payum.rabobank.action.notify_order.class">Shopfish\Bundle\PayumBundle\Payum\Rabobank\Action\NotifyOrderAction</parameter>
<parameter key="shopfish.payum.rabobank.action.payment_status.class">Shopfish\Bundle\PayumBundle\Payum\Rabobank\Action\PaymentStatusAction</parameter>
</parameters>
<services>
<!-- Rabobank Omnikassa -->
<service id="shopfish.payum.rabobank.action.capture_payment" class="%shopfish.payum.rabobank.action.capture_payment.class%" public="false">
<tag name="payum.action" factory="omnipay" />
</service>
<service id="shopfish.payum.rabobank.action.notify_order" class="%shopfish.payum.rabobank.action.notify_order.class%" public="false">
<argument type="service" id="event_dispatcher" />
<argument type="service" id="sylius.manager.payment" />
<argument type="service" id="finite.factory" />
<tag name="payum.action" factory="paypal_express_checkout_nvp" />
</service>
</services>
config/config.yml
And ofcourse I'm registering the gateway in the config.yml file
sylius_payment:
gateways:
rabobank: Rabobank Omnikassa
Exception: Invalid configuration for path
It doesn't seem to recognize Rabobank
as a valid type. Where does one register a new type?
InvalidConfigurationException: Invalid configuration for path "payum.contexts.rabobank.omnipay": Given type Rabobank is not supported. These types AuthorizeNet_AIM, AuthorizeNet_SIM, Buckaroo, CardSave, Dummy, Eway_Rapid, GoCardless, Manual, Migs_ThreeParty, Migs_TwoParty, Mollie, MultiSafepay, Netaxept, NetBanx, PayFast, Payflow_Pro, PaymentExpress_PxPay, PaymentExpress_PxPost, PayPal_Express, PayPal_Pro, Pin, SagePay_Direct, SagePay_Server, SecurePay_DirectPost, Stripe, TargetPay_Directebanking, TargetPay_Ideal, TargetPay_Mrcash, TwoCheckout, WorldPay are supported.
Registering the Payment Factory
In this file you can see how they're registering the factories in Payum. I'd like to do the same in Sylius from within my own Bundle.
What are good steps to take from here?