Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paypal Payments REST API - REQUIRED_SCOPE_MISSING

Tags:

rest

php

api

paypal

Fails when Execute() an Authorized Payment after user approval.

scopes : "openid profile email address phone https://uri.paypal.com/services/expresscheckout"

consent_uri : "https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize?client_id=my_client_id&response_type=code&scope=openid%20profile%20email%20address%20phone%20https://uri.paypal.com/services/expresscheckout&redirect_uri=https://www.my_site.com/src/paypal.php"

[http_code] => 403
[url] => https://api.sandbox.paypal.com/v1/payments/payment/PAY-55313193UK1537019LCXIDBA/execute
[header] => Array
    (
        [0] => Content-Type:application/json
        [1] => Authorization:Bearer user_access_token_from_identity_api
        [2] => PayPal-Partner-Attribution-Id:pp_attr_id
    )

[post_data] => {"payer_id":"3BTU9WTCHAU2Q"}
[response] => {"name":"REQUIRED_SCOPE_MISSING","message":"Access token is missing required scope.","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#REQUIRED_SCOPE_MISSING","debug_id":"e40c3f6b601a"}

)

I am only using one sandbox client_id and I have the Accept Payments and Use Seamless Checkout permissions enabled.

https://developer.paypal.com/docs/integration/direct/identity/seamless-checkout/

Any insight is greatly appreciated.

like image 783
Jordan Reddick Avatar asked Feb 23 '17 05:02

Jordan Reddick


People also ask

Does PayPal use restful API?

The PayPal REST API is organized around transaction workflows, including: orders, payments, subscriptions, invoicing, and disputes. The API uses standard verbs and returns HTTP response codes and JSON-encoded responses.

How do I get my PayPal REST API access token?

Enter the https://api-m.sandbox.paypal.com/v1/oauth2/token request URL. On the Authorization tab, select the Basic Auth type. Type your client ID in the Username box, and type your secret in the Password box. On the Body tab, select x-www-form-urlencoded .

Is PayPal PHP SDK deprecated?

Please note that if you are integrating with PayPal Checkout, this SDK and corresponding API v1/payments are in the process of being deprecated. We recommend that you integrate with API v2/checkout/orders and v2/payments. Please refer to the Checkout PHP SDK to continue with the integration.


1 Answers

Do you have "Subcription" mark checked in Your app config under the "APP CAPABILITIES" -->> "Advanced options" on developer.paypal.com ?

like image 60
barat Avatar answered Sep 20 '22 07:09

barat