ca.mint.mintchip.core

Class MessageFactory

java.lang.Object ca.mint.mintchip.core.MessageFactory

Direct Known Subclasses:
MessageFactory, MessageFactory

public abstract class MessageFactory extends Object

This class is responsible for instantiating message types. It is intended to be used as a super class by a class that can supply a specific implementation for the IBase64Processor interface.

Methods
Modifier and Type Method and Description
IValueRequestMessage createValueRequestMessage(String payeeId, int amount, CurrencyCode currencyCode)
Creates a request for a Value Message.
IMessage toMessage(String base64Message)
Creates a MintChip Message from an encoded base64 string.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Method Detail

createValueRequestMessage

public IValueRequestMessage createValueRequestMessage(String payeeId, int amount, CurrencyCode currencyCode)

Creates a request for a Value Message.

Parameters:
payeeId - the MintChip Id of the payee, the recipient
amount - the amount to be paid
currencyCode - the currency to be paid in
Returns:
the value request message

toMessage

public IMessage toMessage(String base64Message) throws IOException

Creates a MintChip Message from an encoded base64 string.

Parameters:
base64Message - the base64 encoded Message
Returns:
an instance of a class that implements an interface that extends the IMessage
Throws:
IOException - if the message can not be decoded correctly or if the message has been tampered with