Paypal NVP REFUND API获取错误10007

时间:2013-04-06 14:31:01

标签: paypal paypal-sandbox paypal-nvp

我正在尝试使用paypal nvp退还金额。我收到以下错误

[TIMESTAMP] => 2013 04 06T13 48 19
[CORRELATIONID] => aac23709cc94a
[ACK] => Failure [VERSION] => 51 0
[BUILD] => 5618210
[L_ERRORCODE0] => 10007
[L_SHORTMESSAGE0] => Permission denied
[L_LONGMESSAGE0] => You do not have permission to refund this transaction     
[L_SEVERITYCODE0] => Error )

我做错了什么? 我已经设置了付款的emailid的api密钥 请告诉我什么是问题,如何让退款工作。

代码

$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
$version = urlencode('51.0');
$API_UserName = 'example';
$API_Password = 'example';
$API_Signature = 'example';
$API_Endpoint = 'example';
$sandboxmode = 'example';
$methodName_ = 'RefundTransaction';
$transactionID = urlencode('example');
$refundType = urlencode('example'); 

if($partial) {
    $amount = 'example';
    $memo   = 'Refunding the amount ';
    $nvpStr_ = "&TRANSACTIONID=$transactionID&REFUNDTYPE=$refundType&CURRENCYCODE=$currencyID&AMT=$amount&NOTE=$memo";
} else {
    $nvpStr_ = "&TRANSACTIONID=$transactionID&REFUNDTYPE=$refundType&CURRENCYCODE=$currencyID";
}
$currencyID = urlencode('CAD');
    $API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
    $version = urlencode('51.0');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $API_Endpoint);
curl_setopt($ch, CURLOPT_VERBOSE, 1);

// Turn off the server and peer verification (TrustManager Concept).
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);

// Set the API operation, version, and API signature in the request.
$nvpreq = "METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_";

// Set the request as a POST FIELD for curl.
curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);

// Get response from the server.
$httpResponse = curl_exec($ch);

0 个答案:

没有答案