Serginov
Onkonkoronkonk
@up
HELP @UP PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! xD
HELP @UP PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! xD
I have a question Why this is a donation, not a payment ?
Artii why is evryone using Manual transfering with premium points.
Like they click on a donation button and choose how much you want to donate then you email them your transaction code and they will transfer the p points manually for ya. xD whats the benefit with that? when you can use this script and have an automatic transfering system?
Probably because this isn't working. At least not for most of us anyways.
$mc_gross = $_REQUEST['mc_gross'];
if ($payment_status == "Completed" & $receiver_email == "[email protected]" & $mc_gross == "##.##") {
<?
$mysql_host = 'localhost'; //Leave at localhost
$mysql_user = 'root'; //DB User
$mysql_pass = ''; //DB Pass
$mysql_db = ''; //DB Name
$custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));
$receiver_email = $_REQUEST['receiver_email'];
$payment_status = $_REQUEST['payment_status'];
$mc_gross = $_REQUEST['mc_gross'];
// connect db
$db = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
mysql_select_db($mysql_db, $db);
if ($payment_status == "Completed" & $receiver_email == "[email protected]" & $mc_gross == "##.##") {
$query = "SELECT premium_points FROM accounts WHERE accounts.name = '$custom'";
$result = mysql_query($query);
$prem = mysql_fetch_array($result);
$points = $prem['premium_points'] + 12;
// $points = mysql_query($prem)
$qry2 = "UPDATE accounts SET premium_points = '$points' WHERE accounts.name = '$custom'";
$result2 = mysql_query($qry2);
}
else
{
echo("Error.");
}
?>
https://www.paypal.com/[u]uk[u/]/
https://www.paypal.com/[u]cl[u/]/
ok, so ppl will stop trying to get items from my site for .01 i'm going to post how to stop this.
Add this line to the ipn.php file:
Code:$mc_gross = $_request['mc_gross'];
now, modify the "if" statement to include the mc_gross variable and edit the number signs to make the dollar amount you are expecting, like this:
and that will do it. The return call now from paypal will include the amount and the query will verify that they actually paid the correct amount before it adds points to their account. If they only donate a penny and they were suppose to donate 5.00 then you get their penny and they get no points. ^_^ here is the fully ipn.php fileCode:if ($payment_status == "completed" & $receiver_email == "[email protected]" & $mc_gross == "##.##") {
PHP:<? $mysql_host = 'localhost'; //leave at localhost $mysql_user = 'root'; //db user $mysql_pass = ''; //db pass $mysql_db = ''; //db name $custom = stripslashes(ucwords(strtolower(trim($_request['custom'])))); $receiver_email = $_request['receiver_email']; $payment_status = $_request['payment_status']; $mc_gross = $_request['mc_gross']; // connect db $db = mysql_connect($mysql_host, $mysql_user, $mysql_pass); mysql_select_db($mysql_db, $db); if ($payment_status == "completed" & $receiver_email == "[email protected]" & $mc_gross == "##.##") { $query = "select premium_points from accounts where accounts.name = '$custom'"; $result = mysql_query($query); $prem = mysql_fetch_array($result); $points = $prem['premium_points'] + 12; // $points = mysql_query($prem) $qry2 = "update accounts set premium_points = '$points' where accounts.name = '$custom'"; $result2 = mysql_query($qry2); } else { echo("error."); } ?>
now maybe these ppl will realize this isn't an issue anymore and leave me alone. :thumbup:
To make it work for TFS 0.2
ipn/ipn.php
CHANGE FROM:
TO:
CHANGE FROM:
TO:
Enjoy
OK, so ppl will stop trying to get items from my site for .01 I'm going to post how to stop this.
Add this line to the ipn.php file:
Code:$mc_gross = $_REQUEST['mc_gross'];
Now, modify the "if" statement to include the mc_gross variable and edit the number signs to make the dollar amount you are expecting, like this:
And that will do it. The return call now from paypal will include the amount and the query will verify that they actually paid the correct amount before it adds points to their account. If they only donate a penny and they were suppose to donate 5.00 then you get their penny and they get no points. ^_^ Here is the fully ipn.php fileCode:if ($payment_status == "Completed" & $receiver_email == "[email protected]" & $mc_gross == "##.##") {
PHP:<? $mysql_host = 'localhost'; //Leave at localhost $mysql_user = 'root'; //DB User $mysql_pass = ''; //DB Pass $mysql_db = ''; //DB Name $custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom'])))); $receiver_email = $_REQUEST['receiver_email']; $payment_status = $_REQUEST['payment_status']; $mc_gross = $_REQUEST['mc_gross']; // connect db $db = mysql_connect($mysql_host, $mysql_user, $mysql_pass); mysql_select_db($mysql_db, $db); if ($payment_status == "Completed" & $receiver_email == "[email protected]" & $mc_gross == "##.##") { $query = "SELECT premium_points FROM accounts WHERE accounts.name = '$custom'"; $result = mysql_query($query); $prem = mysql_fetch_array($result); $points = $prem['premium_points'] + 12; // $points = mysql_query($prem) $qry2 = "UPDATE accounts SET premium_points = '$points' WHERE accounts.name = '$custom'"; $result2 = mysql_query($qry2); } else { echo("Error."); } ?>
Now maybe these ppl will realize this isn't an issue anymore and leave me alone. :thumbup:
I don't think it works for 0.2 TFS.
I changed the database login/pass and the database, also changed accounts.name to accounts.id
The script still isn't working quite right :blink:
<?
$mysql_host = 'localhost'; //Leave at localhost
$mysql_user = 'root'; //DB User
$mysql_pass = ''; //DB Pass
$mysql_db = ''; //DB Name
$file = 'paypal.log'; //Paypal Log Name will be placed in the same location as your ipn.php file
$custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));
$receiver_email = $_REQUEST['receiver_email'];
$payment_status = $_REQUEST['payment_status'];
$mc_gross = $_REQUEST['mc_gross'];
$payer_email = $_REQUEST['payer_email'];
$somecode = "'$custom' '$payer_email' '$mc_gross'";
// connect db
$db = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
mysql_select_db($mysql_db, $db);
if ($payment_status == "Completed" & $receiver_email == "[email protected]" & $mc_gross == "##.##") {
$query = "SELECT premium_points FROM accounts WHERE accounts.name = '$custom'";
$result = mysql_query($query);
$prem = mysql_fetch_array($result);
$points = $prem['premium_points'] + 12;
// $points = mysql_query($prem)
$qry2 = "UPDATE accounts SET premium_points = '$points' WHERE accounts.name = '$custom'";
// Log Paypal Transaction
$hak = fopen($file, "a");
fwrite($hak, $somecode);
fclose($hak);
$result2 = mysql_query($qry2);
}
else
{
echo("Error.");
}
?>