The sample message format is shown below on fig.1.
Message is a MIME formatted message and has
predefined fields. Each message must have
following fields in it: "Request-Type","Currency-Name",
- Request-Type: this field defines the type of request to be sent to money server. The types are "GET","TRANSFER","ROLLBACK","INFO","INSERT","DELETE". Past two types are special and must be used by money gateways only.
- Currency-Name: this field defines the currency type (name) in international representation (ex. RUB,USD,DEM,FRF)
- Cache-Value: defines the price of transaction, the format is float number with 4-digits mantiss.
- Content-Type: defines the content type of message body and must be "multipart/mixed" because of the body must
have attachments of coins or cheques.
- TRANSFER - this type defines that the request is a normal transaction request and message has coins attached
- GET - this type defines that the request is a next step request of transaction and the message has cheques for retrieving new coins from transaction
- INFO - this type defines that the request made to verify cheque and transaction data and the message has cheque attached
- ROLLBACK - this type used to rollback unacceptable or cancelled transaction
- INSERT - this type used to add new coin in money server from real word, it must be used only to create or to grow the money mass and used by money server maintaners
- DELETE - this type is same as previous one, but used for deleting coins (ex. in exchange kiosks)
- VEKSEL - this type defines the reply from server for the normal transaction, when server inserted transaction data and freezed coins accepted for transaction. The reply must have two cheques attched.
fig.1 Sample request to server
Content-Description: Electronic Money
Vendor-Id: Bank, Ltd., Moscow, RU
Money MIME types
Money MIME types are used in attachments of messages. Money attchment must have the "Content-Type" set to "money/*" type, where first type 'money' is a group of money types, the second
slash delimited defines the type of money.
- "money/coin" - defines that attachment has the encrypted money in the body
- "money/check" - defines that attachment has cheque in the body (cheque is a one of the keys form randomly generated keypair for transaction, public one for recipient, private is for sender)
Next field in the money attachment is "Coin-Value", this field must exist if the content-type is set to money/coin and defines the price of the coin.
"Coin-Number" must exist if the content-type is set to money/coin and defines the coin number.
Vendor-Id must exist if the content-type is set to money/coin and defines the Vendor-Id generated this coin. This three fields Vendor-Id,Coin-Value,Coin-Number and
the encrypted body of the coin are used by the money servers for verifying coins in their databases, so fields MUST exist for security reason.