Hey, When someone buy points then i get the money but they wont get the points, So, im beging if someone really nice person, would help me, or just link me something xD I's it problem with IPN,The paypal script, or just something els, help! I HAVE TFS 0.3.6 
P.S: im giving them locations so you can know :w00t:
Script ipn/IPN.php
pages/paypal.php
Customscript/paypal/config.php
P.S: im giving them locations so you can know :w00t:
Script ipn/IPN.php
Code:
<?PHP
//// Config ////
$mysql_host = 'localhost'; //Leave at localhost
$mysql_user = '-------'; //DB User
$mysql_pass = '-------'; //DB Pass
$mysql_db = '-------'; //DB Name
$payment_amount = "10.00"
$email = "[email protected]"
$points = 28
$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'];
$logging = "'$custom' '$payer_email' '$mc_gross'";
if ($payment_status == "Completed" & $receiver_email == $email & $mc_gross == $payment_amount)
{
// connect db
$db = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
mysql_select_db($mysql_db, $db);
// get premium points
$query = "SELECT `premium_points` FROM `accounts` WHERE `name` = '$custom'";
$result = mysql_query($query);
$prem = mysql_fetch_array($result);
// update premium points
$points = $prem['premium_points'] + $points;
$query2 = "UPDATE `accounts` SET `premium_points` = '$points' WHERE `name` = '$custom'";
$result2 = mysql_query($query2);
// Log Paypal Transaction
$hak = fopen($file, "a");
fwrite($hak, $logging);
}
else
{
echo("Error.");
}
fclose($hak);
?>
pages/paypal.php
Code:
<?php
if(!defined('INITIALIZED'))
exit;
if($logged)
{
require_once('./custom_scripts/paypal/config.php');
echo '<h2>Automatic PayPal shop system</h2><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 amount of money.<br>
2. Choose how many points you want buy.<br />
3. Click on the donate/buy button.<br>
4. Make a transaction on PayPal.<br>
5. After the transaction points will be automatically added to your account.<br>
6. Go to Item shop and use your points.</b><br /><br />';
echo '<style>
table
{
border-collapse:collapse;
}
table, td, th
{
border:1px solid black;
}
</style>';
echo '<table cellspacing="0" style="width:100%"><tr><td colspan="2"><b>Select offer:</b></td></tr>';
foreach($paypals as $paypal)
{
echo '<tr><td>Buy ' . $paypal['premium_points'] . ' premium points for ' . $paypal['money_amount'] . ' ' . $paypal['money_currency'] . '</td><td style="text-align:center"><form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="' . $paypal_payment_type . '">
<input type="hidden" name="business" value="' . $paypal['mail'] . '">
<input type="hidden" name="item_name" value="' . htmlspecialchars($paypal['name']) . '">
<input type="hidden" name="custom" value="' . $account_logged->getID() . '">
<input type="hidden" name="amount" value="' . htmlspecialchars($paypal['money_amount']) . '">
<input type="hidden" name="currency_code" value="' . htmlspecialchars($paypal['money_currency']) . '">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="notify_url" value="' . $paypal_report_url . '">
<input type="hidden" name="return" value="' . $paypal_return_url . '">
<input type="hidden" name="rm" value="0">
<input type="image" src="' . $paypal_image . '" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
</form></td></tr>';
}
echo '</table>';
}
else
echo 'You are not logged in. Login first to buy points.';
Customscript/paypal/config.php
Code:
<?php
$paypal_report_url = 'http://pheonix-ot.zapto.org/?subtopic=buypoints';
$paypal_return_url = 'http://pheonix-ot.zapto.org/?subtopic=shopsystem';
$paypal_image = 'https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif';
$paypal_payment_type = '_xclick'; // '_xclick' (Buy Now) or '_donations'
$paypals[0]['mail'] = '[email protected]'; // your paypal login
$paypals[0]['name'] = '28 Premium Points!';
$paypals[0]['money_amount'] = '10';
$paypals[0]['money_currency'] = 'EUR'; // USD, EUR, more codes: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_currency_codes
$paypals[0]['premium_points'] = 28;
Last edited: