paypal / merchant-sdk-php

PHP SDK for integrating with PayPal's Express Checkout / MassPay / Web Payments Pro APIs
Other
231 stars 201 forks source link

Cannot authorize third party. #126

Closed wunag closed 7 years ago

wunag commented 7 years ago

Hi.

Now I am making the merchant system. I want to send the money to the owner, when customer paid to us. To do that I use the authorize api. So I get the token and secret token. And how should I do? Paypal did not send the example.

So I did like this.

$cred = new PPCertificateCredential("api-user-id", "api-password", "../cert_key.pem");

$cred->setThirdPartyAuthorization(new PPTokenAuthorization("token", "secrettoken"));

$setECResponse = $paypalService->SetExpressCheckout($setECReq);

Is it right? But I receive the error like this.

'You do not have permissions to make this API call'.

But I get the grant, 'invoice and express checkout'.

So to do this which authorization is need? Or this is paypal sdk error?

randstraw commented 7 years ago

Can you try $setECResponse = $paypalService->SetExpressCheckout($setECReq, $cred);

randstraw commented 7 years ago

Closing the issue, please let me know if the above was not a fix for you.