Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Web Web Donation to nxCredit questions (heavenms db)

Junior Spellweaver
Joined
Dec 13, 2004
Messages
119
Reaction score
4
Hi,

I have no experience in Paypal API nor coding a donation script.

However, using heavenms db, I would like to code a script in php that I assume will follow the following logic and would like to check if my logic is correct

1) Click on Donate
2) If not logged in, redirect to login page, else redirect to PayPal and start a listener to wait for paypal to return a 'success' call from its API
2) Upon successful donation -> Redirect a success, else timeout or failed
3) If success, execute a query to update (credit) maplePoint / nxCredit to db.account where accountid = $_SESSION['accountid']

Also, i understand that I need to set my paypal account as a merchant account, thus i'd like to confirm if my logic is correct prior to coding the page.
 

cMu

Elite Diviner
Joined
Jan 8, 2017
Messages
427
Reaction score
133
1. you need to trigger the button on press, and create a order db entry on ur DB, which will return to the client a details as such: item number (wait for 2.), price, currency and so on.
2. you will process the paypal payment through a form with the item number as the custom field.
3. your IPN will have to be integrate with PayPal and u will have to detect parameters such as:
a) price + currency
b) email that he paid for
c) valid or not (valid payment & status, pending, charged back etc)
4. you will perform a SELECT query from ur orders table to find this guy order, once u got that u know what package he bought, how much credits to give him, what was the cost etc.
5. u will perform a IF cases for prices, currency and more, you want to secure it as much as possible, else anyone will be able to send u a POST request to trick your system and basically to gain a free credits.

ps:
i have a paypal API system ready for maplebit for sell.
 
Upvote 0
Junior Spellweaver
Joined
Dec 13, 2004
Messages
119
Reaction score
4
1. you need to trigger the button on press, and create a order db entry on ur DB, which will return to the client a details as such: item number (wait for 2.), price, currency and so on.
2. you will process the paypal payment through a form with the item number as the custom field.
3. your IPN will have to be integrate with PayPal and u will have to detect parameters such as:
a) price + currency
b) email that he paid for
c) valid or not (valid payment & status, pending, charged back etc)
4. you will perform a SELECT query from ur orders table to find this guy order, once u got that u know what package he bought, how much credits to give him, what was the cost etc.
5. u will perform a IF cases for prices, currency and more, you want to secure it as much as possible, else anyone will be able to send u a POST request to trick your system and basically to gain a free credits.

ps:
i have a paypal API system ready for maplebit for sell.

thanks, i may or may not be able to code this myself. haha. but nevertheless, possible to add me on discord and prossibly quote me a price just incase i need your svcs?
 
Last edited by a moderator:
Upvote 0
Back
Top