2

我正在尝试使用 symfony (3.1.4) 中的 payum 包实现 paypal-rest 付款。我需要让 PayPal Plus 在我的 Symfony 应用程序中运行。因此我读了这篇文章 https://github.com/Payum/Payum/blob/master/docs/paypal/rest/get-it-started.md

现在 - 我无法弄清楚要设置的“config_path”参数是什么,以及在这个 config_path 中必须提供什么。

Symfony 状态

'The config_path fields are required.'

我的 payum 配置看起来像这个 atm

payum:
    security:
        token_storage:
            AppBundle\Entity\PaymentToken: { doctrine: orm }

    storages:
        AppBundle\Entity\Payment: { doctrine: orm }

    gateways:
        paypal_express_payment:
            factory: paypal_express_checkout
            username:  "%ppe_uname%"
            password:  "%ppe_pw%"
            signature: "%ppe_signature%"
            sandbox: false
        paypal_rest_payment:
            factory: paypal_rest
            client_id:      "%ppr_cid%"
            client_secret:  "%ppr_sec%"
            sandbox: true

paypal_express_payment 部分工作正常。

如果我只添加一个随机配置路径,例如“my_config.txt”,Symfony 状态

Request GetHumanStatus{model: ArrayObject} is not supported. Make sure the gateway supports the requests and there is an action which supports this request (The method returns true). There may be a bug, so look for a related issue on the issue tracker.

那么 - config_path 的位置和位置是什么?

任何可以引导正确方向的文档的帮助或提示都非常受欢迎。

4

2 回答 2

4

它应该是来自 PayPal-PHP-SDK 的sdk_config.ini

gateways:
    paypal_rest:
        factory: paypal_rest
        client_id:  '%paypal_rest.client_id%'
        client_secret:  '%paypal_rest.client_secret%'
        config_path: '%kernel.root_dir%/config/sdk_config.ini'

更新:我认为 Payum PaypalRest 插件不支持 Doctrine ORM 存储。 PaypalRest\Action\CaptureAction要求模型(Payment)从 PayPal\Api\Payment 继承,然后它使用其创建和执行方法进行支付捕获。我认为从 Doctrine 实体中的 PayPal\Api\Payment 扩展不是一个好主意。

我可以通过使用Payum\Paypal\Rest\Model\PaymentDetails作为支付和文件系统作为存储来消除这个错误:

payum:
    storages:
        Payum\Paypal\Rest\Model\PaymentDetails:
            filesystem:
                storage_dir: %kernel.root_dir%/Resources/payments
                id_property: idStorage
于 2017-05-24T21:11:32.950 回答
0

尝试将其设置为默认值,如下所示:

paypal_rest_payment:
    factory: paypal_rest
    client_id:      "%ppr_cid%"
    client_secret:  "%ppr_sec%"
    sandbox: true
    config_path: ~
于 2017-05-19T23:30:49.253 回答