由于我无法通过PayPal IPN文件中的$ _SESSION获取用户ID,因此我尝试发送用户名ID - 通过custom
字段购买服务的用户。< / p>
buy.php代码:( buy.php - &gt; Paypal - &gt; ipn.php)
$sendPayData = array(
"METHOD" => "BMCreateButton",
"VERSION" => "65.2",
"USER" => "UserApi",
"PWD" => "PwdAPI",
"SIGNATURE" => "SignatureAPI",
"BUTTONCODE" => "ENCRYPTED",
"BUTTONTYPE" => "BUYNOW",
"BUTTONSUBTYPE" => "SERVICES",
"BUTTONCOUNTRY" => "US",
"BUTTONIMAGE" => "reg",
"BUYNOWTEXT" => "BUYNOW",
"L_BUTTONVAR0" => "custom=".$_SESSION['ID'],
"L_BUTTONVAR1" => "item_number=1",
"L_BUTTONVAR2" => "item_name=API Plan",
"L_BUTTONVAR3" => "amount=10",
"L_BUTTONVAR4" => "currency_code=USD",
"L_BUTTONVAR5" => "no_shipping=1",
"L_BUTTONVAR6" => "no_note=1",
"L_BUTTONVAR7" => "notify_url=http://IPNLOCATION/IPN.PHP",
"L_BUTTONVAR8" => "cancel_return=http:/website.com/purchase.php",
"L_BUTTONVAR9" => "return=http://website.com/purchase.php"
);
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_URL, 'https://api-3t.sandbox.paypal.com/nvp?'.http_build_query($sendPayData));
$nvpPayReturn = curl_exec($curl);
curl_close($curl);
当通过Paypal处理请求时,它说: &#34;我们无法解密证书ID。&#34; 有什么想法吗?