Go Back   RunUO - Ultima Online Emulation > RunUO > General Discussion

General Discussion General discussion for the RunUO community, all off-topic posts will be deleted. This forum is NOT FOR SUPPORT!

Reply
 
Thread Tools Display Modes
Old 05-04-2008, 11:05 AM   #1 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,294
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Cool Automated Donation System using IPN

I am currently comming close to having completed a fully automated donation system API for my shard and was wondering if I should release it as a micro-SDK, considering that I would not be able to supply the web-code that will work the "catalog" on your website (would have to be written by you, to integrate into your website)

However, I can provide the database structures and IPN (PHP-format) along with the stand-alone system, which is very dynamic and uses only account tags and MySQL to function.

Some of the code for the database ODBC transactions is taken from my Automated Web-Accounting System, whereas file-writing (logs, receipts for tranactions, errors and failed donations) was partially taken from MyRunUO (Re-written on my shard)...

However, this seems to be a very powerful system and I should hope to have it completed soon, I'm (unfortunately) only writing it for RunUO 1.0, but my code style should be sufficient enough for it to be plug & play with 2.0 + (with an edit to the Commands.Register method for the typo).


Summary:

Player Opens your web-based donation catalog and adds their items to your cart, or whatever purchasing mechanism you use.
Given that you have already set-up and verified PayPal IPN on your PayPal Account, the Player's purchase will be directed to my IPN (on your servers of course) which will update the database structures that i provide with the system.

In turn, RunU will load new tranactions from the database, based upon status, sort them, log each transaction and write a receipt to a log file.
--Receipts can only be lost if they are removed from the MySQL database, as this system is completely dynamically handled (bar the Rewards list script) it updates and loads the transactions and rewards tables at every interval specified by you (World Save/Load or by Timer).

The Donation Handler then sorts the processed donations and checks the Donation Receipt Status. If the Receipt Status is ever changed, the Account that is linked to the receipt will automatically be notified of the new updated status, with a full report and receipt.

A typical transaction struct contains these public static variables:

(int) ID
(string) Code
(string) BarCodes
(double) Total
(Account) Account
(int) Status
(DateTime) TimeStamp
(string) Extra

ID will be constant, as it represents the ID of the entry in the Database Table.

Code is an encrypted MD5 or SHA1 string that is used to make matches between new and old receipts, to keep logs and such. The Code is decided upon the Time,Amount andAccount Name of the donator, pulled together as a string and Hashed (I will provide an encryption namespace or class that you can use globally on your server in any script.

BarCodes is a formatted string, which is put together by the catalog before the user submits any payments. BarCodes are Donation Entry (rewards table) Hashes that are used to get the reward type by matching the BarCode. The typical format of BarCodes is BA-RC-OD-E1*BA-RC-OD=E2* - where * is used as a char to split the strings for parsing later on.

Total is abviously the order amount total (whatever currency you use, it doesn't matter)

Account - nuff said :P - this is loaded along with the receip, from the Accounts Database using GetAccount( string username ) - where 'username' would be the value returned from checking the Receipts Database.

Status - The Status of the PayMent has some different states, handled by an Enumeration of literals for easier use.
Void = 0,
Pending = 1,
Processed = 2,
Delivered = 3,
Received = 4

--Void will be determined by the Donation Handler and the current status of the PayPal IPN for that Receipt Code.
--Pending means that the donation is new to the Receipts Database and is going to be loaded and Processed on your Shard.
--Processed means that the donation has be successfully proceessed, you have received payment and RunUO can now go ahead and Deliver the rewards.
--Delivered means that the rewards (listed as barcodes and translated into Types) have been tagged to the recipient's Account.
--Received is set only when that player logs in and uses the [DonationCheck (or other) command to Claim their donation. - When this is set, their receipt should be printed to the correct logs and an email notification sent to the player.


Back to the main list:

TimeStamp - Loaded from a Unix Epoch string of no more than 11 chars, translated, by some simple code, into a working DateTime format.

Extra - this is for any extra information you wish to pass on to the recepient, or for yourself.. This could includes "notes to the seller" (when a buyer can opt to leave comments for the seller on payment)

------------

This concludes the brief descriptions into what is to become probably the most complex custom automated (100% secure) system for runuo to date. If interested, please don't hesitate to let me know, here or PM.

Regards
__________________

RPK.VORSPIRE.COM - The WoW-UO Cross-Over Shard

Last edited by Admin Vorspire; 05-04-2008 at 11:08 AM.
Vorspire is offline   Reply With Quote
Reply

Bookmarks

Tags
automated, database, donate, donations, mysql


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5