PayPal Plus:REQUIRED_SCOPE_MISSING

问题描述

我遵循了PayPal的指南:https://developer.paypal.com/docs/platforms/get-started/

并向https://api.sandBox.paypal.com/v1/oauth2/token请求获取访问令牌。

这完全正常。

现在我要执行以下请求:https://api.sandBox.paypal.com/v1/payments/payment

(使用我之前在请求中获得的令牌在Postman中选择Bearer Auth)

现在我得到以下错误响应:

{
    "name": "required_ScopE_MISSING","message": "Access token does not have required scope","information_link": "https://developer.paypal.com/docs/api/payments/#errors","debug_id": "548db8d53cfde"
}

是的,我将我的项目配置为允许此类操作:

App configuration

我非常感谢您的帮助。

已编辑:

回复来自:https://api.sandBox.paypal.com/v1/oauth2/token

{
    "scope": "https://uri.paypal.com/services/invoicing https://uri.paypal.com/services/disputes/read-buyer https://uri.paypal.com/services/payments/realtimepayment https://uri.paypal.com/services/disputes/update-seller https://uri.paypal.com/services/paypalhere https://uri.paypal.com/services/payments/payment/authcapture openid https://uri.paypal.com/services/disputes/read-seller https://uri.paypal.com/services/payments/refund https://uri.paypal.com/services/identity/activities https://api.paypal.com/v1/vault/credit-card https://api.paypal.com/v1/payments/.* https://uri.paypal.com/payments/payouts https://api.paypal.com/v1/vault/credit-card/.* https://uri.paypal.com/services/subscriptions https://uri.paypal.com/services/applications/webhooks https://api.paypal.com/v1/payments/refund https://api.paypal.com/v1/payments/sale/.*/refund","token_type": "Bearer","expires_in": 30189
}

解决方法

您的范围没有实际问题,全部都存在。

您对https://api.sandbox.paypal.com/v1/payments/payment的付款请求似乎不完整

有关创建付款的示例指南,请参见此处:https://developer.paypal.com/docs/integration/direct/payments/paypal-payments/#create-paypal-payment

请确保传递带有金额和其他任何必需参数的交易对象