Class semper.payment.PaymentManager
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.payment.PaymentManager

java.lang.Object
   |
   +----semper.payment.PaymentManager

public class PaymentManager
extends Object
Payment manager. This class implements the functionality of the main controller of the payment block. It cannot be instantiated; it contains entirely of static methods and attributes. The init() method of this class must be invoked before the payment block can be used. The init() method is typically invoked during the bootstrapping process of SEMPER.
Version:
$Revision: 1.49 $ $Date: 1997/04/04 13:27:57 $
Author:
N. Asokan (aso@zurich.ibm.com)
See Also:
Library

Variable Index

 o FREE_CHOICE
Choice type flag to use during payment system selection negotiation: this value makes no restrictions on what the peer can choose.
 o PURSE_LIST_AS_PAYMENT_SYSTEM_NAMES
Return type indicator constant used in getListOfPurses(return_type_indicator) to indicate that a list of payment system names (String) must be returned.
 o PURSE_LIST_AS_PURSE_NAMES
Return type indicator constant used in getListOfPurses(return_type_indicator) to indicate that a list of purse names (String) must be returned.
 o PURSE_LIST_AS_PURSE_REFS
Return type indicator constant used in getListOfPurses(return_type_indicator) to indicate that a list of PurseReference objects must be returned.
 o SELECT_BY_PAYMENT_SYSTEM_NAME
Selector constant used in getListOfPurses(selector, name) to indicate that the second argument indicates a payment system name.
 o SELECT_BY_USER_NAME
Selector constant used in getListOfPurses(selector, name) to indicate that the second argument indicates a user name.
 o SELECT_PS_AND_SET_AMOUNT
Choice type flag to use during payment system selection negotiation: this value makes no restrictions on what the peer can do: he can select a subset of the proposed list of payment systems and reset the amount associated with each selected payment system.
 o SELECT_PS_ONLY
Choice type flag to use during payment system selection negotiation: this value allows the peer to select only the payment system name.

Method Index

 o choosePS(ComPoint, int, Vector)
Receive a proposed list of payment systems and corresponding amounts from the peer along with a choice_type flag.
 o choosePS(ComPoint, int, Vector, Amount)
Receive a proposed list of payment systems and corresponding amounts from the peer along with a choice_type flag.
 o confirmPurse(ComPoint, ServiceType, Amount, Vector, PaymentEntity)
Receive a confirmation request from the peer containing a single payment system and a corresponding amount.
 o confirmPurse(ComPoint, ServiceType, Amount, Vector, Vector, PaymentEntity)
Receive a confirmation request from the peer containing a single payment system and a corresponding amount.
 o createPurse(String, String)
Create a new purse and register with the payment manager.
 o deletePurse(String)
The reverse of createPurse: remove it from the payment manager's list as well as from the archive.
 o exchangeCurrency(Amount, Amount, boolean)
Exchange currency.
 o getListOfAllPurses(int)
Return the list (in the form specified by the input parameter) of all purses registered with the manager.
 o getListOfAllPurses(int, String)
Get the list of all purses registered with the manager which match the specified criteria.
 o getListOfEnabledPurseClasses()
Extract the names of purse classes that are available for use.
 o getListOfKnownPurseClasses()
Extract the names of purse classes that the payment manager knows about.
 o getListOfPurses(int)
Return the list of all active purses registered with the manager.
 o getListOfPurses(int, String)
Get the list of all active purses registered with the manager which match the specified criteria.
 o getListOfPurses(int, String, Vector)
Get the list of purses (from the input list) matching the specified criteria.
 o getListOfPurses(int, Vector)
This method takes a Vector of PurseReference objects as input along a return type indicator.
 o getPR()
Get a handle to the payment resources object
 o getPurseReference(String)
Get the reference to the named purse.
 o getPurseReference(String, Vector)
Get the reference to the named purse from the specified list of purses.
 o init()
Initialise the static payment manager.
 o isInitialised()
Check the initialisation status
 o registerPurseClassName(String, String)
Tell the payment manager about a new payment module.
 o registerTransaction(PaymentTransaction, String)
Depracated (will be removed shortly)
 o requestChoiceOfPS(ComPoint, int, Vector)
