Sylius V0.17如何添加付款方式

时间:2016-03-13 15:43:13

标签: payment gateway sylius omnipay

我在本地服务器上通过composer create-project -s dev sylius/sylius-standard acme安装了Sylius,以便为即将到来的项目仔细查看它。现在我一直坚持添加付款方式/支付网关。

我尝试关注docs并安装omnipay-bundle但composer require "sylius/omnipay-bundle"失败了:

  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].

无论如何将捆绑包添加到appkernel.php和/或将配置添加到config.yml(如文​​档中所述)会阻止服务器启动。

我发现了这个问题:https://github.com/Sylius/Sylius/issues/4396 这似乎有关。

问题: - 除了'离线'以外还有其他选择吗?在'付款方式'在Admin-Frontend中(没有添加代码到新鲜的sylius)? - Sylius变化如此之快以至于文档不匹配吗? - 假设我想添加' 2checkout' (作为例子)作为支付网关,我该怎么做?

我感觉我错过了这个问题的根本性:) 感谢您的帮助!

1 个答案:

答案 0 :(得分:3)

我的问题已在Git-issue 4369

中得到解答

因此,sylius-standard已经包含了Symfony2-Bundles。 要添加支付网关,只需在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

可在此处找到其他配置参考: https://github.com/Payum/PayumBundle/blob/master/Resources/doc/configuration_reference.md

谢谢!

PS:在重新启动服务器之前必须清除缓存。