ID:1599035
 
(See the best response by Ssj4justdale.)
Problem description:
I'm currently accepting donations via Paypal. Would it be possible to automatically know if someone has made a successful transaction?

For example, I'm using the BYOND provided browser to donate to Person A. After a successful transaction, I'm redirected to a page, and BYOND waits for this page to appear, the page has a text "SUCCESS", "FAILURE". Or if neither the variable will be null. And if it happens to be true, the game automatically adds me to the subscriber list or do whatever action is necessary.

Any thoughts? Any possible way to do something like this?
Best response
This would be nice but what you're asking is a feature request.

Anywho, this is currently possible using PayPals IPN and a bit knowledge of PHP.

You just need a tad bit of PHP knowledge to utilize the script effeciently.

Using PayPals IPN(Instant-Payment Notification), you can have PHP record the transaction to a MySQL database, a text file, etc.

Upon doing so, you can also record if the payment was verified/accepted and add the "user" to a MySQL database and/or a text file.

When you want to view your subscribers, you can use a PHP webpage to get the list from the MySQL database, or just check a .txt file of the recorded "Donator's" and parse them into Dream Maker.

After that, you just really need to do something like so:

var/list/loaded_subs=list()
mob/var/tmp/isSubscriber=0
proc/checkSubscriber(mob/P)
if(!P||!ismob(P)||!P.client)return 0
var/active_sub=0
if(P.ckey in loaded_subs)
active_sub=1
if(!active_sub)
active_sub=world.Export("http://www.example.com/subscribers.php")
active_sub=file2text(active_sub["CONTENT"])
if(findtext(active_sub,P.ckey))
active_sub=1
loaded_subs+=P.ckey
else
active_sub=0
P.isSubscriber=active_sub
return active_sub



^This was just a random code that came to my head on a way to go about it.


This could be either the .txt method or the MySQL Database method, both work in this case.

Upon world creation, you should call a proc to load the subs and parse them and run that every hour or so. This way, every new user doesn't need to call world.Export()

The world.Export() for the users to call individually was placed there just to check if they are subscribed at that time.


There are other ways to do this, just this is an automated way.



Simply put.


Payment Sent > Your Paypal IPN Received > Writes key In Database/.txt File > Finished <-- You can call that saving.


checkSubscriber() gets called > User Found > They are a Sub <--- You can call that loading.


There are plenty of ways to do this, this is just one off the top of my head.