All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.payment.generic.genericModule

java.lang.Object
   |
   +----semper.payment.generic.genericModule

public class genericModule
extends Object
Generic Payment Module. This module is the implementation of a "dummy" payment system. It is an "account-based" system. There are three types of entities in the system: the payer, the payee, and the bank. Currently, only one bank is supported. There are four types of transactions:
  • payment
  • authorisation
  • capture
  • registration/account-creation The bank knows each user by both a user name and an account number. To take money out of an account (e.g. in a payment), the bank must be given the account number: the account number is sort of like a credit-card number. All protocols are of the request/response type. All protocol messages have the same structure (of class genericModuleMessage)

    Version:
    $Revision: 1.27 $ $Date: 1997/09/19 14:02:56 $
    Author:
    N. Asokan (aso@zurich.ibm.com)

    Constructor Index

     o genericModule()

    Method Index

     o genericAccountStatus(String, ComPointAddress, StringBuffer, StringBuffer)
    Get the status of the account
     o genericAuthorise(String, ComPointAddress, String, String)
    Check authorisation for a payment.
     o genericCapture(String, String, ComPointAddress, String, String)
    Capture a payment.
     o genericInit(ComPointAddress)
    Initialise/re-initialise the system.
     o genericPay(String, String, String, ComPointAddress, String, String, String)
    Send a payment.
     o genericReceivePayment(ChannelServicePointThread, String[], String[], String[], String[], String, ComPointAddress, String)
    Receive a payment from anyone
     o genericRegister(String, ComPointAddress, String, String)
    Register the account with the acquirer.

    Constructors

     o genericModule
     public genericModule()
    

    Methods

     o genericInit
     public static ChannelServicePointThread genericInit(ComPointAddress addr) throws genericModuleException
    
    Initialise/re-initialise the system. This method registers a port/protocol with with the communication manager so that incoming payment messages can be handled.

    Parameters:
    addr - ComPointAddress object indicating port and protocol
    Returns:
    a handle to the service point thread created
    Throws: genericModuleException
    if the registration fails.
     o genericPay
     public static genericEvidence genericPay(String payer_name,
                                              String payer_AC_number,
                                              String payee_name,
                                              ComPointAddress payee,
                                              String amount,
                                              String currency,
                                              String ext_ref) throws genericModuleException
    
    Send a payment. Sends a payment to the specified party.

    Parameters:
    payer_name - name by which we are to be known to the payee (this need not be the same name that the bank knows us by)
    payer_AC_number - our account number in the bank
    payee_name - name of the payee
    payee - address of the payee
    amount - numeric value of payment
    currency - currency of payment
    ext_ref - external reference string to be passed on to the other side
    Returns:
    genericEvidence object containing results and status
    Throws: genericModuleException
    on all sorts of errors
    See Also:
    genericReceivePayment
     o genericReceivePayment
     public static genericEvidence genericReceivePayment(ChannelServicePointThread in_portal,
                                                         String a_amount[],
                                                         String a_currency[],
                                                         String a_payer_name[],
                                                         String a_payer_AC_number[],
                                                         String my_AC_number,
                                                         ComPointAddress acquirer,
                                                         String ext_ref) throws genericModuleException
    
    Receive a payment from anyone

    Parameters:
    in_portal - service point thread created when we registered our address with comm. manager
    a_amount - numeric value of payment (return value)
    a_currency - currency of payment (return value)
    a_payer_name - name of the payer (return value)
    a_payer_AC_number - (return value)
    ext_ref - external reference string passed on from the other side
    my_AC_number - my account number at the acquirer
    acquirer - address of the acquirer
    Returns:
    genericEvidence object containing results and status
    Throws: genericModuleException
    on all sorts of errors
    See Also:
    genericPay
     o genericAuthorise
     public static genericEvidence genericAuthorise(String payer_AC_number,
                                                    ComPointAddress acquirer,
                                                    String amount,
                                                    String currency) throws genericModuleException
    
    Check authorisation for a payment. Check to see if the payer account has enough money for a proposed payment.

    Parameters:
    payer_AC_nymber - payer's account number
    acquirer - address of the acquirer bank
    amount - numeric value of proposed payment
    currency - currency of proposed payment
    ext_ref - external reference string
    Returns:
    genericEvidence object containing results and status
    Throws: genericModuleException
    on all sorts of errors
     o genericAccountStatus
     public static genericEvidence genericAccountStatus(String account_number,
                                                        ComPointAddress acquirer,
                                                        StringBuffer amount,
                                                        StringBuffer currency) throws genericModuleException
    
    Get the status of the account

    Parameters:
    account_number - number of the account
    acquirer - address of the acquirer
    amount - holder for return value: amount
    currency - holder for return value: currency
    Returns:
    evidence accumulated during the transaction
    Throws: genericModuleException
    on misc.errors.
     o genericCapture
     public static genericEvidence genericCapture(String payer_AC_number,
                                                  String payee_AC_number,
                                                  ComPointAddress acquirer,
                                                  String amount,
                                                  String currency) throws genericModuleException
    
    Capture a payment. Arrange for the payment amount to be moved from the payer's account to our account.

    Parameters:
    payer_AC_nymber - payer's account number
    payee_AC_nymber - payee's account number
    acquirer - address of the acquirer bank
    amount - numeric value of proposed payment
    currency - currency of proposed payment
    ext_ref - external reference string
    Returns:
    genericEvidence object containing results and status
    Throws: genericModuleException
    on all sorts of errors
     o genericRegister
     public static String genericRegister(String name,
                                          ComPointAddress acquirer,
                                          String amount,
                                          String currency) throws genericModuleException
    
    Register the account with the acquirer. Create/renew an account and set the account balance to the specified amount.

    Parameters:
    name - name of the account holder
    acquirer - address of the bank
    amount - value of the new balance
    currency - currency of the new balance
    ext_ref - external reference string
    Returns:
    String representing the account number
    Throws: genericModuleException
    for misc. errors

    All Packages  Class Hierarchy  This Package  Previous  Next  Index