贝宝加:REQUIRED_SCOPE_MISSING

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,使用我之前请求中获取的token)

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

{
    "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

一定要传递一个带有金额的交易对象,以及任何其他必需的参数