php - Sylius: adding a new Payum Gateway (Rabobank Omnikassa) -
i've been looking @ lot of posts have found solution question. there doesn't same single place on internet explains how add new payment gateway sylius payum bundle.
i'm using latest sylius
0.10.*
version , i'd add new payment gateway (rabobank omnikassa, dutch payment endpoint).
there's info on how add paymentfactory
payumpayumbundle
, folder structure of bundle nothing syliuspayumbundle
. i've created own acme\bundle\payumbundle
overrides syliuspayumbundle
.
i set in similar fashion paypalexpresscheckoutpaymentfactory.
config/payum.yml
here i'm testing few things sylius find 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 service tags 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 gateway in config.yml file
sylius_payment: gateways: rabobank: rabobank omnikassa
exception: invalid configuration path
it doesn't seem recognize rabobank
valid type. 1 register new type?
invalidconfigurationexception: invalid configuration path "payum.contexts.rabobank.omnipay": given type rabobank 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 supported.
registering payment factory
in this file can see how they're registering factories in payum. i'd same in sylius within own bundle.
what steps take here?
there 2 ways add custom payment solution payum\sylius.
the quickest using custom factory. did, have add services
actions
section not classes. tagpayum.action
used approach<tag name="payum.action" context="rabobank" />
. didnot use factorycustom
in tag because in case actions added contexts created custom factory. not want.second way create payment factory. have implement
paymentfactoryinterface
, register payum extension. have choose if need options configured before able create payment. tagpayum.action
used approach<tag name="payum.action" context="rabobank" />
or<tag name="payum.action" factory="rabobank" />
. difference is: first tag adds action 1 context second 1 adds action contexts created factory.
some general suggestions:
there's info on how add paymentfactory payumbundle, folder structure of bundle nothing syliuspayumbundle.
it should not be. syliuspayumbundle thin integration layer between sylius , payumbundle.
i've created own acme\bundle\payumbundle overrides syliuspayumbundle.
you dont have that, should work fine without this.
i'm not sure service tags use where..
if chose custom factory dont need tags, configure actions
section correctly.
invalidconfigurationexception: invalid configuration path "payum.contexts.rabobank.omnipay":
are sure posted right configs? believe cannot exception posted. expect different exception different message.
and ofcourse i'm registering gateway in config.yml file
you have put data in payment_gateway
table (if recall table name correctly).
in file can see how they're registering factories in payum. i'd same in sylius within own bundle.
just same in bundle's build method.
Comments
Post a Comment