首先,我沒有Bussiness帳戶,所以如果這是問題,請告訴我,因爲幾乎不可能找到Paypal Express Checkout的請求在哪裏他們的官方網站。10001 paypal內部錯誤:超時處理請求快速結帳
我對這個API代碼:
$requestParams = array(
'METHOD' => $method,
'VERSION' => $this -> _version,
'USER' => $PayPalApiUsername,
'PWD' => $PayPalApiPassword,
'SIGNATURE' => $PayPalApiSignature
);
$request = array_merge($requestParams, $params);
//$params is bringed from other php.
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL ,'https://api-3t.paypal.com/nvp');
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_HTTPGET ,true);
curl_setopt($ch,CURLOPT_POSTFIELDS ,$request);
$response = curl_exec($ch);
然後,直到這裏是(我認爲)的所有權利。但做了一些檢查,這是我用$請求一起發送:
$request: array(16) {
["METHOD"]=>
string(18) "SetExpressCheckout"
["VERSION"]=>
string(4) "97.0"
["USER"]=>
string(27) "xxx_api1.example.com"
["PWD"]=>
string(16) "yyyyyyyyyyyyyyyy"
["SIGNATURE"]=>
string(56) "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
["RETURNURL"]=>
string(50) "http%3A%2F%2Fwww.website.com%2Fcontinue.php"
["CANCELURL"]=>
string(53) "http%3A%2F%2Fwww.website.com%2Fpaypal%2Fcancel_url.php"
["PAYMENTREQUEST_0_AMT"]=>
string(5) "10.95"
["PAYMENTREQUEST_0_CURRENCYCODE"]=>
string(3) "EUR"
["PAYMENTREQUEST_0_ITEMAMT"]=>
string(5) "10.95"
["PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID"]=>
string(24) "xxx%40example.com"
["PAYMENTREQUEST_0_PAYMENTACTION"]=>
string(4) "Sale"
["L_PAYMENTREQUEST_0_NAME0"]=>
string(17) "ProductA"
["L_PAYMENTREQUEST_0_AMT0"]=>
string(5) "10.95"
["L_PAYMENTREQUEST_0_QTY0"]=>
string(1) "1"
["L_PAYMENTREQUEST_0_NUMBER0"]=>
string(1) "1"
}
而且這是我收到PayPal:
$response:
TIMESTAMP=2013%2d01%2d07T23%3a20%3a43Z
CORRELATIONID=7a8130fb32e44
ACK=Failure
L_ERRORCODE0=10001
L_SHORTMESSAGE0=Internal%20Error
L_LONGMESSAGE0=Timeout%20processing%20request
有誰知道這裏發生了什麼?這是錯的嗎?首要問題在這裏是問題嗎?
'http_build_query($ request)'爲我做了這個 –
聖潔的狗屎,這是PayPal處理「multipart/form-data」編碼的錯誤,以及3年後的錯誤 – hanshenrik