Propose a list of payment systems and corresponding amounts to the peer and request them to choose a subset of the payment systems.
 o requestChoiceOfPS(ComPoint, int, Vector, Amount)
Propose a list of payment systems and an amount to the peer and request them to choose a subset of the payment systems.
 o requestPurseConfirmation(ComPoint, PurseReference, Amount, PaymentEntity)
Having selected a purse, request confirmation from the peer.
 o requestPurseConfirmation(ComPoint, PurseReference, Vector, PaymentEntity)
Having selected a purse, request confirmation from the peer.
 o selectCandidatePurses(PaymentEntity, String, Amount, ServiceType, Vector, Vector, Vector)
Select a purse locally given certain conditions.
 o selectPayingPurse(PaymentEntity, String, Amount, Vector, Vector, Vector, String)
A specific way of selecting a purse for payment.
 o selectPurse(PaymentEntity, ServiceType, Amount, Vector, Vector)
Select a single from the input list restricted by the results of negotiations which is also given as input.
 o selectPurse(PaymentEntity, ServiceType, Vector)
Select a single purse from the input list.
 o selectReceivingPurse(PaymentEntity, PaymentEntity, Amount, Vector, Vector, Vector, String)
A specific way of selecting a purse for receiving payment.

Variables

 o PURSE_LIST_AS_PURSE_REFS
  public final static int PURSE_LIST_AS_PURSE_REFS
Return type indicator constant used in getListOfPurses(return_type_indicator) to indicate that a list of PurseReference objects must be returned.
See Also:
getListOfPurses
 o PURSE_LIST_AS_PURSE_NAMES
  public final static int PURSE_LIST_AS_PURSE_NAMES
Return type indicator constant used in getListOfPurses(return_type_indicator) to indicate that a list of purse names (String) must be returned.
See Also:
getListOfPurses
 o PURSE_LIST_AS_PAYMENT_SYSTEM_NAMES
  public final static int PURSE_LIST_AS_PAYMENT_SYSTEM_NAMES
Return type indicator constant used in getListOfPurses(return_type_indicator) to indicate that a list of payment system names (String) must be returned.
See Also:
getListOfPurses
 o SELECT_BY_USER_NAME
  public final static int SELECT_BY_USER_NAME
Selector constant used in getListOfPurses(selector, name) to indicate that the second argument indicates a user name.
See Also:
getListOfPurses
 o SELECT_BY_PAYMENT_SYSTEM_NAME
  public final static int SELECT_BY_PAYMENT_SYSTEM_NAME
Selector constant used in getListOfPurses(selector, name) to indicate that the second argument indicates a payment system name.
See Also:
getListOfPurses
 o FREE_CHOICE
  public final static int FREE_CHOICE
Choice type flag to use during payment system selection negotiation: this value makes no restrictions on what the peer can choose.
See Also:
requestChoiceOfPS, choosePS
 o SELECT_PS_AND_SET_AMOUNT
  public final static int SELECT_PS_AND_SET_AMOUNT
Choice type flag to use during payment system selection negotiation: this value makes no restrictions on what the peer can do: he can select a subset of the proposed list of payment systems and reset the amount associated with each selected payment system. Note that resetting of amount is useful in situations where the amount is dependent on the payment system used for the value transfer.
See Also:
requestChoiceOfPS, choosePS
 o SELECT_PS_ONLY
  public final static int SELECT_PS_ONLY
Choice type flag to use during payment system selection negotiation: this value allows the peer to select only the payment system name.
See Also:
requestChoiceOfPS, choosePS

Methods

 o init
  public static void init() throws PaymentServiceException
Initialise the static payment manager. The payment manager is a static entity -- i.e. it is never instantiated. The initialise() method is invoked during startup. Currently, the following actions are taken:
Returns:
nothing
Throws: PaymentServiceException
if initialisation failed
 o isInitialised
  public boolean isInitialised()
Check the initialisation status
Returns:
false if completely uninitialised; true otherwise
 o getPR
  public static PaymentResources getPR()
Get a handle to the payment resources object
Returns:
a PayementResources object
 o exchangeCurrency
  public static void exchangeCurrency(Amount from,
                                      Amount to,
                                      boolean change_from)
