我正在对iDev联盟Paypal IPN进行一些自定义工作,我正在尝试设置一个用于退款项目的捕获。我的数据库工作是正确的,但我似乎无法正确地获取IF捕获。
你有什么建议我应该如何更改它?
if($_REQUEST["payment_status"] == "refunded"||$testing==1)
{
$email = $_REQUEST["payer_email"];
$sid = $_REQUEST["subscr_id"];
$tid = $_REQUEST["txn_id"];
if (!$tid)
{
$tid='xxx';
}
if ($testing==1)
{
echo "testing on";
$sid = "I-E5E34E0DTMUS";
}
$query = "SELECT * FROM idevaff_sales WHERE tid1='$tid'";
$result = mysql_query($query);
if (!$result)
{
//echo $query; exit;
mail('***@gmail.com',"1",$query);
}
$arr = mysql_fetch_array($result);
$aid = $arr['id'];
$query = "SELECT * FROM idevaff_affiliates WHERE tid1='$tid'";
$result = mysql_query($query);
if ($result)
{
//echo $query;
mail('***@gmail.com',"2","$query");
}
$arr = mysql_fetch_array($result);
$email = $arr['email'];
$f_name = $arr['f_name'];
mail($email,"Affiliate Message - A refund has granted for recent affiliate commission.","Dear $f_name, \n\n Message here about refund" );
$query = "UPDATE idevaff_sales SET approved=3 WHERE tracking='$sid'";
$result = mysql_query($query);
if (!$result)
{
//echo $query; exit;
mail('***@gmail.com',"3","$query");
}
}
Hudson