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:
- Payment instrument (credit card)
- Brand (Mastercard)
- Payment protocol (SET)
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
-
Payment(Number, String, String, String, String)
- Creates a default payment specification.
-
equals(Object)
- Compares two payment objects for equality.
-
getAmount()
- Returns the amount of the payment.
-
getCurrency()
- Returns the three letter ISO currency code for the payment.
-
getPayeeName()
- Returns the distinguished name of the payee.
-
getPayerName()
- Returns the distinguished name of the payer.
-
toString()
- Returns a string representation of the payment information.
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
.
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.
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.
getPayerName
public String getPayerName()
- Returns the distinguished name of the payer.
- Returns:
- The distinguished name of the payer.
getPayeeName
public String getPayeeName()
- Returns the distinguished name of the payee.
- Returns:
- The distinguished name of the payee.
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
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