Fixed ipn.php SQL Inserts, more precisely, the row 'id' from znote_paypal table (#268)

This commit is contained in:
Felipe Siqueira Pinheiro 2017-01-18 09:13:04 -02:00 committed by Stefan A. Brannfjell
parent aa4d22654d
commit 6fa7d19cf1

View File

@ -82,7 +82,7 @@
$custom = (int)$_POST['custom']; $custom = (int)$_POST['custom'];
$connectedIp = $_SERVER['REMOTE_ADDR']; $connectedIp = $_SERVER['REMOTE_ADDR'];
mysql_insert("INSERT INTO `znote_paypal` VALUES ('', '$txn_id', 'Connection from IP: $connectedIp', '0', '0', '0')"); mysql_insert("INSERT INTO `znote_paypal` VALUES ('0', '$txn_id', 'Connection from IP: $connectedIp', '0', '0', '0')");
$status = VerifyPaypalIPN(); $status = VerifyPaypalIPN();
if ($status) { if ($status) {
@ -113,7 +113,7 @@
// Verify that the user havent messed around with POST data // Verify that the user havent messed around with POST data
if ($status) { if ($status) {
// transaction log // transaction log
mysql_insert("INSERT INTO `znote_paypal` VALUES ('', '$txn_id', '$payer_email', '$custom', '".$paidMoney."', '".$paidPoints."')"); mysql_insert("INSERT INTO `znote_paypal` VALUES ('0', '$txn_id', '$payer_email', '$custom', '".$paidMoney."', '".$paidPoints."')");
// Process payment // Process payment
$data = mysql_select_single("SELECT `points` AS `old_points` FROM `znote_accounts` WHERE `account_id`='$custom';"); $data = mysql_select_single("SELECT `points` AS `old_points` FROM `znote_accounts` WHERE `account_id`='$custom';");
@ -124,12 +124,12 @@
} }
} else { } else {
$pmail = $paypal['email']; $pmail = $paypal['email'];
mysql_insert("INSERT INTO `znote_paypal` VALUES ('', '$txn_id', 'ERROR: Wrong mail. Received: $receiver_email, configured: $pmail', '0', '0', '0')"); mysql_insert("INSERT INTO `znote_paypal` VALUES ('0', '$txn_id', 'ERROR: Wrong mail. Received: $receiver_email, configured: $pmail', '0', '0', '0')");
} }
} }
} }
} else { } else {
// Something is wrong // Something is wrong
mysql_insert("INSERT INTO `znote_paypal` VALUES ('', '$txn_id', 'ERROR: Invalid data. $postdata', '0', '0', '0')"); mysql_insert("INSERT INTO `znote_paypal` VALUES ('0', '$txn_id', 'ERROR: Invalid data. $postdata', '0', '0', '0')");
} }
?> ?>