Exchange currency. The source and destination currencies are specified as part of the the respective amount objects. One of the amount fields should be Not Implemented Yet.
Parameters:
from - source amount
from - destination amount
change_from - flag if true, the amount specified in source should be converted; otherwise, amount specified in destination should be converted.
Returns:
nothing
 o getListOfAllPurses
  public static Vector getListOfAllPurses(int return_type_indicator) throws PaymentServiceException
Return the list (in the form specified by the input parameter) of all purses registered with the manager.
Parameters:
return_type_indicator - flag indicating the type of items to be returned can be one of:
  • PurseReference (PURSE_LIST_AS_PURSE_REFS)),
  • purse name, (PURSE_LIST_AS_PURSE_NAMES), or
  • payment system name(PURSE_LIST_AS_PAYMENT_SYSTEM_NAME)
Returns:
Vector representing list of purses (type of elements in the vector depends on the return_type_indicator)
Throws: PaymentServiceException
for misc. errors
See Also:
PurseReference, Purse, getListOfAllPurses, getListOfPurses
 o getListOfPurses
  public static Vector getListOfPurses(int return_type_indicator) throws PaymentServiceException
Return the list of all active purses registered with the manager. Active purses are those that have been successfully initialised already.
Parameters:
return_type_indicator - flag indicating the type of items to be returned can be one of:
  • PurseReference (PURSE_LIST_AS_PURSE_REFS)),
  • purse name, (PURSE_LIST_AS_PURSE_NAMES), or
  • payment system name(PURSE_LIST_AS_PAYMENT_SYSTEM_NAME)
Returns:
Vector representing list of purses (type of elements in the vector depends on the return_type_indicator)
Throws: PaymentServiceException
for misc. errors
See Also:
PurseReference, Purse, getListOfPurses, getListOfAllPurses
 o getListOfPurses
  public static Vector getListOfPurses(int return_type_indicator,
                                       Vector purserefs) throws PaymentServiceException
This method takes a Vector of PurseReference objects as input along a return type indicator. Depending on the latter, it returns a Vector of objects that describe the original list in different ways. The returned Vector is derived from a copy of the input Vector (i.e. changes to the returned Vector will have no effect on the original Vector)
Parameters:
return_type_indicator - flag indicating the type of items to be returned (can be one of: PurseReference, purse name, or payment system name.)
Returns:
Vector representing list of purses (type of elements in the vector depends on the return_type_indicator)
Throws: PaymentServiceException
for misc. errors
See Also:
PurseReference, Purse
 o getListOfPurses
  public static Vector getListOfPurses(int selector,
                                       String name) throws PaymentServiceException
Get the list of all active purses registered with the manager which match the specified criteria. The criteria can be one of: Active purses are those that have been successfully initialised already.
Parameters:
selector - flag describing the selector
name - value of the selector parameter
Returns:
a list of PurseReference objects
Throws: PaymentServiceException
on misc errors
See Also:
getListOfAllPurses, getListOfPurses
 o getListOfAllPurses
  public static Vector getListOfAllPurses(int selector,
                                          String name) throws PaymentServiceException
Get the list of all purses registered with the manager which match the specified criteria. The criteria can be one of:
Parameters:
selector - flag describing the selector
name - value of the selector parameter
Returns:
a list of PurseReference objects
Throws: PaymentServiceException
on misc errors
See Also:
getListOfPurses, getListOfAllPurses
 o getListOfPurses
  public static Vector getListOfPurses(int selector,
                                       String name,
                                       Vector purse_refs) throws PaymentServiceException
Get the list of purses (from the input list) matching the specified criteria. The criteria can be one of:
Parameters:
selector - flag describing the selector
name - value of the selector parameter
purse_refs - Vector of PurseReference objects
Returns:
a list of PurseReference objects
Throws: PaymentServiceException
on misc errors
See Also:
PurseReference, getListOfPurses
 o getPurseReference
  public static PurseReference getPurseReference(String purse_name)
Get the reference to the named purse.
Parameters:
purse_name - distinguished name of purse.
Returns:
a purse reference object pointing to the specified purse
See Also:
getPurseReference
 o getPurseReference
  public static PurseReference getPurseReference(String purse_name,
                                                 Vector purse_refs)
