Automatic PayPal Donation System
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
- u3games
- Posts: 1156
- Joined: Sun Feb 27, 2011 7:00 pm
- Location: España
- Contact:
Automatic PayPal Donation System
Single panel of automatic donations via paypal.
- You specify the name of the character and the amount to donate.
- The player gets in your inventory, the amount donated.
FEATURES:
+ Config for: currency, item id, count, ...
+ Bonus donation, example: donate 10 euros and gives you 20 items.
+ Delay Protector.
+ Telnet System.
+ Log donations.
+ Multilanguage.
+ SandBox test.
+ Reporting.
https://github.com/u3games/U3G_PayPal_System_MMORPG
Last edited by u3games on Wed May 06, 2015 11:29 pm, edited 5 times in total.
- u3games
- Posts: 1156
- Joined: Sun Feb 27, 2011 7:00 pm
- Location: España
- Contact:
-
- Posts: 13
- Joined: Sat Apr 25, 2015 1:42 am
Re: Automatic PayPal Donation System
Awesome gonna test it!
-
- Posts: 73
- Joined: Wed May 31, 2006 6:26 pm
- Location: Holland
- Contact:
Re: Automatic PayPal Donation System
Nice Keep up the good work.
- u3games
- Posts: 1156
- Joined: Sun Feb 27, 2011 7:00 pm
- Location: España
- Contact:
Re: Automatic PayPal Donation System
Thx ^^dasoldier wrote:Nice Keep up the good work.
Any suggestions to improve?
- UnAfraid
- L2j Veteran
- Posts: 4199
- Joined: Mon Jul 23, 2007 4:25 pm
- Location: Bulgaria
- Contact:
Re: Automatic PayPal Donation System
try to use activerecord it should be easier and decrease possibilities of sql injection.
-
- Posts: 73
- Joined: Wed May 31, 2006 6:26 pm
- Location: Holland
- Contact:
Re: Automatic PayPal Donation System
Hmm yes maby, i dont think its 100% fool proof.u3games wrote:Thx ^^dasoldier wrote:Nice Keep up the good work.
Any suggestions to improve?
What will happen when a player logs into the donation form and then login his character ingame before the paypal payment is done ?
The ipn will only check if a player is online and does not check if telnet is enabled on the server, and now it will just try to add the item trough telnet.
The result will be a failed donation.
Maby add some special characters check.
Code: Select all
/**
Validate name.
*/
function checkname($charname)
{
if(preg_match("/^[ _A-Za-z0-9-]+$/",$charname))
return TRUE;
return FALSE;
}
Code: Select all
$chkname = checkname(mysql_real_escape_string($_POST["custom"]));
Code: Select all
if ($chkname != 0){
............
.......
...
else{
echo '<center>Special chars in username are not allowed</center>';
}
- u3games
- Posts: 1156
- Joined: Sun Feb 27, 2011 7:00 pm
- Location: España
- Contact:
Re: Automatic PayPal Donation System
Nice, thx for info and code. But it is not necessary, in properties is customizable.dasoldier wrote:Hmm yes maby, i dont think its 100% fool proof.u3games wrote:Thx ^^dasoldier wrote:Nice Keep up the good work.
Any suggestions to improve?
What will happen when a player logs into the donation form and then login his character ingame before the paypal payment is done ?
The ipn will only check if a player is online and does not check if telnet is enabled on the server, and now it will just try to add the item trough telnet.
The result will be a failed donation.
Maby add some special characters check.
Code: Select all
/** Validate name. */ function checkname($charname) { if(preg_match("/^[ _A-Za-z0-9-]+$/",$charname)) return TRUE; return FALSE; }
Code: Select all
$chkname = checkname(mysql_real_escape_string($_POST["custom"]));
Code: Select all
if ($chkname != 0){ ............ ....... ... else{ echo '<center>Special chars in username are not allowed</center>'; }
Add Rev 4, multi-language support.
Last edited by u3games on Wed May 06, 2015 8:33 pm, edited 2 times in total.
-
- Posts: 73
- Joined: Wed May 31, 2006 6:26 pm
- Location: Holland
- Contact:
Re: Automatic PayPal Donation System
Oke
I dont know if you forgot to add dc_donations.sql, or trying to remove the table.
If so then there is still some code left behind in ipn_coins.php.
I dont know if you forgot to add dc_donations.sql, or trying to remove the table.
If so then there is still some code left behind in ipn_coins.php.
Code: Select all
// Here we will make a log of all the donations after the payment status is complete
mysqli_query($db_link, " INSERT INTO dc_donations (transaction_id,donation,amount,character_name)
VALUES (
'".esc($p->ipn_data['txn_id'])."',
'Paypal, Coins',
".(float)$amount.",
'".esc($custom)."'
)");
- u3games
- Posts: 1156
- Joined: Sun Feb 27, 2011 7:00 pm
- Location: España
- Contact:
Re: Automatic PayPal Donation System
Add in rev 7, thx for report ^^dasoldier wrote:Oke
I dont know if you forgot to add dc_donations.sql, or trying to remove the table.
If so then there is still some code left behind in ipn_coins.php.
Code: Select all
// Here we will make a log of all the donations after the payment status is complete mysqli_query($db_link, " INSERT INTO dc_donations (transaction_id,donation,amount,character_name) VALUES ( '".esc($p->ipn_data['txn_id'])."', 'Paypal, Coins', ".(float)$amount.", '".esc($custom)."' )");
-
- Posts: 73
- Joined: Wed May 31, 2006 6:26 pm
- Location: Holland
- Contact:
Re: Automatic PayPal Donation System
Maby something usefull to add.
creating a whitelist in the ipn script so that not everybody can access the file.
I'm not sure about the ip addresses yet.
But the paypal ipn response ip's should be added. And ofcourse the sandbox addresses.
When i'm sure what ip adresses are used, i will update the post.
PS. It should be safe tho, since people cannot get the verified payment status.
creating a whitelist in the ipn script so that not everybody can access the file.
I'm not sure about the ip addresses yet.
But the paypal ipn response ip's should be added. And ofcourse the sandbox addresses.
Code: Select all
if (!in_array($_SERVER['REMOTE_ADDR'],array('paypal.ipn.ip','paypal.ipn.ip','paypal.ipn.ip','paypal.ipn.ip')) {
header("HTTP/1.0 404 Not Found");
exit();
}
PS. It should be safe tho, since people cannot get the verified payment status.
-
- Posts: 13
- Joined: Sat Apr 25, 2015 1:42 am
Re: Automatic PayPal Donation System
Code: Select all
Parse error: syntax error, unexpected '}' in index.php on line 95
-
- Posts: 73
- Joined: Wed May 31, 2006 6:26 pm
- Location: Holland
- Contact:
Re: Automatic PayPal Donation System
change line: 15, 38, 62 in index.phporophix wrote:When I try to use itCode: Select all
Parse error: syntax error, unexpected '}' in index.php on line 95
From <? to <?php.
U3games thankyou.php file is missing.
- u3games
- Posts: 1156
- Joined: Sun Feb 27, 2011 7:00 pm
- Location: España
- Contact:
Re: Automatic PayPal Donation System
Thx, up in rev 8 --> https://github.com/u3games/U3G_PayPal_S ... 06f4ba7758dasoldier wrote:change line: 15, 38, 62 in index.phporophix wrote:When I try to use itCode: Select all
Parse error: syntax error, unexpected '}' in index.php on line 95
From <? to <?php.
U3games thankyou.php file is missing.