I get a REQUIRED_SCOPE_MISSING error message when executing sample / billing PayPal / CreatePlan.php with my own client and secret. It works great using the provided client and secret.
PLAYBACK:
Download PayPal-PHP-SDK v0.14.2
go to sample / billing
run
php CreatePlan.php
Line 9 in this file includes bootstrap.php. This is where the clientId and secret identifiers are defined.
If I use an existing clientId and the secret will work fine. If I replace with my own client and secret, this will give the error message shown here.
[myprompt]$ php CreatePlan.php
Warning: This sample may require a server to handle return URL. Cannot execute in command line. Defaulting URL to http://localhost/sample/billing
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(1) CREATED PLAN
REQUEST:
{"name":"T-Shirt of the Month Club Plan","description":"Template creation.","type":"fixed",
"payment_definitions":[{"name":"Regular Payments","type":"REGULAR","frequency":"Month",
"frequency_interval":"2","cycles":"12","amount":{"value":"100.00","currency":"USD"},
"charge_models":[{"type":"SHIPPING","amount":{"value":"10.00","currency":"USD"}}]}],
"merchant_preferences":{"return_url":"http://localhost/sample/billing /ExecuteAgreement.php?success=true",
"cancel_url":"http://localhost/sample/billing/ExecuteAgreement.php?success=false","auto_bill_amount":"yes","initial_fail_amount_action": "CONTINUE","max_fail_attempts":"0","setup_fee":{"value":"1.00","currency":"USD"}}}
RESPONSE:
ERROR:Got Http response code 403 when
accessing https://api.sandbox.paypal.com/v1/payments/billing-plans/. {"name":"REQUIRED_SCOPE_MISSING",
"message":"Access token does not have required scope",
"information_link":"https://developer.paypal.com/webapps/developer/docs/api /#REQUIRED_SCOPE_MISSING","debug_id":"261257fb27891"}
My own client and secret work perfectly with all sample payments.