$payer_email_ipn =$_POST['payer_email'];
// failed subscription payment
if ($_POST['txn_type'] == 'subscr_failed') {
$sql = "UPDATE ipn_testing SET account_status='0' WHERE email='$payer_email_ipn'";
if (!mysql_query($sql)) {
error_log(mysql_error());
exit(0);
}
mail('amdin@mydomain.co.uk','IPN Notification: Subscription failed','Subscription failed for '.$payer_email_ipn);
exit(0);
}
我猜测它会与我们在付费时将account_status设置为1的代码类似,效果很好!但是,无论出于何种原因,这都行不通! :((成功付款的代码如下)
$sql = "UPDATE ipn_testing SET account_status='1' WHERE email='$payer_email_ipn'";
if (!mysql_query($sql)) {
error_log(mysql_error());
exit(0);
}
答案 0 :(得分:0)
您确定要输入该代码块吗?注意你所拥有的是有意义的,所以我会在//评论失败后放置一个错误日志,看看$ _POST ['txn_type']的值是什么。