Paypal Delayed Chained Payments returns "Internal server error. Please check the server logs for details1"

160 views Asked by At

The following code returns "Internal server error. Please check the server logs for details1" The number "1" is response?

I would like to know what is wrong and why I can't get proper response. Also how to format request to get proper response. Thanks!

$url = 'https://svcs.sandbox.paypal.com/AdaptivePayments/Pay&actionType=PAY_PRIMARY&clientDetails.applicationId=APP-80W284485P519543T&clientDetails.ipAddress=127.0.0.1&currencyCode=USD&feesPayer=EACHRECEIVER&memo=Example&requestEnvelope.errorLanguage=en_US&returnUrl=http://www.yourdomain.com/success.html&cancelUrl=http://www.yourdomain.com/cancel.html&receiverList.receiver(0).amount=25.00&receiverList.receiver(0)[email protected]&receiverList.receiver(0).primary=true&receiverList.receiver(1).amount=5.00&receiverList.receiver(1)[email protected]&receiverList.receiver(1).primary=false&requestEnvelope.errorLanguage=en_US';

    $ch = curl_init();

    curl_setopt($ch,CURLOPT_URL, $url);
    curl_setopt($ch,CURLOPT_HTTPHEADER,array(
    "X-PAYPAL-SECURITY-USERID: vorhegmindehd_api1.gmail.com",
    "X-PAYPAL-SECURITY-PASSWORD: 5VV5B8M8CAH9ZHEZ",
    "X-PAYPAL-SECURITY-SIGNATURE: AiPC9BikCyDFQXbSkoZcgqH3hpacA3-z5-u8OUawhrQsZCBMbprk73z7",
    "X-PAYPAL-REQUEST-DATA-FORMAT: NV",
    "X-PAYPAL-RESPONSE-DATA-FORMAT: NV",
    "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T"
    ));



    //execute post
    $result = curl_exec($ch);

    $resArr = json_decode($result);
    print_r($result);

    //close connection
    curl_close($ch);
1

There are 1 answers

0
virtualist On

After many hours of investigation, this is the right format of the call (code below)

  • however now I am getting the:

"2015-06-11T06:33:51.784-07:00Failure305229b402fe815743565520003PLATFORMApplicationErrorAuthentication failed. API credentials are incorrect."

Thanks to all who tried to help. If any suggestion about the new error, please reply. Thanks.

$url = 'https://svcs.sandbox.paypal.com/AdaptivePayments/PaymentDetails';


$parameters = 'actionType=PAY&clientDetails.applicationId=APP-80W284485P519543T&clientDetails.ipAddress=127.0.0.1&currencyCode=USD&feesPayer=EACHRECEIVER&memo=Example&returnUrl=http://www.yourdomain.com/success.html&cancelUrl=http://www.yourdomain.com/cancel.html&receiverList.receiver(0).amount=25.00&receiverList.receiver(0)[email protected]&receiverList.receiver(0).primary=true&receiverList.receiver(1).amount=5.00&receiverList.receiver(1)[email protected]&receiverList.receiver(1).primary=false&requestEnvelope.errorLanguage=en_US';

$ch = curl_init();

curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POSTFIELDS, $parameters);
curl_setopt($ch,CURLOPT_HTTPHEADER,array(
'X-PAYPAL-SECURITY-USERID' => 'quxxxxxxxxxxator_api1.gmail.com',
'X-PAYPAL-SECURITY-PASSWORD' => 'QSH6xxxxxx2CXMW',
'X-PAYPAL-SECURITY-SIGNATURE' => 'Al.b0WCW1xxxxxxxxxxxxxxrApDew5IUXWrEqJehMdG.PVMtaC7u',
'X-PAYPAL-REQUEST-DATA-FORMAT' => 'NV',
'X-PAYPAL-RESPONSE-DATA-FORMAT' => 'NV',
'X-PAYPAL-APPLICATION-ID' => 'APP-80W284485P519543T'
));

//execute post
$result = curl_exec($ch);

$resArr = json_decode($result);
print_r($result);

//close connection
curl_close($ch);

UPDATE

  • for all others with the same problem:

Headers were fromatted in a wrong way, also data type was wrong, the code below executes normal

$url = 'https://svcs.sandbox.paypal.com/AdaptivePayments/Pay';


$parameters = 'actionType=PAY_PRIMARY&clientDetails.applicationId=APP-80W284485P519543T&clientDetails.ipAddress=143.95.39.52&currencyCode=USD&feesPayer=EACHRECEIVER&memo=Example&receiverList.receiver(0).amount=25.00&receiverList.receiver(0)[email protected]&receiverList.receiver(0).primary=true&receiverList.receiver(1).amount=5.00&receiverList.receiver(1)[email protected]&receiverList.receiver(1).primary=false&requestEnvelope.errorLanguage=en_US&returnUrl=http://www.google.com&cancelUrl=http://www.net.hr';

$ch = curl_init();

curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POSTFIELDS, $parameters);
$headers = array(
'X-PAYPAL-SECURITY-USERID: v_corp-facilitator_api1.live.com',
'X-PAYPAL-SECURITY-PASSWORD: MVDUDLUZTHUHFE23',
'X-PAYPAL-SECURITY-SIGNATURE: AmoptyIrmh6lUZc78BeJ.pp5-B1qAG6-LkYRukL6PdAXE1igG0TXwyNh',
'X-PAYPAL-REQUEST-DATA-FORMAT: NV',
'X-PAYPAL-RESPONSE-DATA-FORMAT: JSON',
'X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T'
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);





//execute post
$result = curl_exec($ch);

$resArr = json_decode($result);
print_r($result);

//close connection
curl_close($ch);