2

I installed Sylius via composer create-project -s dev sylius/sylius-standard acme on my local server to take a closer look at it for a upcoming project. Now I'm stuck at adding payment-methods/ a payment-gateway.

I tried to follow the docs and install omnipay-bundle but composer require "sylius/omnipay-bundle" failed with:

  Problem 1
    - Installation request for sylius/omnipay-bundle ^0.9.0 -> satisfiable by sylius/omnipay-bundle[v0.9.0].
    - Conclusion: remove omnipay/omnipay 2.3.2
    - Conclusion: don't install omnipay/omnipay 2.3.2
    - sylius/omnipay-bundle v0.9.0 requires omnipay/omnipay 1.0.* -> satisfiable by omnipay/omnipay[v1.0.0, v1.0.1, v1.0.2, v1.0.3, v1.0.4].
    - Can only install one of: omnipay/omnipay[v1.0.0, 2.3.2].
    - Can only install one of: omnipay/omnipay[v1.0.1, 2.3.2].
    - Can only install one of: omnipay/omnipay[v1.0.2, 2.3.2].
    - Can only install one of: omnipay/omnipay[v1.0.3, 2.3.2].
    - Can only install one of: omnipay/omnipay[v1.0.4, 2.3.2].
    - Installation request for omnipay/omnipay == 2.3.2.0 -> satisfiable by omnipay/omnipay[2.3.2].

Adding the bundle to the appkernel.php anyway and/or adding configuration to config.yml (like described in the docs) prevents the Server from starting.

I found this issue: https://github.com/Sylius/Sylius/issues/4396 which seems related.

Question: - Should there be some choices other than 'Offline' in 'Payment Methods' in the Admin-Frontend (without adding code to the freshly-pulled sylius)? - Is Sylius changing so rapidly that the docs are not matching? - Lets assume I want to add '2checkout' (just as exampl) as payment gateway, what would i have to do?

I have the feeling i missed something fundamental with this problem :) Thanks for your help in advance!

macro64
  • 61
  • 7
  • omnipay/1.x has been deprecated for a long time. There must be a later version of the sylius omnipay bundle or sylius itself that supports omnipay 2.x. Probably best raise an issue with the sylius devs to ask what you should be doing there. – delatbabel Mar 14 '16 at 07:45
  • Digging a bit further it seems that sylius/omnipay-bundle is obsolete -- more than 2 years old. sylius itself has omnipay integration directly in the main project which appears to be up to date. To add payment methods you probably just need to require the appropriate gateway, e.g. composer require omnipay/paypal – delatbabel Mar 14 '16 at 07:48
  • Thank you for your Answer! `composer require omnipay/paypal` failed while clearing a cache, while `composer require omnipay/2checkout` succeeded while rendering a `An Exception was thrown while handling: Internal Server Error`. The Log says: `"Attempted to call an undefined method named "setResourceOwnerMap" of class "HWI\Bundle\OAuthBundle\Security\OAuthUtils"` After fixing that in the appropriate file I required (just for testing): omnipay/omnipay omnipay/stripe payum/payum payum/stripe But still no sign of any other payment-method other than offline. I'm keeping digging... – macro64 Mar 14 '16 at 10:55

1 Answers1

3

My Question was answered in the Git-issue 4369

So, the sylius-standard already contains the Symfony2-Bundles. To add a payment-gateway they just need to be configured in config.yml:

payum:
    gateways:
        paypal_express_checkout:
            paypal_express_checkout_nvp:
                username:  %paypal.express_checkout.username%
                password:  %paypal.express_checkout.password%
                signature: %paypal.express_checkout.signature%
                sandbox:   %paypal.express_checkout.sandbox%
        klarna_checkout:
            klarna_checkout:
                secret:  'required'
                merchant_id: 'required'
                sandbox: true
sylius_payment:
    gateways:
        paypal_express_checkout: Paypal Express Checkout
        klarna_checkout: Klarna Checkout

Additional configuration reference can be found here: https://github.com/Payum/PayumBundle/blob/master/Resources/doc/configuration_reference.md

Thanks!

PS: The cache has to be cleared before restarting the server.

Community
  • 1
  • 1
macro64
  • 61
  • 7