atg.commerce.payment
Class StoreCreditProcessorImpl

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.payment.StoreCreditProcessorImpl
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, atg.payment.storecredit.DecreaseStoreCreditAuthorizationProcessor, StoreCreditProcessor, java.util.EventListener

public class StoreCreditProcessorImpl
extends GenericService
implements StoreCreditProcessor, atg.payment.storecredit.DecreaseStoreCreditAuthorizationProcessor

This class performs the actual functions of authorizing, debiting and crediting a store credit. These are all the method that must be implemented in order to provide a payment method.


Field Summary
static java.lang.String CLASS_VERSION
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
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
StoreCreditProcessorImpl()
           
 
Method Summary
 StoreCreditStatus authorize(StoreCreditInfo pStoreCreditInfo)
          The authorizaton of a store credit calls the authorizeClaimableStoreCredit method in the ClaimableManager.
 StoreCreditStatus credit(StoreCreditInfo pStoreCreditInfo)
          Credit the store credit identified with the parameter pStoreCreditInfo.getStoreCreditNumber() the amount returned by the getAmount call on the same StoreCreditInfo parameter.
 StoreCreditStatus credit(StoreCreditInfo pStoreCreditInfo, PaymentStatus pStatus)
          Credit the store credit identified with the parameter pStoreCreditInfo.getStoreCreditNumber() the amount returned by the getAmount call on the same storeCreditInfo parameter.
 StoreCreditStatus debit(StoreCreditInfo pStoreCreditInfo, PaymentStatus pStatus)
          We check to see if the PaymentStatus amount is greater than the amount indicated in the storeCreditInfo.
 StoreCreditStatus decreaseAuthorization(StoreCreditInfo pStoreCreditInfo, PaymentStatus pAuthStatus)
          Decreases the authorized amount for the store credit identified with the parameter
 StoreCreditStatus expireAuthorization(StoreCreditInfo pStoreCreditInfo)
          Expire a store credit authorization
 ClaimableManager getClaimableManager()
          Get the ClaimableManager property.
protected  java.lang.String getNextTransactionId()
          This method generates a transactionId by returning a the System time in milliseconds.
 long getSecondsUntilExpiration()
          Returns property secondsUntilExpiration
 void setClaimableManager(ClaimableManager pClaimableManager)
          Set the ClaimableManager that will be used to claim the store credits.
 void setSecondsUntilExpiration(long pSecondsUntilExpiration)
          Sets property secondsUntilExpiration
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, 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, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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
Constructor Detail

StoreCreditProcessorImpl

public StoreCreditProcessorImpl()
Method Detail

setClaimableManager

public void setClaimableManager(ClaimableManager pClaimableManager)
Set the ClaimableManager that will be used to claim the store credits.

Parameters:
pClaimableManager - the ClaimableManager that will be used

getClaimableManager

public ClaimableManager getClaimableManager()
Get the ClaimableManager property.

Returns:
the ClaimableManager

getSecondsUntilExpiration

public long getSecondsUntilExpiration()
Returns property secondsUntilExpiration

Returns:
returns property secondsUntilExpiration

setSecondsUntilExpiration

public void setSecondsUntilExpiration(long pSecondsUntilExpiration)
Sets property secondsUntilExpiration

Parameters:
pSecondsUntilExpiration - the value to set for property secondsUntilExpiration

getNextTransactionId

protected java.lang.String getNextTransactionId()
This method generates a transactionId by returning a the System time in milliseconds. Override this method to generate the id a different way.


authorize

public StoreCreditStatus authorize(StoreCreditInfo pStoreCreditInfo)
The authorizaton of a store credit calls the authorizeClaimableStoreCredit method in the ClaimableManager.

Specified by:
authorize in interface StoreCreditProcessor
Parameters:
pStoreCreditInfo - the StoreCreditInfo reference which contains all the authorization data
Returns:
a StoreCreditStatus object detailing the results of the authorization

expireAuthorization

public StoreCreditStatus expireAuthorization(StoreCreditInfo pStoreCreditInfo)
Expire a store credit authorization

Specified by:
expireAuthorization in interface StoreCreditProcessor
Parameters:
pStoreCreditInfo - the StoreCreditInfo reference which contains all the authorization expiration data
Returns:
a StoreCreditStatus object detailing the results of the authorization

debit

public StoreCreditStatus debit(StoreCreditInfo pStoreCreditInfo,
                               PaymentStatus pStatus)
We check to see if the PaymentStatus amount is greater than the amount indicated in the storeCreditInfo. If it is greater, than we credit back the difference to the StoreCredit via the ClaimableManager.

Specified by:
debit in interface StoreCreditProcessor
Parameters:
pStoreCreditInfo - the StoreCreditInfo reference which contains all the debit data
pStatus - the PaymentStatus object which contains information about the transaction. This should be the object which was returned from authorize().
Returns:
a StoreCreditStatus object detailing the results of the debit

credit

public StoreCreditStatus credit(StoreCreditInfo pStoreCreditInfo,
                                PaymentStatus pStatus)
Credit the store credit identified with the parameter pStoreCreditInfo.getStoreCreditNumber() the amount returned by the getAmount call on the same storeCreditInfo parameter. The creditClaimableStoreCredit method will be called on the claimableManager to perform the actual crediting.

Specified by:
credit in interface StoreCreditProcessor
Parameters:
pStoreCreditInfo - the StoreCreditInfo reference which contains all the credit data
pStatus - the PaymentStatus object which contains information about the transaction. This should be the object which was returned from debit().
Returns:
a StoreCreditStatus object detailing the results of the credit

credit

public StoreCreditStatus credit(StoreCreditInfo pStoreCreditInfo)
Credit the store credit identified with the parameter pStoreCreditInfo.getStoreCreditNumber() the amount returned by the getAmount call on the same StoreCreditInfo parameter. The creditClaimableStoreCredit method will be called on the claimableManager to perform the actual crediting.

Specified by:
credit in interface StoreCreditProcessor
Parameters:
pStoreCreditInfo - the StoreCreditInfo reference which contains all the credit data
Returns:
a StoreCreditStatus object detailing the results of the credit

decreaseAuthorization

public StoreCreditStatus decreaseAuthorization(StoreCreditInfo pStoreCreditInfo,
                                               PaymentStatus pAuthStatus)
Decreases the authorized amount for the store credit identified with the parameter

Specified by:
decreaseAuthorization in interface atg.payment.storecredit.DecreaseStoreCreditAuthorizationProcessor
Parameters:
pStoreCreditInfo - the StoreCreditInfo reference which contains all the credit data
Returns:
a StoreCreditStatus object detailing the results of the decrease