Get the reference to the named purse from the specified list of purses.
Parameters:
purse_name - distinguished name of purse.
purse_refs - Vector containing PurseReference objects.
Returns:
a purse reference object pointing to the specified purse
See Also:
getPurseReference
 o registerPurseClassName
  public static synchronized void registerPurseClassName(String key,
                                                         String purse_class)
Tell the payment manager about a new payment module. Installation scripts of payment modules should use this method to register their name with the payment manager. The registered names will be used by the PurseManagement class to provide a user interface to create new purses. If the "isEnabled()" method of the indicated class returns "true", then the class is marked as available for creating purses.
Parameters:
key - short form string tag for the payment system (e.g. "generic");
purse_class - describing the purse class name (e.g. "semper.payment.generic.genericPurse")
Returns:
nothing
See Also:
isEnabled
 o getListOfKnownPurseClasses
  public static Hashtable getListOfKnownPurseClasses()
Extract the names of purse classes that the payment manager knows about.
Returns:
Hashtable containing a list of string pairs
 o getListOfEnabledPurseClasses
  public static Hashtable getListOfEnabledPurseClasses()
Extract the names of purse classes that are available for use. Enabled purse classes are those for which the isEnabled method has returned true.
Returns:
Hashtable containing a list of string pairs
See Also:
isEnabled
 o createPurse
  public static Purse createPurse(String purse_class_name,
                                  String purse_name) throws AdapterNotFound, PaymentServiceException
Create a new purse and register with the payment manager. This is the "official" was to create a new purse. The following actions are taken during the execution of this method: It is also ensure that the purse name is unique.
Parameters:
purse_class_name - name of the purse class (e.g. ikpPurse)
purse_name - name of the new purse
Returns:
reference to the created purse
Throws: PaymentServiceException
for misc errors
Throws: AdapterNotFound
if one attempts to create a purse from a non-existent payment module
Throws: IllegalArgumentException
when a purse by the specified name already exists.
See Also:
deletePurse
 o deletePurse
  public static void deletePurse(String purse_name) throws PaymentServiceException
The reverse of createPurse: remove it from the payment manager's list as well as from the archive.
Parameters:
purse_name - distinguished name of purse to remove
Throws: PaymentServiceException
on failure
See Also:
createPurse
 o registerTransaction
  public static long registerTransaction(PaymentTransaction tr,
                                         String ext_ref) throws PaymentServiceException
Depracated (will be removed shortly)
Parameters:
tr - reference to the PaymentTransaction object
ext_ref - external reference string corresponding to the object
Returns:
assigned transaction ID
Throws: PaymentServiceException
on misc. errors
 o selectCandidatePurses
  public static Vector selectCandidatePurses(PaymentEntity peer,
                                             String my_alias,
                                             Amount amount,
                                             ServiceType service_type,
                                             Vector PS_list,
                                             Vector purse_name_list,
                                             Vector options) throws PaymentServiceException
Select a purse locally given certain conditions. There is no negotiation with peer or user involved in this method. User interaction _may_ be involved. For now, all parameters except PS_list are ignored and the list of all available purses is returned always. But this will change!
Parameters:
peer - the entity with whom we plan to engage in a transaction using one of the selected purses
my_alias - the name by which I am known to the peer; only those purses that have this string as the "username" will be chosen (some purses can have wildcard usernames?)
amount - the amount we tentatively plan to transfer
service_type - flag indicating the type of service for which the purse is being selected. Use the enumerations defined in the ServiceType class hierarchy.
PS_list - list of acceptable payment systems (Vector of Strings)
purse_name_list - list of names of acceptable purses (Vector of Strings); if this is null, all available purses are treated as candidates.
options - list of security attributes required for the proposed transaction (Vector of SecurityOption objects)
Returns:
the list of selected purses (Vector of PurseReference objects)
Throws: PaymentServiceException
for miscellaneous errors
See Also:
PurseReference, SecurityOption, PaymentEntity
 o selectPurse
  public static PurseReference selectPurse(PaymentEntity peer,
                                           ServiceType service_type,
                                           Vector candidate_purserefs)
