com.aoindustries.aoserv.creditcards
Class CreditCardProcessorFactory

java.lang.Object
  extended by com.aoindustries.aoserv.creditcards.CreditCardProcessorFactory

public class CreditCardProcessorFactory
extends java.lang.Object

Creates instances of CreditCardProcessors based on the processor configurations found in the credit_card_processors table. Will only create once instance of each processor. Disabled processors will not be returned. When multiple processors are enabled for a business, adheres to the weight provided by the processors.

Author:
AO Industries, Inc.

Method Summary
static com.aoindustries.creditcards.CreditCardProcessor getCreditCardProcessor(com.aoindustries.aoserv.client.AOServConnector conn)
          Gets an enabled CreditCardProcessor from the list of processors for the business of the provided AOServConnector.
static com.aoindustries.creditcards.CreditCardProcessor getCreditCardProcessor(com.aoindustries.aoserv.client.CreditCardProcessor selectedCCP)
          Gets the processor for the given AOServ processor.

Only one instance of each unique CreditCardProcessor (unique based on providerId, classname and all parameters) will be created.

Every processor will use the AOServPersistenceMechanism for its persistence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCreditCardProcessor

public static com.aoindustries.creditcards.CreditCardProcessor getCreditCardProcessor(com.aoindustries.aoserv.client.AOServConnector conn)
                                                                               throws java.lang.ClassNotFoundException,
                                                                                      java.lang.NoSuchMethodException,
                                                                                      java.lang.IllegalAccessException,
                                                                                      java.lang.InstantiationException,
                                                                                      java.lang.reflect.InvocationTargetException,
                                                                                      java.io.IOException,
                                                                                      java.sql.SQLException
Gets an enabled CreditCardProcessor from the list of processors for the business of the provided AOServConnector. When multiple processors are enabled, those with a higher weight will be returned more often, proportional to weight. Uses the random source of the AOServConnector when selecting the processor.

Only one instance of each unique CreditCardProcessor (unique based on providerId, classname and all parameters) will be created.

Every processor will use the AOServPersistenceMechanism for its persistence.

Returns:
the processor or null if none found
Throws:
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
java.io.IOException
java.sql.SQLException

getCreditCardProcessor

public static com.aoindustries.creditcards.CreditCardProcessor getCreditCardProcessor(com.aoindustries.aoserv.client.CreditCardProcessor selectedCCP)
                                                                               throws java.lang.ClassNotFoundException,
                                                                                      java.lang.NoSuchMethodException,
                                                                                      java.lang.IllegalAccessException,
                                                                                      java.lang.InstantiationException,
                                                                                      java.lang.reflect.InvocationTargetException
Gets the processor for the given AOServ processor.

Only one instance of each unique CreditCardProcessor (unique based on providerId, classname and all parameters) will be created.

Every processor will use the AOServPersistenceMechanism for its persistence.

Throws:
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
See Also:
MerchantServicesProviderFactory.getMerchantServicesProvider(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)