serve as a means of testing the rest of the payment service block
code
The "generic" payment system is a dummy payment system in the
account-based model. There is a single bank in the system which
keeps track of users, their account numbers, and their account
balances. To take money from an account, one must simply present the
account number to the acquirer.
All protocol flows are of the request/response type. There are four
types of protocols:
- Register
- User -> Acquirer : user name, amount, currency, version no.
- Acquirer -> User : account number, version no.
or
error (?)
Meaning: set the balance in the account of "user name" to "amount" and
return the "account number"
- Pay
- Payer -> Payee : payer name, payer account number, payee name, amount,
currency, ext ref, version no.
- Payee -> Payer : (request message with ok status)
or
error ()
Meaning: the return message is like a receipt.
- Authorise
- Payee -> Acquirer : payer account number, amount, currency, ext ref,
version no
- Acquirer -> Payee : success
or
error (no such account, not enough money)
Meaning: just check to see if the balance on "payer account number" is more
than "amount". No guarantee that a future capture will succeed.
Authorise and capture are not related.
- Capture
- Payee -> Acquirer : payer account number, payee account number, amount, currency, ext ref,
version no
- Acquirer -> Payee : (request message with ok status)
or
error (no such account, not enough money)
Meaning: Move amount from "payer account number" to "payee account number"
All protocol messages are objects of the
semper.payment.generic.genericModuleMessage
class. However, in a given flow of a protocol, only some fields are
relevant, as indicated above.
The payment system itself is implemented in the classes:
on the user side and
on the acquirer side.
The "adapter" is implemented in the form of the classes:
In order to make payments using the "generic" payment system, the
acquirer must have been already running on an "acquirer host." The
generic purses involved should have the address of the acquirer configured.
Creation and configuration of generic purses can be driven in the same way
as for any other purse (using the special business application for purse
management).