Glidarn
Member
Morning everyone, i found out that my paypal script doesnt work so i found another one
paypal.htm
ipn
as you can see here this script only offer you to donate so you get 40 points and i want it to be able to have 3 options so my script looks like this
paypal.htm
ipn
as you can see i added this to ipn
and this to paypal.htm
i do have the option to chose on 3 different donations now but do you think this will work?
paypal.htm
Lua:
<b>Automatic PayPal Donation System.</b><br><br>
The donation costs 10 EUR (incl. VAT).<br>
After the donation you will receive <b>38 points + 2 bonus points (Tot. 40 points)</b> in your account automatically. <br>Because you donate with PayPal / Creditcard you will receive +2 extra bonus points for free.<br><br>
<b>Here are the steps you need to make:</b> <br>
1. You need a valid creditcard <b>or</b> a PayPal account with a required balance [10 EUR]. <br>
2. Fill in your account number/name. <br>
3. Click on the donate button. <br>
4. Make a transaction on PayPal. <br>
5. After the transaction 40 points will be automatically added to your account. <br>
6. Go to Item shop and use your points <br> <br> <br> </b>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="**************">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="***** *******">
<b>Account number:</b> <input type="text" name="custom" value="">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="amount" value="10.0">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="notify_url" value="http://*********/ipn/ipn.php">
<input type="hidden" name="return" value="http://*******">
<input type="hidden" name="rm" value="0">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG_global.gif:NonHosted">
<input type="image" src="images/paypal_donate_button.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
ipn
Lua:
<?
$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 == "*********@******.**" & $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'] + 40;
// $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.");
}
?>
as you can see here this script only offer you to donate so you get 40 points and i want it to be able to have 3 options so my script looks like this
paypal.htm
Lua:
<b>PayPal Shop System.</b><br><br>
The shop costs:<ul><li> 5 EUR (for 7 points)</li><li> 10 EUR (for 12 points)</li><li> 20 EUR (for 25 points)</li><br>
<b>Here are the steps you need to make:</b> <br>
1. A PayPal account with a required balance [5, 10 or 20 EUR] or a creditcard. <br>
2. Fill in your account number. <br>
3. Click on the Buy Now button or your creditcard brand. <br>
4. Make a transaction. <br>
5. After the transaction 7, 12 or 25 points will be automatically added to your account. <br>
6. Go to Item shop and use your points <br> <br> <br> </b>
<span style="color:red">If you recall the money, and your premiumpoints can't be recalled your account will be deleted</span>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="********">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="Lorelia premium points">
<b>Account number:</b> <input type="text" name="custom" value="">
<select name="amount">
<option value="5.00">5 EUR</option>
<option value="10.00">10 EUR</option>
<option value="20.00">20 EUR</option>
</select>
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="notify_url" value="http://lorelia.hopto.org/ipn/ipn.php">
<input type="hidden" name="return" value="http://lorelia.hopto.org">
<input type="hidden" name="rm" value="0">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG_global.gif:NonHosted">
<input type="image" src="images/paypal_donate_button.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
ipn
Lua:
<?
$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 == "******" & $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'] + 7;
$points = $prem['premium_points'] + 12;
$points = $prem['premium_points'] + 25;
// $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.");
}
?>
as you can see i added this to ipn
Code:
$points = $prem['premium_points'] + 7;
$points = $prem['premium_points'] + 12;
$points = $prem['premium_points'] + 25;
and this to paypal.htm
Code:
<select name="amount">
<option value="5.00">5 EUR</option>
<option value="10.00">10 EUR</option>
<option value="20.00">20 EUR</option>
</select>
i do have the option to chose on 3 different donations now but do you think this will work?