是否可以使用CURL和Paypal的开发人员沙盒?当我尝试这个代码时,它在print_r($ lines)中说; 我需要登录Sandbox,如何让它发送我的浏览器cookie?
此代码来自http://leepeng.blogspot.com/2006/04/standard-paypal-php-integration.html
$orderno = $_SESSION["ss_last_orderno"];
$ppAcc = "[SELLER HERE]";
$at = "[AT HERE]"; //PDT Identity Token
$url = "https://www.sandbox.paypal.com/cgi-bin/webscr"; //Test
//$url = "https://www.paypal.com/cgi-bin/webscr"; //Live
$tx = $_REQUEST['tx']; //this value is return by PayPal
$cmd = "_notify-synch";
$post = "tx=$tx&at=$at&cmd=$cmd";
//Send request to PayPal server using CURL
$ch = curl_init ($url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_TIMEOUT, 30);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
$result = curl_exec ($ch); //returned result …
Run Code Online (Sandbox Code Playgroud)