我试图提交给贝宝网站支付亲通过cURL。我正在尝试这样做:
// 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);我已经尝试了很多不同的选择,但我还没有让它起作用。我只想能够通过我的额外的vars贝宝,然后继续加载PP网站与添加的vars。这篇文章工作得很好,但我不知道如何让它转到PP站点!
发布于 2011-03-10 12:36:18
如果您正在尝试使用您的参数将您的客户重定向到paypal页面-您可以采用不同的方法。让你的表单,使帖子添加3个隐藏字段,您设置到您的变量,表单的action是贝宝的页面。这样,客户将立即到达那里,而不需要PHP。
这对你的情况有效吗?还是我误解了什么?
发布于 2011-09-28 02:45:07
我最近遇到了同样的问题,最终我创建了一组自己的类来与PayPal集成。我在how to integrate PayPal Website Payments Standard with your custom PHP shopping cart上写了一个详细的教程。
https://stackoverflow.com/questions/5255389
复制相似问题