PayPal IPN电子邮件系统已经失控

时间:2015-03-04 19:08:44

标签: php mysql paypal paypal-ipn

当我尝试在我的IPN php脚本中实现自动邮件代码时遇到大问题?无论我在何处添加脚本,它都会阻止其余代码正常工作......因此,电子邮件脚本上方的任何内容都可以正常工作,然后停止。我甚至没有收到邮件?有任何想法吗?添加了以下代码没有邮件脚本,看看是否有任何原因......

    if($payment_status == 'Completed'){
        if($payment_currency == 'GBP'){

        $txn_id_check = mysql_query("SELECT `txn_id` FROM `payment_logs` WHERE `txn_id`='".$txn_id."'");
        if(mysql_num_rows($txn_id_check)!= 1){

            if($receiver_email == 'aidan6141@hotmail.co.uk'){

                    // Create USER Login
                    $sql=mysql_query("SELECT * FROM users WHERE email_address = '$payer_email'");
                      if(mysql_num_rows($sql)>=1){
                       echo '';
                      } else {

                        mysql_query("INSERT INTO `users` VALUES ('','','".$first_name."','".$last_name."','".$payer_email."','".$txn_id."','','','','',NOW(),'','','','')");  

                      }



                    // Add TXN ID to LOG
                    mysql_query("INSERT INTO `payment_logs` VALUES ('','".$first_name."','".$last_name."','".$payer_email."','".$txn_id."','£".$payment_amount."',NOW())");

                    // Add ORDER to ORDER LOG
                    mysql_query("INSERT INTO `webdesign_orders` VALUES ('','".$first_name."','".$last_name."','".$payer_email."','".$num_cart_items."','".$payment_status."',NOW(),'".$item_number1."','".$item_name1."','".$quantity1."','".$mc_gross_1."','".$item_number2."','".$item_name2."','".$quantity2."','".$mc_gross_2."','".$item_number3."','".$item_name3."','".$quantity3."','".$mc_gross_3."','".$item_number4."','".$item_name4."','".$quantity4."','".$mc_gross_4."','".$item_number5."','".$item_name5."','".$quantity5."','".$mc_gross_5."','".$item_number6."','".$item_name6."','".$quantity6."','".$mc_gross_6."','".$item_number7."','".$item_name7."','".$quantity7."','".$mc_gross_7."','".$item_number8."','".$item_name8."','".$quantity8."','".$mc_gross_8."','".$item_number9."','".$item_name9."','".$quantity9."','".$mc_gross_9."','".$item_number10."','".$item_name10."','".$quantity10."','".$mc_gross_10."','".$item_number11."','".$item_name11."','".$quantity11."','".$mc_gross_11."','".$item_number12."','".$item_name12."','".$quantity12."','".$mc_gross_12."','".$payment_amount."')");

                    // If WEBSITE add to WEBSITE ORDER LOG

                    if ($websiteorder == '1'){
                        mysql_query("INSERT INTO `webdesign_websites` VALUES ('','".$payer_email."','".$first_name."','".$last_name."','','Personal','£49.00','".$payment_status."',NOW(),'Pending','No data yet','No data yet','No data yet')");
                    } 
                    if ($websiteorder2 == '2'){
                        mysql_query("INSERT INTO `webdesign_websites` VALUES ('','".$payer_email."','".$first_name."','".$last_name."','','Business','£79.00','".$payment_status."',NOW(),'Pending','No data yet','No data yet','No data yet')");
                    } 
                    if ($websiteorder3 == '3'){
                        mysql_query("INSERT INTO `webdesign_websites` VALUES ('','".$payer_email."','".$first_name."','".$last_name."','','Professional','£109.00','".$payment_status."',NOW(),'Pending','No data yet','No data yet','No data yet')");
                    } 


                    // IF HOSTING add to HOSTING ORDER LOG

                    if ($hosting == '1'){
                        mysql_query("INSERT INTO `webdesign_hosting` VALUES ('','".$payer_email."','".$first_name."','".$last_name."','','Basic','£7.00','".$payment_status."',NOW(),'Pending','No data yet','No data yet','No data yet')");
                    } 
                    if ($hosting2 == '2'){
                        mysql_query("INSERT INTO `webdesign_hosting` VALUES ('','".$payer_email."','".$first_name."','".$last_name."','','Standard','£17.00','".$payment_status."',NOW(),'Pending','No data yet','No data yet','No data yet')");
                    } 
                    if ($hosting3 == '3'){
                        mysql_query("INSERT INTO `webdesign_hosting` VALUES ('','".$payer_email."','".$first_name."','".$last_name."','','Enhanced','£27.00','".$payment_status."',NOW(),'Pending','No data yet','No data yet','No data yet')");
                    } 


                    // IF EXTRAS add to EXTRAS ORDER LOG

                    if ($extras == '1'){
                        mysql_query("INSERT INTO `webdesign_extras` VALUES ('','".$payer_email."','".$first_name."','".$last_name."','','(SEO) Search Engine Optimization','£38.00','".$payment_status."',NOW(),'Pending','No data yet','No data yet','No data yet')");
                    } 
                    if ($extras2 == '2'){
                        mysql_query("INSERT INTO `webdesign_extras` VALUES ('','".$payer_email."','".$first_name."','".$last_name."','','Facebook Page Creation','£24.00','".$payment_status."',NOW(),'Pending','No data yet','No data yet','No data yet')");
                    } 
                    if ($extras3 == '3'){
                        mysql_query("INSERT INTO `webdesign_extras` VALUES ('','".$payer_email."','".$first_name."','".$last_name."','','Company Branding','£60.00','".$payment_status."',NOW(),'Pending','No data yet','No data yet','No data yet')");
                    } 
                    if ($extras4 == '4'){
                        mysql_query("INSERT INTO `webdesign_extras` VALUES ('','".$payer_email."','".$first_name."','".$last_name."','','BES Link Removal','£30.00','".$payment_status."',NOW(),'Pending','No data yet','No data yet','No data yet')");
                    } 
                    if ($extras5 == '5'){
                        mysql_query("INSERT INTO `webdesign_extras` VALUES ('','".$payer_email."','".$first_name."','".$last_name."','','Monthly Website Updates','£22.00','".$payment_status."',NOW(),'Pending','No data yet','No data yet','No data yet')");
                    } 
                    if ($extras6 == '6'){
                        mysql_query("INSERT INTO `webdesign_extras` VALUES ('','".$payer_email."','".$first_name."','".$last_name."','','Additional Website Page','£16.00','".$payment_status."',NOW(),'Pending','No data yet','No data yet','No data yet')");
                    }                               
            }
        }
        }
    }

} else if (strcmp ($res, "INVALID") == 0) {
    // log for manual investigation
}
?>

1 个答案:

答案 0 :(得分:0)

how to test PayPal IPN上查看此文章。如果您按照这些步骤操作,您将能够找到问题所在。