Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $header = array("X-PAYPAL-SECURITY-USERID:marksyshyperlink-facilitator_api1.gmail.com",
- "X-PAYPAL-SECURITY-PASSWORD:1393649729",
- "X-PAYPAL-SECURITY-SIGNATURE:An5ns1Kso7MWUdW4ErQKJJJ4qi4-AV3Mwk0UMZ1QcxcIH41BnL3aj0KX",
- "X-PAYPAL-REQUEST-DATA-FORMAT:JSON",
- "X-PAYPAL-RESPONSE-DATA-FORMAT:JSON",
- "X-PAYPAL-APPLICATION-ID:APP-80W284485P519543T",
- "Content-Type:text/xml",
- "Accept: */*"
- );
- $values = array(
- "Content-Type"=>"application/x-www-form-urlencoded",
- "actionType" => "PAY",
- "clientDetails.applicationId" => "APP-80W284485P519543T",
- "clientDetails.ipAddress" => "162.210.70.39",
- "currencyCode" => "USD",
- "feesPayer" => "EACHRECEIVER",
- "memo" => "Sourc Code",
- "receiverList.receiver(0).amount" => "25.00",
- "receiverList.receiver(0).email" => "marksyshyperlink-facilitator@gmail.com",
- "receiverList.receiver(0).primary" => "true",
- "receiverList.receiver(1).amount" => "5.00",
- "receiverList.receiver(1).email" => "marksyshyperlink-facilitator2@gmail.com",
- "receiverList.receiver(1).primary" => "false",
- "requestEnvelope.errorLanguage" => "en_US",
- "returnUrl" => "http://localhost/fluidapp/success.html",
- "cancelUrl" => "http://localhost/fluidapp/cancel.html"
- );
- // $headers = array('X-PAYPAL-SECURITY-USERID: ' . PAYPAL_API_USER, ...)
- $Url ="https://svcs.sandbox.paypal.com/AdaptivePayments/Pay/";
- // is cURL installed yet?
- if (!function_exists('curl_init')){
- die('Sorry cURL is not installed!');
- }
- // OK cool - then let's create a new cURL resource handle
- $ch = curl_init();
- // Set URL to download
- curl_setopt($ch, CURLOPT_URL, $Url);
- curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
- // Set a referer
- //curl_setopt($ch, CURLOPT_REFERER, "http://www.example.org/yay.htm");
- //post data
- curl_setopt($ch, CURLOPT_POSTFIELDS ,$values);
- // User agent
- //curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER["HTTP_USER_AGENT"]);
- curl_setopt($ch, CURLOPT_HTTPHEADER,$header);
- // Include header in result? (0 = yes, 1 = no)
- curl_setopt($ch, CURLOPT_HEADER, 1);
- // Should cURL return or print out the data? (true = return, false = print)
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
- curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
- curl_setopt($ch, CURLOPT_NOBODY, true);
- // Download the given URL, and return output
- $output = curl_exec($ch);
- // Close the cURL resource, and free system resources
- $info = curl_getinfo($ch);
- echo "<pre/>";
- print_r($info);
- echo "<br /><br />------------";
- var_dump($output);
- curl_close($ch);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement