-1

目前我正在将订单金额重定向到运行良好的商家帐户

但是现在当我执行退款操作时出现权限错误

我遵循的步骤:

  1. 从他/她的刷新令牌(存储在数据库中)获取商家的访问令牌(使用https://api-m.sandbox.paypal.com/v1/identity/openidconnect/tokenservice API)

  2. 现在使用上述令牌(来自步骤 1)在以下 API https://api.sandbox.paypal.com/v2/payments/captures/{captureId}/refund中进行退款流程

captureId : 从订单详情中获取

退款 api 的响应:

{
    "name": "NOT_AUTHORIZED",
    "message": "Authorization failed due to insufficient permissions.",
    "debug_id": "60091a8e09195",
    "details": [
        {
            "issue": "PERMISSION_DENIED",
            "field": "capture_id",
            "value": "90Y75959CH863854A",
            "description": "You do not have permission to access or perform operations on this resource.",
            "location": "path"
        }
    ],
    "links": [
        {
            "href": "https://developer.paypal.com/docs/api/payments/v2/#error-PERMISSION_DENIED",
            "rel": "information_link"}
    ]}

有人可以帮我找出我在做什么错误吗?我该如何解决这个问题?

4

1 回答 1

1

要确定您应该在授权期间尝试请求哪些范围,请使用您自己的凭据执行正常的 access_token 请求并查看scopes返回的变量。

https://uri.paypal.com/services/payments/refund似乎相关。

于 2022-02-10T04:51:52.990 回答