I am trying to setup a parallel payment using the paypal classic API. However, I am getting massive errors.
I have 2 test accounts setup in the sandbox as well as a classic application.
I am using PHP CURL to initiate the request. I updated the CURL code from the doc to php curl.
My PHP code as as follow:
$headers = array(
"X-PAYPAL-SECURITY-USERID: XXXXXX" ,
"X-PAYPAL-SECURITY-PASSWORD: XXXXXX",
"X-PAYPAL-SECURITY-SIGNATURE: XXXXXX" ,
"X-PAYPAL-REQUEST-DATA-FORMAT: NV",
"X-PAYPAL-RESPONSE-DATA-FORMAT: NV",
"X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T",
);
$post_array = array(
'actionType'=>'PAY',
'clientDetails.applicationId'=>'APP-80W284485P519543T',
'currencyCode'=>'USD',
'feesPayer'=>'SECONDARYRECEIVER',
'receiverList.receiver(0).amount'=>'5.00',
'receiverList.receiver(0).email'=>'primaryreceiver1@test.com',
'receiverList.receiver(0).primary'=>'true',
'receiverList.receiver(1).amount'=>'5.00',
'receiverList.receiver(1).email'=>'secondaryreceiver1@test.com ',
'receiverList.receiver(1).primary'=>'false',
'requestEnvelope.errorLanguage'=>'en_US',
'ipnNotificationUrl'=>'http://www.yourdomain.com/ipn_myreceiver',
'returnUrl'=>'http://www.yourdomain.com/success',
'cancelUrl'=>'http://www.yourdomain.com/cancel',
);
$url = 'https://svcs.sandbox.paypal.com/AdaptivePayments/Pay';
$curl_session = curl_init();
curl_setopt($curl_session, CURLOPT_URL,$url);
curl_setopt($curl_session, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl_session, CURLOPT_POST, 1);
curl_setopt($curl_session, CURLOPT_POSTFIELDS, http_build_query($post_array));
curl_setopt($curl_session, CURLOPT_CONNECTTIMEOUT,10);
curl_setopt($curl_session, CURLOPT_TIMEOUT, 10);
curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_session, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl_session, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($curl_session);
echo $response;
I am getting the following error response:
responseEnvelope.timestamp=2014-03-20T11%3A35%3A58.520-07%3A00&responseEnvelope.ack=Failure&responseEnvelope.correlationId=db88a73f724a0&responseEnvelope.build=10175386&error(0).errorId=580022&error(0).domain=PLATFORM&error(0).subdomain=Application&error(0).severity=Error&error(0).category=Application&error(0).message=Invalid+request+parameter%3A+email+secondaryreceiver1%40test.com++is+invalid&error(0).parameter(0)=email&error(0).parameter(1)=secondaryreceiver1%40test.com+
What is wrong?