org.davesag.generica.core
Class AbstractCreditCardAuthoriser

java.lang.Object
  extended byorg.davesag.generica.core.AbstractCreditCardAuthoriser
All Implemented Interfaces:
CreditCardAuthoriser, Persistable, Serializable

public abstract class AbstractCreditCardAuthoriser
extends Object
implements CreditCardAuthoriser, Persistable, Serializable

All Credit Card authorisation providers should provide a class that extends CreditCardAuthoriser and must be able to authorise a credit card payment and return a response code.

Since:
Generica 1.0
Version:
CVS Revision $Id: AbstractCreditCardAuthoriser.java,v 1.9 2004/04/06 15:40:40 davesag Exp $
Author:
Dave Sag http://www.davesag.com
See Also:
Serialized Form

Field Summary
protected  Boolean isTesting
          are we testing or is this a real transaction
protected  List theBanks
          list of banks this authoriser can authorise for.
protected  Currency theCurrency
          the base currency this authoriser charges in.
protected  Long theId
          authoriser's id used as a key by hibernate
protected  String theName
          the authoriser's name
protected  String theUrl
          The Url of this Link
 
Constructor Summary
AbstractCreditCardAuthoriser()
           
 
Method Summary
 void addBank(String bankname)
          Add a bank to the authoriser's bank list.
 boolean equals(Object o)
          Tests if the supplied object is equal to this AbstractCreditCardAuthoriser.
 List getBanks()
          get the banks that this authoriser can authorise for.
 Currency getCurrency()
          get the currency.
 String getCurrencyCode()
          get the currency.
 Long getId()
          Get the AbstractCreditCardAuthoriser's ID number.
 String getName()
          get the name.
 Boolean getTesting()
          returns True if we are testing.
 String getUrl()
          retusn a url for the link.
abstract  int hashcode()
          Override this to provide sepcific data.
 boolean isTesting()
          Returns true if we are testing.
 void removeBank(String bankname)
          Remove a bank from the authoriser's bank list.
 void setBanks(List banks)
          set the banks that this authoriser can authorise for.
 void setCurrency(Currency currency)
          set the currency
 void setCurrencyCode(String currency)
          set the currency
protected  void setId(Long id)
          Sets the The AbstractCreditCardAuthoriser's ID number.
 void setName(String name)
          set the name of authoriser.
 void setTemplateId(Long id)
          Sets the The AbstractCreditCardAuthoriser's ID number directly.
 void setTesting(Boolean testing)
          sets the testing flag.
 void setUrl(String url)
          Set an associated url for this Link.
 String toString()
          Override this to provide sepcific data.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.davesag.generica.core.CreditCardAuthoriser
authorisePayment, responseIsAuthorised
 

Field Detail

theId

protected Long theId
authoriser's id used as a key by hibernate


theUrl

protected String theUrl
The Url of this Link


theName

protected String theName
the authoriser's name


theBanks

protected List theBanks
list of banks this authoriser can authorise for.


theCurrency

protected Currency theCurrency
the base currency this authoriser charges in.


isTesting

protected Boolean isTesting
are we testing or is this a real transaction

Constructor Detail

AbstractCreditCardAuthoriser

public AbstractCreditCardAuthoriser()
Method Detail

setTesting

public void setTesting(Boolean testing)
sets the testing flag.

Parameters:
testing - Is this a test?

getTesting

public Boolean getTesting()
returns True if we are testing.

Returns:
True if we are testing.
Hibernate Property:

isTesting

public boolean isTesting()
Returns true if we are testing.

Returns:
true if we are testing.

getUrl

public String getUrl()
retusn a url for the link.

Returns:
An associated url for this Link. Can be null.
Hibernate Property:
length = "255"

setUrl

public void setUrl(String url)
Set an associated url for this Link.

Parameters:
url - A url for this Link.

getName

public String getName()
get the name.

Returns:
The name of authoriser.
Hibernate Property:
length = "255"

setName

public void setName(String name)
set the name of authoriser.

Parameters:
name - the authoriser's name.

getBanks

public List getBanks()
get the banks that this authoriser can authorise for.

Returns:
The List of banks this authoriser can authorise for.
Hibernate List:
lazy = "true" cascade="all"

setBanks

public void setBanks(List banks)
set the banks that this authoriser can authorise for.

Parameters:
banks - The List of bank names.

addBank

public void addBank(String bankname)
Add a bank to the authoriser's bank list.

Parameters:
bankname - The name of the bank to add.

removeBank

public void removeBank(String bankname)
Remove a bank from the authoriser's bank list.

Parameters:
bankname - The name of the bank to remove.

getCurrency

public Currency getCurrency()
get the currency.

Returns:
The currency.

setCurrency

public void setCurrency(Currency currency)
set the currency

Parameters:
currency - The currency.

getCurrencyCode

public String getCurrencyCode()
get the currency.

Returns:
The currency.
Hibernate Property:
length = "5"

setCurrencyCode

public void setCurrencyCode(String currency)
set the currency

Parameters:
currency - The currency.

getId

public Long getId()
Get the AbstractCreditCardAuthoriser's ID number.

Specified by:
getId in interface Persistable
Returns:
The CreditCardAuthoriser's ID number.
Hibernate Unique ID Property:
generator-class = "identity"

setId

protected void setId(Long id)
Sets the The AbstractCreditCardAuthoriser's ID number.

Parameters:
id - The ID number to set.

setTemplateId

public void setTemplateId(Long id)
Sets the The AbstractCreditCardAuthoriser's ID number directly. This is only to be used when creating a template object, and is not to be used when creating actual objects that will be persisted.

Specified by:
setTemplateId in interface Persistable
Parameters:
id - The ID number to set.

equals

public boolean equals(Object o)
Tests if the supplied object is equal to this AbstractCreditCardAuthoriser.

Parameters:
o - The object to test against this AbstractCreditCardAuthoriser. Must also be a AbstractCreditCardAuthoriser to make sense.
Returns:
true if the two AbstractCreditCardAuthoriser s have the same id.

hashcode

public abstract int hashcode()
Override this to provide sepcific data.

Returns:
a valid hashcode for this authoriser.

toString

public String toString()
Override this to provide sepcific data.

Returns:
the authoriser's name an details. useful for debugging.


Dave Sag Generica API version 0.5.9 - (prerelease) Copyright 2003 - 2004 Dave Sag.