【问题标题】:PayPal Sandbox MassPay: You do not have permissions to make this API callPayPal Sandbox MassPay:您无权进行此 API 调用
【发布时间】:2020-05-06 14:26:17
【问题描述】:

我正在尝试发送批量付款,为此我使用了 CURL,但我收到错误响应:You do not have permissions to make this API call

我的凭据是正确的。这是我的完整代码:

$unsername = '****';
        $password = '****';
        $signature = '****';
        $personal_email = '****@gmail.com';

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, 'https://api-3t.sandbox.paypal.com/nvp');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $unsername
                . "&".$password
                . "&".$signature
                . "&METHOD=MassPay"
                . "&VERSION=90"
                . "&RECEIVERTYPE=EmailAddress"
                . "&CURRENCYCODE=USD"
                . "&L_EMAIL0=".$personal_email
                . "&L_AMT0=35.95");
        $headers = array();
        $headers[] = 'Content-Type: application/x-www-form-urlencoded';
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        $result = curl_exec($ch);
        if (curl_errno($ch)) {
            echo 'Error:' . curl_error($ch);
        }
        curl_close($ch);
        $result = urldecode($result);
        $data = parse_str($result,$responseArray);
        $jsonResponse = $responseArray;


        echo "<pre>";
        print_r($jsonResponse);
        die;

回应:

Array
(
    [TIMESTAMP] => 2020-01-20T14:41:52Z
    [CORRELATIONID] => f1f011edab2bd
    [ACK] => Failure
    [VERSION] => 90
    [BUILD] => 54022052
    [L_ERRORCODE0] => 10002
    [L_SHORTMESSAGE0] => Authentication/Authorization Failed
    [L_LONGMESSAGE0] => You do not have permissions to make this API call
    [L_SEVERITYCODE0] => Error
)

【问题讨论】:

  • 您可能需要检查您帐户中的 API 权限或联系 PayPal 了解此问题,因为这是权限问题,而不是代码问题。
  • 你能帮我在需要添加权限的地方吗

标签: paypal paypal-sandbox


【解决方案1】:

访问 developer.paypal.com。
您应该有一个应用程序、“默认应用程序”或其他创建的名称。

选择它,您可以更改设置:

(我不能 100% 确定突出显示的权限是正确的,我从未使用过该功能)

如果您无权访问 API 设置,您应该询问谁向您提供了 API 密钥。

【讨论】:

  • 您强调的内容对于支付非常有用,但他没有使用支付,也没有使用 REST 应用程序,也没有使用 clientID/secret。相反,出于某种原因,他正在使用经典的 NVP API 凭据进行旧的经典 MassPay API 调用——这是非常古老的东西,不推荐使用。将他的所有代码切换到与新的 REST API + Payouts 集成确实会更受欢迎。
【解决方案2】:

您不应该将旧的 MassPay API 用于任何事情。

相反,集成支付:https://developer.paypal.com/docs/payouts/


为了以后在现场使用,有先决条件,支付与 MassPay 相同:https://developer.paypal.com/docs/payouts/integrate/prerequisites/

(如果一个真实账户已启用 MassPay,则它已启用支付功能,反之亦然,业务切换是相同的 - 但必须请求和批准)

【讨论】:

    猜你喜欢
    • 2014-08-20
    • 2014-08-17
    • 1970-01-01
    • 2019-09-03
    • 1970-01-01
    • 2013-05-25
    • 2013-11-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多