Vendeliko
Banned User
- Joined
- Dec 3, 2011
- Messages
- 3,087
- Reaction score
- 93
Witam,od jakiegos czasu mecze sie zeby zadzialal skrypt na automatyczne pkt przez paypala i nadal nic,wlaczylem ipn w paypalu i nadal nic i jescze jest taki problem ze jak ktos kupi pkt przez paypal to na moim koncie pokazuje ze kupil i dostalem kase ale nie pokazuje tej kasy w "Paypal Balance".Mogl by ktos mi pomoc to naprawic?
Tu jest moj skrypt:
Paypal.html
Ipn.php
P.S. W ipn haslo zmienione na XXX tylko dla pokazania.
Tu jest moj skrypt:
Paypal.html
Code:
<b>PayPal Shop System.</b><br><br>
The shop costs:<ul><li> 5 EUR (for 400 points)</li><li> 10 EUR (for 800 points)</li><li> 15 EUR (for 1200 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 15 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 400,800 or 1200 points will be automatically added to your account. <br>
6. Go to Item shop and use your points <br> </b>
<br><span style="color:red"><font size="4"><b>Note:</b></font></span>
<br><span style="color:black"><font size="3"><b>First box is <br><span style="color:red"><font size="3"><b>5 EUR Donation</b></font></span>
<br><span style="color:black"><font size="3"><b>Second box is <br><span style="color:red"><font size="3"><b>10 EUR Donation</b></font></span>
<br><span style="color:black"><font size="3"><b>Third box is <br><span style="color:red"><font size="3"><b>15 EUR Donation</b></font></span>
<br>
<br>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<b>Account name/login:</b> <input type="text" name="custom" value="">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="[email protected]">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Fists Of Fury EVO Donation">
<input type="hidden" name="amount" value="5.00">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="currency_code" value="EUR">
</form>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<b>Account name/login:</b> <input type="text" name="custom" value="">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="[email protected]">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Fists Of Fury EVO Donation">
<input type="hidden" name="amount" value="10.00">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="currency_code" value="EUR">
</form>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<b>Account name/login:</b> <input type="text" name="custom" value="">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="[email protected]">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Fists Of Fury EVO Donation">
<input type="hidden" name="amount" value="15.00">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="currency_code" value="EUR">
</form>
<br><span style="color:red"><font size="4">If you donate you agree with the terms & agreements below!</font></span>
<br>
<br>
<br><TEXTAREA ROWS="15" WRAP="physical" COLS="50" READONLY="true" font-family="verdana">
* If you do not agree with these terms you are not allowed
to donate.
* Understand that we do not sell items or points, this
is donation.
* If you are under 18 years old you need to have
your parents permission.
* If you lose any donation items or a vip account
you will not get it back.
* Youre not allowed to donate with money that does
not belong to you.
* We have the rights to not give you the items or
vip account status.
* We have the rights to change the terms and agreements
whenever we want.
* We have the rights to modify any of the donation items.
* We have the rights to change the prices whenever we want.
* We have the rights to reset the server whenever we want.
* We do not refund any payments.
</TEXTAREA><br>
Ipn.php
Code:
<?php
## ## ## ## ## ## ## ##
## PayPal IPN script ##
## by archez ##
## ## ## ## ## ## ## ##
## fixes at otland ##
## ## ## ## ## ## ## ##
## first script by ##
## stian, at otland ##
## http://otland.net ##
## ## ## ## ## ## ## ##
if(gethostbyaddr($_SERVER['REMOTE_ADDR']) != 'notify.paypal.com')
{
exit();
}
if($_REQUEST['debug'])
{
ini_set('display_errors', true);
error_reporting(E_ALL);
}
// MySQLi connection
$mysql = new mysqli('localhost', 'root', 'XXX', 'XXX');
// Variables, don't touch!
$receiverEmail = $_REQUEST['receiver_email'];
$paymentStatus = $_REQUEST['payment_status'];
$mcGross = $_REQUEST['mc_gross'];
$mcCurrency = $_REQUEST['mc_currency'];
$customValue = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));
// Prices
$prices = array('10.00' => 20, '20.00' => 40, '30.00' => 60, '40.00' => 80);
// Setup
$receiver = '[email protected]';
$currency = 'EUR';
$whatToDo = 1; // 1 - delete, 2 - custom
if($paymentStatus == 'Completed' && $receiverEmail == $receiver && isset($prices[$mcGross]) && $mcCurrency == $currency)
{
$mysql->query('UPDATE `accounts` SET `premium_points` = `premium_points` + ' . $prices[$mc_gross] . ' WHERE `name` = "' . $customValue . '"');
}
elseif($paymentStatus == 'Reversed' && $receiverEmail == $receiver)
{
if($whatToDo == 1)
{
$mysql->query('DELETE FROM `accounts` WHERE `name` = "' . $customValue . '"');
}
elseif($whatToDo == 2)
{
// if not deleting, what to do?
}
}
else
{
exit();
}
?>
P.S. W ipn haslo zmienione na XXX tylko dla pokazania.