|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--webfunds.sox.Encodable
|
+--webfunds.sox.AbstractPayment
This class represents a signed payment. AbstractPayment objects are usually created using the createPayment method of an Account object, or re-constructed from a byte array which was created using the encode() method of a previous Payment object. Payments are encoded as a byte array for sending to third parties, and similarly, byte arrays are the form in which payments are received. It should be possible for classes to derive from this one, in order to have different functionality, so developers of this class should be sure to cater for derived classes.
| Field Summary | |
protected byte[] |
desc
A description (can be anything, although very long lengths may be refused by some issuers and clients, but at least 2K is guaranteed to be supported by all SOX compatible software) Note that it can be non-ascii, and non readable. |
protected ItemId |
item
The type of item (or "currency") of this payment. |
protected java.lang.String |
paymentId
The identifer for this payment. |
static int |
PF_VERSION
The version number for this payment structure: 0: sox 2 cheque only 1: AbstractPayment / PaymentFactory {cheque; token; wagner} |
protected long |
qty
The quantity of the item represented by this payment. |
static int |
SINGLETON_VERSION
The version number for this payment structure: 0: sox 2 cheque only 1: AbstractPayment / PaymentFactory {cheque; token; wagner} |
protected int |
subversion
The sub version of the subclass. |
protected int |
type
The type of payment of this class. |
protected int |
version
|
| Constructor Summary | |
AbstractPayment(byte[] paymentData)
Construct a payment object from a byte array that was previously returned from the encode() method of a payment object. |
|
AbstractPayment(java.io.InputStream is)
Construct a payment object from data in an input stream, where the data was previously returned from the encode() method of a payment object. |
|
AbstractPayment(int version,
int type,
int subversion,
ItemId item,
long qty,
byte[] desc)
Create a basic payment, a constructor for subclasses |
|
| Method Summary | |
abstract void |
decode(java.io.InputStream is)
Update this payment object with the values from a payment encoded as a byte array (such as previously returned from the encode() method of a payment object). |
abstract void |
encode(java.io.OutputStream os)
Encode a payment as a byte array, suitable for sending to third parties for depositing. |
boolean |
equals(java.lang.Object obj)
|
byte[] |
getDesc()
A description (can be anything, although very long lengths may be refused by some issuers and clients, but at least 2K is guaranteed to be supported by all SOX compatible software) Note that it can be non-ascii, and non readable. |
java.lang.String |
getId()
Get the Payment Id. |
ItemId |
getItem()
The type of item (or "currency") of this payment. |
long |
getQty()
The quantity of the item to be transferred between accounts |
AccountId |
getSource()
Get the account from which the transaction is drawn, should be overridden for sourced payments. |
int |
getSubVersion()
The sub version of the subclass. |
AccountId |
getTarget()
Get the account to which the payment is made, should be overridden for targetted payments. |
int |
getType()
The type of payment of this class. |
long |
getValidFrom()
Get the date from which the payment is valid. |
long |
getValidTill()
Get the date to which the payment is valid |
int |
getVersion()
The version number for the encoded form. |
boolean |
isBearer()
|
java.lang.String |
toString()
|
java.lang.String |
vString()
|
| Methods inherited from class webfunds.sox.Encodable |
decode,
encode,
main,
readByteArray,
readCertificate,
readProperties,
readString,
writeByteArray,
writeCertificate,
writeProperties,
writeString |
| Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int SINGLETON_VERSION
public static final int PF_VERSION
protected int version
protected int type
protected int subversion
protected java.lang.String paymentId
protected ItemId item
protected long qty
protected byte[] desc
| Constructor Detail |
public AbstractPayment(int version,
int type,
int subversion,
ItemId item,
long qty,
byte[] desc)
item - the item for which the payment is fordesc - a description of what this payment is for (optional)
public AbstractPayment(byte[] paymentData)
throws SOXPacketException
paymentData - the previously encoded payment
public AbstractPayment(java.io.InputStream is)
throws SOXPacketException
is - the input stream from which to read the payment data| Method Detail |
public int getVersion()
public int getType()
public int getSubVersion()
public AccountId getSource()
public AccountId getTarget()
public boolean isBearer()
public java.lang.String getId()
public long getValidFrom()
public long getValidTill()
public ItemId getItem()
public long getQty()
public byte[] getDesc()
public abstract void decode(java.io.InputStream is)
throws java.io.IOException,
SOXPacketException
paymentData - the previosly encoded payment
public abstract void encode(java.io.OutputStream os)
throws java.io.IOException
public java.lang.String toString()
public java.lang.String vString()
public boolean equals(java.lang.Object obj)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||