Php PayPal IPN页面未被点击,即使购买通过
我在沙箱中测试了一切,IPN侦听器将按预期工作,我也将在邮件中显示预期的响应 我现在已经上线了,但尽管客户可以支付购买罚款,PayPal甚至提供了购买交易ID,但IPN侦听器似乎已经停止工作,它从未听到PayPal发送的IPN,因此每次购买时都不会触发任何业务逻辑处理。怎么了 我的IPN侦听器代码没有问题,因为它在沙箱环境中工作得非常好。我使用了这个IPN代码: 它根本就不会被击中。以下是我使用NVP请求的方式:Php PayPal IPN页面未被点击,即使购买通过,php,paypal,live,paypal-ipn,Php,Paypal,Live,Paypal Ipn,我在沙箱中测试了一切,IPN侦听器将按预期工作,我也将在邮件中显示预期的响应 我现在已经上线了,但尽管客户可以支付购买罚款,PayPal甚至提供了购买交易ID,但IPN侦听器似乎已经停止工作,它从未听到PayPal发送的IPN,因此每次购买时都不会触发任何业务逻辑处理。怎么了 我的IPN侦听器代码没有问题,因为它在沙箱环境中工作得非常好。我使用了这个IPN代码: 它根本就不会被击中。以下是我使用NVP请求的方式: $return_url = urlencode("http://www.zeej.
$return_url = urlencode("http://www.zeej.com.sa/printshop/checkout4_confirm.php");
$cancel_url = urlencode("http://www.zeej.com.sa/printshop/cancel.php");
$notify_url = urlencode("http://www.zeej.com.sa/printshop/ipn.php");
$nvpStr ="&BUTTONCODE=HOSTED&BUTTONTYPE=BUYNOW&L_BUTTONVAR1=amount=".$usd_total."&L_BUTTONVAR2=return=".$return_url."&L_BUTTONVAR3=cancel_return=".$cancel_url."&L_BUTTONVAR4=no_shipping=1&L_BUTTONVAR5=notify_url=".$notify_url."&L_BUTTONVAR6=custom=".$custom_qs;
$httpParsedResponseAr = PPHttpPost('BMCreateButton', $nvpStr);
if("SUCCESS" == strtoupper($httpParsedResponseAr["ACK"]) || "SUCCESSWITHWARNING" == strtoupper($httpParsedResponseAr["ACK"])) {
$hostedbuttonid = $httpParsedResponseAr["HOSTEDBUTTONID"];
} else {
die('Please refresh the page and try again. <br />Error: Create Payment Button Failed: ' . print_r($httpParsedResponseAr, true));
}
您是否检查了服务器访问日志和错误日志以确保脚本没有出错?目前正在发生的一些IPN问题可能会导致您看到的YRU问题。我建议你开一张票,这样就可以调查这个问题了。这样,问题解决后也会通知您。好的,我找到了问题。贝宝没有任何问题。 我去了我的IPN页面
www.mydomain.com/printshop/IPN.php
,php告诉我页面上有语法错误。。。
这就是为什么它不接受任何IPN点击,因为它甚至没有运行!修复了语法错误,现在我收到了IPN点击。您是否检查了PayPal帐户中的IPN历史记录,以验证它是否确实从PayPal发送出去。另外,如果您在历史记录中查看IPN消息,它应该会给您一个状态代码,如果返回,它将返回一个状态代码。我刚刚检查了IPN历史记录,事务实际上就在那里!其状态为“已发送”。我还访问了developer.paypal.com并使用了IPN模拟器,但我的程序还是听不到IPN的声音。问题在哪里?在沙盒环境中运行时,我没有遇到任何问题。这是一个错误的URL吗?""... 难道不应该有这么长的路或什么的吗?
function PPHttpPost($methodName_, $nvpStr_) {
global $environment;
$environment = "";
// Set up your API credentials, PayPal end point, and API version.
$API_UserName = urlencode('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
$API_Password = urlencode('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
$API_Signature = urlencode('xxxxxxxxxxxxxxxxxxxxxxxxxx');
$API_Endpoint = "https://api-3t.paypal.com/nvp"; //
if("sandbox" === $environment || "beta-sandbox" === $environment) {
$API_Endpoint = "https://api-3t.$environment.paypal.com/nvp";
}
$version = urlencode('98.0');
// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $API_Endpoint);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
// Set the API operation, version, and API signature in the request.
$nvpreq = "METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature".$nvpStr_;
//echo($nvpreq);
// Set the request as a POST FIELD for curl.
curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);
// Get response from the server.
$httpResponse = curl_exec($ch);
if(!$httpResponse) {
exit("$methodName_ failed: ".curl_error($ch).'('.curl_errno($ch).')');
}
// Extract the response details.
$httpResponseAr = explode("&", $httpResponse);
$httpParsedResponseAr = array();
foreach ($httpResponseAr as $i => $value) {
$tmpAr = explode("=", $value);
if(sizeof($tmpAr) > 1) {
$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];
}
}
if((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {
exit("Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.");
}
return $httpParsedResponseAr;
}
?>