Select a single purse from the input list. This selection will be eventually based on: There is no negotiation with the peer involved in this method. For now, it is simple and stupid: select the first element of the list.
Parameters:
peer - the entity with whom we plan to engage in a transaction using one of the selected purses
service_type - flag indicating the type of service for which the purse is being selected. Use the enumerations defined in the ServiceType class hierarchy.
candidate_purserefs - list of candidate purses (Vector of PurseReference objects)
Returns:
the PurseReference object corresponding to the selected purse.
 o selectPurse
  public static PurseReference selectPurse(PaymentEntity peer,
                                           ServiceType service_type,
                                           Amount amount,
                                           Vector candidate_purses,
                                           Vector PIM_shortlist) throws PaymentServiceException
Select a single from the input list restricted by the results of negotiations which is also given as input. There is no direct negotiation with the peer involved in this method. This selection will be eventually based on: For now, it is simple and stupid: depending on how the user has set her preferences, either it asks the user or it makes an arbitrary choice.
Parameters:
peer - the entity with whom we plan to engage in a transaction using one of the selected purses
service_type - flag indicating the type of service for which the purse is being selected. Use the enumerations defined in the ServiceType class hierarchy.
amount - the amount to be transferred in the proposed transaction. If the selected item from the PIM_shortlist has an different amount, then the value of this parameter will be reset accordingly. The caller should therefore examine the value of this parameter on return.
PIM_shortlist - Vector of PaymentInformationMessage representing the negotiated shortlist
candidate_purses - a Vector of PurseReference objects representing the candidate purses
Returns:
the PurseReference object corresponding to the selected purse.
Throws: PaymentServiceException
for misc. errors
See Also:
PaymentInformationMessage
 o requestChoiceOfPS
  public static Vector requestChoiceOfPS(ComPoint c,
                                         int choice_type,
                                         Vector PS_list,
                                         Amount amount) throws ComPointException, PaymentServiceException
Propose a list of payment systems and an amount to the peer and request them to choose a subset of the payment systems. The choice_type flag indicates how the peer should carry out his choice. In particular, if the peer is also allowed to set a different amount than the one proposed, the value of the amount parameter will be updated on return.
Parameters:
c - an already open communication channel
choice_type - flag indicating restrictions on how the peer can choose. This flag can take one of the following values:
  • FREE_CHOICE
  • SELECT_PS_AND_SET_AMOUNT
  • SELECT_PS_ONLY
PS_list - list of proposed payment systems
amount - proposed amount
Returns:
a Vector of PaymentInformationMessage objects representing the payment systems and corresponding amounts chosen by the peer
Throws: ComPointException
on communication errors
Throws: PaymentServiceException
on miscellaneous errors
See Also:
requestChoiceOfPS, PaymentInformationMessage
 o requestChoiceOfPS
  public static Vector requestChoiceOfPS(ComPoint c,
                                         int choice_type,
                                         Vector PIM_list) throws ComPointException, PaymentServiceException
Propose a list of payment systems and corresponding amounts to the peer and request them to choose a subset of the payment systems. The choice_type flag indicates how the peer should carry out his choice. In particular, if the peer is also allowed to set a different amount than the one proposed, the value of the amount parameter will be updated on return.
Parameters:
c - an already open communication channel
choice_type - flag indicating restrictions on how the peer can choose. This flag can take one of the following values:
  • FREE_CHOICE
  • SELECT_PS_AND_SET_AMOUNT
  • SELECT_PS_ONLY
PIM_list - proposal list in the form of a Vector of PaymentInformationMessage objects
Returns:
a Vector of PaymentInformationMessage objects representing the payment systems and corresponding amounts chosen by the peer
Throws: ComPointException
on communication errors
Throws: PaymentServiceException
on miscellaneous errors
See Also:
choosePS, MessageListHead, PaymentInformationMessage
 o choosePS
  public static Vector choosePS(ComPoint c,
                                int choice_type,
                                Vector PS_list,
                                Amount amount) throws PaymentServiceException, ComPointException
Receive a proposed list of payment systems and corresponding amounts from the peer along with a choice_type flag. Choose a subset of the payment systems based on the input list of payment systems and the peer's proposals.
Parameters:
c - an already open communication channel
choice_type - flag indicating restrictions that the peer can impose on us for the choice. It can be one of:
  • FREE_CHOICE
  • SELECT_PS_AND_SET_AMOUNT
  • SELECT_PS_ONLY
