0

我正在使用贝宝请求权限服务为我的沙盒应用程序授予退款权限。这是那个的代码

$url = "https://svcs.sandbox.paypal.com/Permissions/RequestPermissions";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_VERBOSE, 1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    "X-PAYPAL-SECURITY-USERID: username",
    "X-PAYPAL-SECURITY-PASSWORD: password",
    "X-PAYPAL-SECURITY-SIGNATURE: signature",
    "X-PAYPAL-REQUEST-DATA-FORMAT: NV",
    "X-PAYPAL-RESPONSE-DATA-FORMAT: NV",
    "X-PAYPAL-APPLICATION-ID: APP-ID"
));

$detailLevel = urlencode("ReturnAll");

$errorLanguage = urlencode("en_US");
    
$scope = "REFUND";

$callback = "http://www.example.com/permission.php";

$nvpreq =  "requestEnvelope.errorLanguage='en_US'&scope=$scope&callback=$callback";

$nvpreq .= "detailLevel=$detailLevel";

curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);

$result = curl_exec($ch);

curl_close($ch);

echo $result;

使用此代码我收到此消息

responseEnvelope.timestamp=2016-06-24T05%3A30%3A37.350-07%3A00 responseEnvelope.ack=成功 responseEnvelope.correlationId=06cb98ac28931/ responseEnvelope.build=2210301 token=AAAAAAAi3Sw3MkHlV5t2

但是当我在这个 url 中放置令牌时,将 帐户持有人的浏览器重定向到 PayPal,并将请求令牌包含在 request_token 参数中

我收到此错误

哎呀!很抱歉,您的交易已超时。请重试您的交易

那么为什么会这样呢?我哪里错了?我在没有登录我的贝宝帐户的情况下使用此网址。此过程是否也会授予所有管理员和其他卖家所需的权限?

4

0 回答 0