2

I am trying to implement paypal-rest payment with the payum bundle in symfony (3.1.4). I need to get PayPal Plus running in my Symfony App. Therefore I read this article https://github.com/Payum/Payum/blob/master/docs/paypal/rest/get-it-started.md

Now - I can't figure out what the 'config_path' parameter is ment to be set to and what exactly has to be provides at this config_path.

Symfony states

'The config_path fields are required.'

My payum config looks like this 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

The paypal_express_payment part works fine.

If I add just a random config-path like 'my_config.txt' Symfony states

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.

So - where and what is the config_path ment to be?

Any help or hints for more documentation that can lead into the right direction is very welcome.

user3440145
  • 793
  • 10
  • 34

2 Answers2

4

It's meant to be sdk_config.ini from PayPal-PHP-SDK

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'

UPDATE: I don't think that Doctrine ORM storage is supported by Payum PaypalRest plugin. PaypalRest\Action\CaptureAction requires the model (Payment) to be inherited from PayPal\Api\Payment and then it uses its create and execute methods for payment capture. I don't think it's a good idea to extend from PayPal\Api\Payment in the Doctrine entity.

I was able to eliminate this error by using Payum\Paypal\Rest\Model\PaymentDetails as a payment and filesystem as a storage:

payum:
    storages:
        Payum\Paypal\Rest\Model\PaymentDetails:
            filesystem:
                storage_dir: %kernel.root_dir%/Resources/payments
                id_property: idStorage
karser
  • 1,625
  • 2
  • 20
  • 24
  • Thank you. This looks very sensible. However I then still get this error: `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.` @karser – user3440145 May 26 '17 at 15:58
  • Any hint on how to use the class "PaymentDetails" from paypal-rest payum in my config.yml to specify the storage? It seems this part is missing... – user3440145 May 29 '17 at 15:06
  • @user3440145 Indeed, documentation is missing. I made some progress on it and eliminated the error. I updated the answer. – karser May 31 '17 at 12:47
  • Thank you very much! I now can proceed with the implementation. About the same problem was described here: https://github.com/Payum/PayumBundle/issues/363 However I didn't manage to figure it out until your answere here. Thx! – user3440145 May 31 '17 at 14:50
  • I'm trying the same but still run into the `Request GetStatus{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.` error on: `ExecuteSameRequestWithPaymentDetailsAction.php` – Alexander Schranz Sep 02 '19 at 18:50
  • @karser also the config_path need to point to a directory when looking at: https://github.com/paypal/PayPal-PHP-SDK/blob/ff2a7f9c2ddc47a22cb7bb8a5b0bb97bd16bdd6f/lib/PayPal/Core/PayPalConfigManager.php#L37 so `config_path: '%kernel.root_dir%/config // folder incloding sdk_config.ini` would be correct – Alexander Schranz Sep 03 '19 at 08:05
0

Try to set it to default value like this:

paypal_rest_payment:
    factory: paypal_rest
    client_id:      "%ppr_cid%"
    client_secret:  "%ppr_sec%"
    sandbox: true
    config_path: ~
dmnptr
  • 4,258
  • 1
  • 20
  • 19