if it is anything other than FREE_CHOICE, the peer's choice_type should agree with our choice_type
PS_list - list of payment systems we are willing to use in the proposed transaction.
amount - proposed amount
Returns:
a Vector of PaymentInformationMessage objects representing the payment systems and corresponding amounts chosen by the peer
Throws: ComPointException
on communication errors
Throws: PaymentServiceException
on miscellaneous errors
See Also:
choosePS, MessageListHead, PaymentInformationMessage
 o choosePS
  public static Vector choosePS(ComPoint c,
                                int choice_type,
                                Vector PIM_list) throws PaymentServiceException, ComPointException
Receive a proposed list of payment systems and corresponding amounts from the peer along with a choice_type flag. Choose a subset of the payment systems based on the input list of payment systems and the peer's proposals.
Parameters:
c - an already open communication channel
choice_type - flag indicating restrictions that the peer can impose on us for the choice. It can be one of:
  • FREE_CHOICE
  • SELECT_PS_AND_SET_AMOUNT
  • SELECT_PS_ONLY
if it is anything other than FREE_CHOICE, the peer's choice_type should agree with our choice_type
PIM_list - our proposals list in the form of a Vector of PaymentInformationMessage objects
Returns:
a Vector of PaymentInformationMessage objects representing the payment systems and corresponding amounts chosen by the peer
Throws: ComPointException
on communication errors
Throws: PaymentServiceException
on miscellaneous errors
See Also:
requestChoiceOfPS, PaymentInformationMessage
 o requestPurseConfirmation
  public static boolean requestPurseConfirmation(ComPoint c,
                                                 PurseReference my_purse,
                                                 Amount amount,
                                                 PaymentEntity peer) throws ComPointException, PaymentServiceException
Having selected a purse, request confirmation from the peer. Exchange all parameters required for subsequent payment: e.g. the address to which payment protocol messages should be sent. This is a cover method that builds a Vector containing a single PaymentInformationMessage object and passes it to the second type of requestPurseConfirmation() method.
Parameters:
c - an already open channel
my_purse - reference to the selected purse
amount - proposed amount of the transaction
peer - address of the peer entity to which subsequent payment system protocol messages should be sent. This negotiation is currently not supported.
Returns:
true/false indicating whether the confirmation succeeded
Throws: ComPointException
for communication errors
Throws: PaymentServiceException
if purse cannotbe retrieved
See Also:
PurseReference, PaymentInformationMessage, requestPurseConfirmation, confirmPurse
 o requestPurseConfirmation
  public static boolean requestPurseConfirmation(ComPoint c,
                                                 PurseReference my_purseref,
                                                 Vector short_list,
                                                 PaymentEntity peer) throws ComPointException, PaymentServiceException
Having selected a purse, request confirmation from the peer. Exchange all parameters required for subsequent payment: e.g. the address to which payment protocol messages should be sent.
Parameters:
c - an already open channel
my_purse - reference to the selected purse
short_list - the short list (a Vector of PaymentInformationMessage objects) used earlier during the purse selection process. The amount will be taken from the first element in this short_list that corresponds to the chosen purse
peer - address of the peer entity to which subsequent payment system protocol messages should be sent. This negotiation is currently not supported.
Returns:
true/false indicating whether the confirmation succeeded
Throws: ComPointException
for communication errors
Throws: PaymentServiceException
for misc errors
See Also:
PaymentInformationMessage, confirmPurse
 o confirmPurse
  public static PurseReference confirmPurse(ComPoint c,
                                            ServiceType service_type,
                                            Amount amount,
                                            Vector candidate_purses,
                                            PaymentEntity peer) throws ComPointException, PaymentServiceException
