希望有人能帮忙!当用户订阅付款被拒绝/失败时,我无法看到此代码用于更新数据库中的一行。
$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);
}