YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Website Payments Standard and cURL Options
Forbidd3n
#1 Posted : Thursday, August 05, 2010 9:52:10 PM
Rank: Starting Member

Groups: Registered

Joined: 8/5/2010
Posts: 1
Location: United States
I am using cURL to post an item to Website Payments Standard in PayPal. My code, curl.donate.php is as follows...

$string = '';
foreach($_POST as $key=>$value) $string .= $key.'='.$value.'&';

$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim($string, '&'));
curl_setopt($ch, CURLOPT_URL, 'https://www.paypal.com/cgi-bin/webscr');
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
curl_close ($ch);



I invoke curl.donate.php from the donate.php page which calls an ajax call to the script like so...

$.ajax({
type: 'POST',
url: 'curl.donate.php',
data: 'business=myemail@yahoo.com&add=1&cmd=add&display=1&item_name=Donation for John Doe&amount=25.00&on0=Memory&os0=John Doe&on1=Send Acknowledgement To&os1=Jane Smith&on2=Address&os2=123 Main Street&on3=City, State Zip&os3=Naples, FL 34104',
success: function(data){
console.log(data);
}
});



When the page runs it prints out the entire PayPal home page in the firebug console. Therefore, it isn't posting something to the cart correctly.

PLEASE HELP! :)
Sponsor  
 
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.169 seconds.