I’m trying to submit to Paypal Website Payments Pro through cURL. I’m trying to do something like this:
// set vars
$cmd = "_cart";
$upload = "1";
$business = "seller_1298211815_biz@nowhere.com";
$req = "cmd=$cmd&upload=$upload&business=$business";
$req .= "&".postToEncoded($_POST);
$url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; // test
// $url= 'https://www.paypal.com/cgi-bin/webscr'; // live
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$res = @curl_exec($ch);
$curl_err = curl_error($ch);
curl_close($ch);
I’ve tried a ton of options read different places and I have yet to get this to work. I just want to be able to pass my extra vars to Paypal then continue on loading the PP site with the added vars. The post is working fine, but I don’t know how to get it to go to the PP site!
If you are trying to redirect your customer to a paypal page with your parameters – you can approach this differently. Have your form that makes the POST add 3 hidden fields which you set to your variables, and form’s
actionbe PayPal’s page. That way customer will get there immediately, without PHP.Would this work for your situation? Or am I misunderstanding something?