10001 paypal internal error: timeout processing request Express Checkout

Ignacio Bustos picture Ignacio Bustos · Jan 8, 2013 · Viewed 13.4k times · Source

First of all, i dont have a Bussiness Account, so if that is the problem, just tell me, because is almost impossible to find where is the requeriment for Paypal Express Checkout in their official website.

My code for this API is:

$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);

Then, until here is (i think) all right. But doing some checks this is what i sent with $request:

$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"
}

And this is what i receive from Paypal:

$response: 
TIMESTAMP=2013%2d01%2d07T23%3a20%3a43Z
CORRELATIONID=7a8130fb32e44
ACK=Failure
L_ERRORCODE0=10001
L_SHORTMESSAGE0=Internal%20Error
L_LONGMESSAGE0=Timeout%20processing%20request

Does anyone know what is happening here? Is this wrong? Is the premier Account the problem here?

Answer

Ignacio Bustos picture Ignacio Bustos · Jan 8, 2013

SOLUTION:

I solved this problem with this:

AVOID using "urlencode()" to encode the params, save your data as normal.

example:

array(
   'RETURNURL' => 'http://www.yourwebsite.com/confirm.php', //without urlencode()
   'CANCELURL' => 'http://www.yourwebsite.com/cancel.php'  //without urlencode()
);

USE http_build_query($request) in the moment before sending it via "Curl" like this:

curl_setopt($ch,CURLOPT_POSTFIELDS , http_build_query($request));