atg.commerce.payment.processor
Class ProcProcessPaymentGroup

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.payment.processor.ProcProcessPaymentGroup
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, PipelineProcessor, java.util.EventListener
Direct Known Subclasses:
ProcProcessCreditCard, ProcProcessGiftCertificate, ProcProcessInvoiceRequest, ProcProcessStoreCredit

public abstract class ProcProcessPaymentGroup
extends GenericService
implements PipelineProcessor

This is the base class which processors that would like to perform auth/debit/credit actions on a particular payment group can extend from. The intention is that this class should provide utility methods which would be applicable to all PaymentGroup auth/debit/credits. Concrete uses of this class can be seen in ProcProcessCreditCard.

See Also:
ProcProcessCreditCard, ProcProcessGiftCertificate, ProcProcessStoreCredit

Field Summary
static java.lang.String CLASS_VERSION
           
static int SUCCESS
          The possible return value for this processor.
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.service.pipeline.PipelineProcessor
STOP_CHAIN_EXECUTION, STOP_CHAIN_EXECUTION_AND_COMMIT, STOP_CHAIN_EXECUTION_AND_ROLLBACK
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
ProcProcessPaymentGroup()
          Empty Constructor.
 
Method Summary
abstract  PaymentStatus authorizePaymentGroup(PaymentManagerPipelineArgs pParams)
          Method called to perform an authorization of a PaymentGroup.
abstract  PaymentStatus creditPaymentGroup(PaymentManagerPipelineArgs pParams)
          Method called to perform a credit of a PaymentGroup.
abstract  PaymentStatus debitPaymentGroup(PaymentManagerPipelineArgs pParams)
          Method called to perform a debit of a PaymentGroup.
 PaymentStatus decreaseAuthorizationForPaymentGroup(PaymentManagerPipelineArgs pParams)
          Method called to perform a decrease in authorization for a payment group.
 int[] getRetCodes()
          The possible return values for this processor.
protected  void invokeProcessorAction(PaymentManagerAction pProcessorAction, PaymentManagerPipelineArgs pParams)
          Method which can distribute a particular chain invocation to the correct method to invoke.
 int runProcess(java.lang.Object pParam, PipelineResult pResult)
          This method is the one called by the pipelin chain.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

SUCCESS

public static final int SUCCESS
The possible return value for this processor.

See Also:
Constant Field Values
Constructor Detail

ProcProcessPaymentGroup

public ProcProcessPaymentGroup()
Empty Constructor.

Method Detail

invokeProcessorAction

protected void invokeProcessorAction(PaymentManagerAction pProcessorAction,
                                     PaymentManagerPipelineArgs pParams)
                              throws CommerceException
Method which can distribute a particular chain invocation to the correct method to invoke. This is useful in the case where a single processor is designed to perform all the possible payment group actions. (auth, debit, and credit). The dispatching to the appropriate method is handled by inspecting the pProcessorAction and determing what method to call. The mapping is as follows: Each of the above methods shoudl return a PaymentStatus object. This PaymentStatus object is then placed into the pParams map using PipelineConstants.PAYMENT_STATUS as the key.

Parameters:
pProcessorAction - the action to perform. Should match a value in atg.commerce.payment.Constants
pParams - map of params handed to pipeline chain
Throws:
CommerceException - if an error occurs

decreaseAuthorizationForPaymentGroup

public PaymentStatus decreaseAuthorizationForPaymentGroup(PaymentManagerPipelineArgs pParams)
                                                   throws CommerceException
Method called to perform a decrease in authorization for a payment group.

This implementations does nothing by default and returns null.

Parameters:
pParams - params handed to pipeline processor
Returns:
a PaymentStatus value
Throws:
CommerceException - if an error occurs

authorizePaymentGroup

public abstract PaymentStatus authorizePaymentGroup(PaymentManagerPipelineArgs pParams)
                                             throws CommerceException
Method called to perform an authorization of a PaymentGroup. Needs to be implemented by subclasses.

Parameters:
pParams - params handed to pipeline processor
Returns:
a PaymentStatus value
Throws:
CommerceException - if an error occurs

debitPaymentGroup

public abstract PaymentStatus debitPaymentGroup(PaymentManagerPipelineArgs pParams)
                                         throws CommerceException
Method called to perform a debit of a PaymentGroup. Needs to be implemented by subclasses.

Parameters:
pParams - params handed to pipeline processor
Returns:
a PaymentStatus value
Throws:
CommerceException - if an error occurs

creditPaymentGroup

public abstract PaymentStatus creditPaymentGroup(PaymentManagerPipelineArgs pParams)
                                          throws CommerceException
Method called to perform a credit of a PaymentGroup. Needs to be implemented by subclasses.

Parameters:
pParams - params handed to pipeline processor
Returns:
a PaymentStatus value
Throws:
CommerceException - if an error occurs

runProcess

public int runProcess(java.lang.Object pParam,
                      PipelineResult pResult)
               throws java.lang.Exception
This method is the one called by the pipelin chain. Its purpose is to extract out a PipelineConstants.PAYMENT_PROC_ACTION value from the pipeline and then call invokeProcessorAction() with this values.

Classes will have to subclass this class in order to provide meaningful implementations of the auth, debit and credit methods.

Specified by:
runProcess in interface PipelineProcessor
Parameters:
pParam - an Object value
pResult - a PipelineResult value
Returns:
an int value
Throws:
java.lang.Exception - if an error occurs

getRetCodes

public int[] getRetCodes()
The possible return values for this processor.

Specified by:
getRetCodes in interface PipelineProcessor
Returns:
an int[] value. This is just the SUCCESS value.