Receive a confirmation request from the peer containing a single payment system and a corresponding amount. Decide if it is an acceptable choice based on our own input parameters. Choose a single purse from the list available to us. Set any other parameters necessary for subsequent protocol flows inside the chosen payment system. This is just a cover method that builds a Vector containing PaymentInformationMessage objects (one per available purse), invokes the second confirmPurse() method passing this Vector as a parameter, checks to make sure that the amount proposed by the peer agrees with our amount and returns the selected purse. TODO: This is ugly. Come back and check this later. Should we need switches to decide whether the responder is allowed to change the amount or not?
Parameters:
c - an already open channel
service_type - flag indicating the type of service for which the purse is being selected. Use the enumerations defined in the ServiceType class hierarchy.
amount - proposed amount for the transaction (must match what the peer proposes)
candidate_purses - list of candidate purses
peer - location to return the address to which subsequent payment system protocol messages should be sent.
Throws: ComPointException
for communication errors
Throws: PaymentServiceException
for misc errors
See Also:
requestPurseConfirmation, confirmPurse, PaymentInformationMessage
 o confirmPurse
  public static PurseReference confirmPurse(ComPoint c,
                                            ServiceType service_type,
                                            Amount amount,
                                            Vector PIM_list,
                                            Vector candidate_purses,
                                            PaymentEntity peer) throws ComPointException, PaymentServiceException
Receive a confirmation request from the peer containing a single payment system and a corresponding amount. Decide if it is an acceptable choice based on our own input parameters. Choose a single purse from the list available to us. Set any other parameters necessary for subsequent protocol flows inside the chosen payment system.
Parameters:
c - an already open channel
service_type - flag indicating the type of service for which the purse is being selected. Use the enumerations defined in the ServiceType class hierarchy.
amount - location to return the value of the agreed upon amount
PIM_list - list of acceptable combinations in the form of a Vector of PaymentInformationMessage objects.
candidate_purses - list of candidate purses
peer - location to return the address to which subsequent payment system protocol messages should be sent.
Throws: ComPointException
for communication errors
Throws: PaymentServiceException
for misc errors
See Also:
requestPurseConfirmation, PaymentInformationMessage
 o selectPayingPurse
  public static PurseReference selectPayingPurse(PaymentEntity peer,
                                                 String my_alias,
                                                 Amount amount,
                                                 Vector PS_list,
                                                 Vector purse_name_list,
                                                 Vector options,
                                                 String ext_ref) throws PaymentServiceException, ComPointException
A specific way of selecting a purse for payment. There are many ways in which the various purse selection methods (both local and negotiated) can be combined. This method implements one such combination with certain policy assumptions for selecting a purse for payment. These assumptions are:
Parameters:
peer - entity to which we propose to make a payment
my_alias - the alias by which I am known to the peer
amount - the amount we propose to pay
PS_list - the payment systems we are prepared to use. This parameter is a Vector of Strings. If it is null, all payment systems are considered to be candidates.
purse_name_list - the list of purses that we are prepared to use (this parameter is not used yet). This parameter os a Vector of Strings. If it is null, all purses are considered to be candidates.
options - list of security options required. This parameter is a Vector SecurityOption objects.
ext_ref - external reference string
Returns:
reference to the selected purse.
Throws: ComPointException
on communication errors.
Throws: PaymentServiceException
on misc. errors.
See Also:
selectReceivingPurse, SecurityOption
 o selectReceivingPurse
  public static PurseReference selectReceivingPurse(PaymentEntity peer,
                                                    PaymentEntity me,
                                                    Amount amount,
                                                    Vector PS_list,
                                                    Vector purse_name_list,
                                                    Vector options,
                                                    String ext_ref) throws PaymentServiceException, ComPointException
A specific way of selecting a purse for receiving payment. There are many ways in which the various purse selection methods (both local and negotiated) can be combined. This method implments one such combination with certain policy assumptions for selecting a purse for receiving payment. These assumptions are:
Parameters:
peer - entity from whom we propose to receive a payment
me - PaymentEntity object indicating where we should listen to in order to open a negotiation channel
amount - the amount we propose to receive
PS_list - the payment systems we are prepared to use. This parameter is a Vector of Strings. If it is null, all payment systems are considered to be candidates.
purse_name_list - the list of purses that we are prepared to use (this parameter is not used yet). This parameter os a Vector of Strings. If it is null all purses are considered to be candidates.
options - list of security options required. This parameter is a Vector SecurityOption objects.
ext_ref - external reference string sent by the peer
Returns:
reference to the selected purse.
Throws: ComPointException
on communication errors.
Throws: PaymentServiceException
on misc. errors.
See Also:
selectPayingPurse, SecurityOption

All Packages  Class Hierarchy  This Package  Previous  Next  Index