A Java Interface for (virtual) banking services - Proposal.
Background: The basic idea is that expecting one single plug-in to deal with everything having to do with money is likely to soon hit serious limits: somebody will always miss something, there might be different way of implementing single details, all the development burden will be on a single developer, and so on.
Proposal: Defining a Java interface which describes the services that a banking plug-in can implement and which separate plug-ins dealing with money in some way (shops, ATM, shipping services, subscription / renting services, ...) may use.
Each plug-in may be designed, developed and maintained separately, by different developers or teams; for specific services, even more than one implementation may be useful; and all the separate pieces will work together (plug-and-play), as they know what to expect from each other.
Interface: This is an initial version of such a Java interface. It defines points like:
*) Knowing the name and the symbol of the currency used by the 'bank'
*) Querying the 'bank' for availability of a given amount of money for a given player
*) Querying the current balance of the account of a player
*) Transfer money from one account to another, including special 'global accounts' for the bank itself and for the "World" (i.e. the whole server money system or "State")
*) Query transactions for a given account ('bank statement'), together with a format to held data for those transaction (new to ver. 0.2.0).
*) Reserve money from an account for future payment to another account
*) Ask an account (player) to authorise a payment request from another account
*) Establish recurrent payments from one account to another
*) The interface does not implement any service: it is not its purpose! It defines method names, parameters, conditions and return values by which a 'bank' can expose its services to any other interested plug-in, so that the latter can know what to ask and how.
*) 'Banks' are not required to support everything; in particular, a 'bank' may choose not to support the last 4 items above (statement, reserve, pre-authorisation, recurring payments) and the interface will provide a do-nothing-and-return-an-error stub.
*) More services can be defined in the future, as well as more default implementations, if there is a demand.
Files: At the moment the following files are provided:
*) BankIntf.jar: the compiled interface.
*) BankIntf_src.zip: the whole source code of the interface.
*) BankIntf_doc.zip: the Javadoc of the interface in HTML format.
Setup: The setup steps to use the interface from a plug-in are described in the Javadoc itself.
Samples: A simple 'banking' provider plug-in implementing this interface and providing some basic services can be found here. An example of a consumer plug-in (i.e. a plug-in which uses the services provided by the interface if available)can be found here.
Important disclaimer: The whole matter is only for dealing with in-game, fictitious money. It is not geared toward, and it shall not be expected to deal with, real money, nor shall it be used to manage any amount of real money!!
Comments and suggestions are welcome!