这是我的 ipn.php
在我的日志错误文件中,我收到了这条消息:无效的响应状态:302
我从“异常”代码中收到邮件,有人知道为什么吗?我不知道为什么会失败...拜托,我需要帮助!
非常感谢
<?php
ini_set('log_errors', true);
ini_set('error_log', dirname(__FILE__).'/ipn_errors.log');
include '../../modelo.php';
include('ipnlistener.php');
$listener = new IpnListener;
$listener->use_sandbox = true;
$listener->use_ssl = false;
$verified = $listener->processIpn($my_post_data);
try {
// $listener->requirePostMethod();
$verified = $listener->processIpn();
mail('mymail@gmail.com', 'TRY ok', 'ok');
} catch (Exception $e) {
error_log($e->getMessage());
mail('mymail@gmail.com', 'Exception', 'nok');
exit(0);
}
mail('mymail@gmail.com', 'final del script', 'include');
?>
这是我的html代码:
<form name="_xclick" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="myemailpaypal@yopmail.com">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="item_name" value="<?php echo $product;?>">
<input type="hidden" name="amount" value="<?php echo $amount;?>">
<input type="hidden" name="return" value="http://www.myweb.com/thankspage.php">
<input type="hidden" name="custom" value="<?php echo $bookcode; ?>">
<input type="hidden" name="notify_url" value="http://www.myweb.com/ipn.php">
<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif"
border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>