Paypal Refund Rest Api v2 - 由于权限不足,授权失败

问题描述 投票:0回答:1

我能够成功执行以下API

/v2/checkout/orders
/v2/checkout/orders/{order_id}/authorize
/v2/checkout/orders/{order_id}/capture

为什么我在执行PayPal退款时收到“NOT_AUTHORIZED”响应,如此处所述? - https://developer.paypal.com/docs/api/payments/v2/#captures_refund

POST请求

https://api.sandbox.paypal.com/v2/payments/captures/<Capture ID I got from capture request>/refund

响应

    {
    "name": "NOT_AUTHORIZED",
    "message": "Authorization failed due to insufficient permissions.",
    "debug_id": "6c6xxxxx6c",
    "details": [
        {
            "issue": "PERMISSION_DENIED",
            "field": "capture_id",
            "value": "XXXXXXXXX",
            "description": "You do not have permission to access or perform operations on this resource.",
            "location": "path"
        }
    ],
    "links": [
        {
            "href": "https://developer.paypal.com/docs/api/v2/payments/#NOT_AUTHORIZED",
            "rel": "information_link"
        }
    ]
}
paypal paypal-sandbox paypal-rest-sdk
1个回答
0
投票

您必须联系PayPal支持以添加对现有ClientId和客户机密码(适用于PayPal V1 API)的V2退款和取消请求的权限,并且没有其他方法可以为其设置权限。如果您需要避免这种情况,那么只需从PayPal帐户创建新的ClientId和客户机密码,它就可以与PayPal V2 API一起使用。

© www.soinside.com 2019 - 2024. All rights reserved.