All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.commerce.Payment

java.lang.Object
   |
   +----semper.commerce.Payment

public final class Payment
extends Object
implements Serializable
This class encapsulates information about a specific payment such as amount and currency.

In the future it is likely that this class will be extended to accept a list of preferred payment methods. It is unclear how the service interface will be influenced by this. One possibility is to adopt the JEPI/UPP approach where a list of preferred payment methods is given. Each element in the list is a triple:

Taking into account that objects of this class are instantiated by business applications (the service provider), it should also be possible to associate different amounts and accepted currencies with the various payment methods.

Implementation note: Objects of this type must be immutable.

Version:
$Id: Payment.java,v 1.6 1998/07/10 08:22:04 semper Exp $
Author:
Rolf Michelsen, Stig Mj°lsnes
See Also:
PaymentTransaction

Constructor Index

 o Payment(Number, String, String, String, String)
Creates a default payment specification.

Method Index

 o equals(Object)
Compares two payment objects for equality.
 o getAmount()
Returns the amount of the payment.
 o getCurrency()
Returns the three letter ISO currency code for the payment.
 o getPayeeName()
Returns the distinguished name of the payee.
 o getPayerName()
Returns the distinguished name of the payer.
 o toString()
Returns a string representation of the payment information.

Constructors

 o Payment
 public Payment(Number amount,
                String currency,
                String payerName,
                String payeeName,
                String payeeAddr)
Creates a default payment specification. Only the amount, currency and the identities of the payer and payee are specified. The currency must be specified as a three letter ISO code (e.g. "NOK", "USD" or "XEU"), but the method does not validate the currency code.

Parameters:
amount - The amount of the payment.
currency - ISO currency code for the payment currency.
payerName - The distinguished name of the payer.
payeeName - The distinguished name of the payee.
payeeAddr - The network address of the peer, e.g. payee.net.

Methods

 o getAmount
 public Number getAmount()
Returns the amount of the payment. Note that the amount is returned as an instance of the abstract class Number that must be cast to the appropriate type.

Returns:
The amount of the payment.
 o getCurrency
 public String getCurrency()
Returns the three letter ISO currency code for the payment. Note that the currency code has not been validated by this class. If an illegal currency code was specified in the constructor, the same code will be returned.

Returns:
The three letter ISO currency code of the payment.
 o getPayerName
 public String getPayerName()
Returns the distinguished name of the payer.

Returns:
The distinguished name of the payer.
 o getPayeeName
 public String getPayeeName()
Returns the distinguished name of the payee.

Returns:
The distinguished name of the payee.
 o equals
 public boolean equals(Object obj)
Compares two payment objects for equality. If the parameter object is not of type Payment then the test will always fail. Note that this method does not compare the payee address fields of the two objects.

Parameters:
obj - The candidate object.
Returns:
true if the payments are equal.
Overrides:
equals in class Object
 o toString
 public String toString()
Returns a string representation of the payment information.

Returns:
A string representation of the payment information.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index