public class PaymentManager extends GenericService
authorize, credit and debit
methods in this class.
This class uses a pluggable configuration to allow for the ability to easily add new PaymentGroup
types. There is a map that is maintained that maps between PaymentGroups and pipeline chain
names. When any of the authorize, credit or debit methods are called a pipeline chain
is obtained for the particular PaymentGroup and executed. So, to add a new PaymentGroup type
all that should have to happen is to create a new PipelineChain where the processors of the
pipelinechain know how to perform an authorize, credit or debit. Then, make an entry for
this PaymentGroup to chainName mapping in the PaymentGroupToChainNameMap property. This
class should not have to be overriden to add new PaymentGroup types.
The methods which take a List of PaymentGroups do not need to be overridden because they just iterate
over the list calling the same method as itself passing each PaymentGroup object.Modifier and Type | Field and Description |
---|---|
protected static int |
AUTH |
static java.lang.String |
CLASS_VERSION |
protected static int |
CREDIT |
protected static int |
DEBIT |
protected static int |
DECREASE_AUTH |
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
PaymentManager() |
Modifier and Type | Method and Description |
---|---|
java.util.List |
authorize(Order pOrder,
java.util.List pPaymentGroups)
This method authorizes payment for the given PaymentGroups.
|
void |
authorize(Order pOrder,
PaymentGroup pPaymentGroup)
This method authorizes payment of the whole PaymentGroup.
|
void |
authorize(Order pOrder,
PaymentGroup pPaymentGroup,
double pAmount)
This method performs three steps.
|
protected PaymentStatus |
authorizeCreditCard(Order pOrder,
CreditCard pPaymentGroup,
double pAmount)
Deprecated.
use pipeline based authorization instead of methods directly in this class
|
protected PaymentStatus |
authorizeGiftCertificate(Order pOrder,
GiftCertificate pPaymentGroup,
double pAmount)
Deprecated.
use pipeline based authorization instead of methods directly in this class
|
protected PaymentStatus |
authorizeStoreCredit(Order pOrder,
StoreCredit pPaymentGroup,
double pAmount)
Deprecated.
use pipeline based authorization instead of methods directly in this class
|
protected void |
createErrorPaymentStatus(int pListType,
PaymentGroup pPaymentGroup,
double pAmount,
java.lang.String pErrorMessage)
This method creates a PaymentStatusImpl object and adds it to the appropriate
status list within the given PaymentGroup.
|
protected void |
createIgnorePaymentStatus(int pListType,
PaymentGroup pPaymentGroup,
double pAmount)
This method creates a PaymentStatusImpl object and adds it to the appropriate
status list within the given PaymentGroup.
|
java.util.List |
credit(Order pOrder,
java.util.List pPaymentGroups)
This method credits payment for the given PaymentGroups.
|
void |
credit(Order pOrder,
PaymentGroup pPaymentGroup)
This method credits payment of the whole PaymentGroup.
|
void |
credit(Order pOrder,
PaymentGroup pPaymentGroup,
double pAmount)
This method performs three steps.
|
CreditCardStatus |
creditCreditCard(CreditCardInfo pCreditCardInfo)
Deprecated.
use pipeline based debit instead of methods directly in this class
|
protected PaymentStatus |
creditCreditCard(Order pOrder,
CreditCard pPaymentGroup,
double pAmount)
Deprecated.
use pipeline based credit instead of methods directly in this class
|
GiftCertificateStatus |
creditGiftCertificate(GiftCertificateInfo pGiftCertificateInfo)
Deprecated.
use pipeline based credit instead of methods directly in this class
|
protected PaymentStatus |
creditGiftCertificate(Order pOrder,
GiftCertificate pPaymentGroup,
double pAmount)
Deprecated.
use pipeline based credit instead of methods directly in this class
|
protected PaymentStatus |
creditStoreCredit(Order pOrder,
StoreCredit pPaymentGroup,
double pAmount)
Deprecated.
use pipeline based credit instead of methods directly in this class
|
StoreCreditStatus |
creditStoreCredit(StoreCreditInfo pStoreCreditInfo)
Deprecated.
use pipeline based credit instead of methods directly in this class
|
java.util.List |
debit(Order pOrder,
java.util.List pPaymentGroups)
This method debits payment for the given PaymentGroups.
|
PipelineResult |
debit(Order pOrder,
PaymentGroup pPaymentGroup)
This method debits the entire amount of the pPaymentGroup.
|
PipelineResult |
debit(Order pOrder,
PaymentGroup pPaymentGroup,
double pAmount)
This method performs three steps.
|
protected PaymentStatus |
debitCreditCard(Order pOrder,
CreditCard pPaymentGroup,
double pAmount)
Deprecated.
use pipeline based debit instead of methods directly in this class
|
protected PaymentStatus |
debitGiftCertificate(Order pOrder,
GiftCertificate pPaymentGroup,
double pAmount)
Deprecated.
use pipeline based debit instead of methods directly in this class
|
protected PaymentStatus |
debitStoreCredit(Order pOrder,
StoreCredit pPaymentGroup,
double pAmount)
Deprecated.
use pipeline based debit instead of methods directly in this class
|
void |
decreaseAuthorization(Order pOrder,
PaymentGroup pPaymentGroup,
double pDecreaseAmount) |
void |
expireGiftCertificateAuthorization(Order pOrder,
GiftCertificate pPaymentGroup,
double pAmount)
This method expires authorization for a given gift certificate PaymentGroup for the amount that is
passed in.
|
void |
expireStoreCreditAuthorization(Order pOrder,
StoreCredit pPaymentGroup,
double pAmount)
This method expires authorization for a given StoreCredit PaymentGroup for the amount that is
passed in.
|
protected java.lang.String |
getAuthorizationChainName(PaymentGroup pPaymentGroup)
Obtain a pipeline chain that can authorize the pPaymentGroup.
|
protected java.lang.String |
getChainName(PaymentGroup pPaymentGroup)
This method provides a mechanism by which to obtain a PipelineChain
name from a given payment group.
|
CreditCardProcessor |
getCreditCardProcessor()
Returns the creditCardProcessor
|
protected java.lang.String |
getCreditChainName(PaymentGroup pPaymentGroup)
Obtain a pipeline chain that can credit the pPaymentGroup.
|
protected java.lang.String |
getDebitChainName(PaymentGroup pPaymentGroup)
Obtain a pipeline chain that can debit the pPaymentGroup.
|
protected java.lang.String |
getDecreaseAuthorizationChainName(PaymentGroup pPaymentGroup)
Obtain a pipeline chain that can decrease the authroization amount on the pPaymentGroup.
|
GiftCertificateProcessor |
getGiftCertificateProcessor()
Returns the GiftCertificateProcessor
|
boolean |
getIgnoreTransactionsWithZeroAmount()
Returns property ignoreTransactionsWithZeroAmount
|
atg.payment.instorepayment.InStorePaymentProcessor |
getInStorePaymentProcessor()
Returns the inStorePaymentProcessor
|
PaymentStatus |
getLastAuthorizationStatus(PaymentGroup pPaymentGroup)
This method returns the last PaymentStatus object in the authorizationStatus list of the given PaymentGroup
|
PaymentStatus |
getLastDebitStatus(PaymentGroup pPaymentGroup)
This method returns the last PaymentStatus object in the debitStatus list of the given PaymentGroup
|
OrderManager |
getOrderManager()
Returns the orderManager
|
java.util.Properties |
getPaymentGroupToChainNameMap()
Return the PaymentGroupToChainNameMap property.
|
PipelineManager |
getPipelineManager()
Return the PipelineManager property.
|
PricingTools |
getPricingTools()
PricingTools is used to round amounts during comparisons.
|
StoreCreditProcessor |
getStoreCreditProcessor()
Returns property StoreCreditProcessor
|
boolean |
isAmountTooHigh(double pAmountSoFar,
double pNewAmount,
PaymentGroup pPaymentGroup)
This method will add pAmountSoFar and pNewAmount.
|
protected void |
postProcessAuthorize(PaymentGroup pPaymentGroup,
PaymentStatus pStatus,
double pAmount)
This method executes post processing after an authorize() call to a payment processor.
|
protected void |
postProcessCredit(PaymentGroup pPaymentGroup,
PaymentStatus pStatus,
double pAmount)
This method executes post processing after a credit() call to a payment processor.
|
protected void |
postProcessDebit(PaymentGroup pPaymentGroup,
PaymentStatus pStatus,
double pAmount)
This method executes post processing after a debit() call to a payment processor.
|
protected void |
postProcessDecreaseAuthorization(PaymentGroup pPaymentGroup,
PaymentStatus pStatus,
double pDecreaseAmount)
This method executes post processing after an decreateAuthorize() call to a payment processor.
|
protected void |
preProcessAuthorize(Order pOrder,
PaymentGroup pPaymentGroup,
double pAmount)
This method executes pre processing before an authorize() call to a payment processor.
|
protected void |
preProcessCredit(Order pOrder,
PaymentGroup pPaymentGroup,
double pAmount)
This method executes pre processing before a credit() call to a payment processor.
|
protected void |
preProcessDebit(Order pOrder,
PaymentGroup pPaymentGroup,
double pAmount)
This method executes pre processing before a debit() call to a payment processor.
|
protected void |
preProcessDecreaseAuthorization(Order pOrder,
PaymentGroup pPaymentGroup,
double pDecreaseAmount)
This method executes pre processing before an decreaseAuthorization() call to a payment processor.
|
protected PipelineResult |
runProcessorChain(java.lang.String pChainName,
PaymentManagerPipelineArgs pParameters)
Utility method to run a pipeline chain.
|
void |
setCreditCardProcessor(CreditCardProcessor pCreditCardProcessor)
Sets the creditCardProcessor
|
void |
setGiftCertificateProcessor(GiftCertificateProcessor pGiftCertificateProcessor)
Sets the GiftCertificateProcessor
|
void |
setIgnoreTransactionsWithZeroAmount(boolean pIgnoreTransactionsWithZeroAmount)
Sets property ignoreTransactionsWithZeroAmount
|
void |
setInStorePaymentProcessor(atg.payment.instorepayment.InStorePaymentProcessor pInStorePaymentProcessor)
Sets the inStorePaymentProcessor
|
void |
setOrderManager(OrderManager pOrderManager)
Sets the orderManager
|
void |
setPaymentGroupToChainNameMap(java.util.Properties pPaymentGroupToChainNameMap)
Set the PaymentGroupToChainNameMap property.
|
void |
setPipelineManager(PipelineManager pPipelineManager)
Set the PipelineManager property.
|
void |
setPricingTools(PricingTools pPricingTools) |
void |
setStoreCreditProcessor(StoreCreditProcessor pStoreCreditProcessor)
Sets property StoreCreditProcessor
|
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
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
protected static final int AUTH
protected static final int DEBIT
protected static final int CREDIT
protected static final int DECREASE_AUTH
public PipelineManager getPipelineManager()
public void setPipelineManager(PipelineManager pPipelineManager)
pPipelineManager
- public java.util.Properties getPaymentGroupToChainNameMap()
public void setPaymentGroupToChainNameMap(java.util.Properties pPaymentGroupToChainNameMap)
pPaymentGroupToChainNameMap
- public CreditCardProcessor getCreditCardProcessor()
public void setCreditCardProcessor(CreditCardProcessor pCreditCardProcessor)
pCreditCardProcessor
- the creditCardProcessor to setpublic GiftCertificateProcessor getGiftCertificateProcessor()
public void setGiftCertificateProcessor(GiftCertificateProcessor pGiftCertificateProcessor)
pGiftCertificateProcessor
- the GiftCertificateProcessor to setpublic StoreCreditProcessor getStoreCreditProcessor()
public void setStoreCreditProcessor(StoreCreditProcessor pStoreCreditProcessor)
pStoreCreditProcessor
- the value to set for property StoreCreditProcessorpublic atg.payment.instorepayment.InStorePaymentProcessor getInStorePaymentProcessor()
public void setInStorePaymentProcessor(atg.payment.instorepayment.InStorePaymentProcessor pInStorePaymentProcessor)
pInStorePaymentProcessor
- the inStorePaymentProcessor to setpublic OrderManager getOrderManager()
public void setOrderManager(OrderManager pOrderManager)
pOrderManager
- the OrderManager to setpublic boolean getIgnoreTransactionsWithZeroAmount()
public void setIgnoreTransactionsWithZeroAmount(boolean pIgnoreTransactionsWithZeroAmount)
pIgnoreTransactionsWithZeroAmount
- the value to set for property ignoreTransactionsWithZeroAmountpublic void setPricingTools(PricingTools pPricingTools)
public PricingTools getPricingTools()
protected void createErrorPaymentStatus(int pListType, PaymentGroup pPaymentGroup, double pAmount, java.lang.String pErrorMessage)
pPaymentGroup
- the PaymentGroup to authorizePaymentException
- if an error occured while authorizing or pPaymentGroup is neither a
CreditCard or GiftCertificateCreditCardProcessor
,
GiftCertificateProcessor
protected void createIgnorePaymentStatus(int pListType, PaymentGroup pPaymentGroup, double pAmount)
pPaymentGroup
- the PaymentGroup to authorizePaymentException
- if an error occured while authorizing or pPaymentGroup is neither a
CreditCard or GiftCertificateCreditCardProcessor
,
GiftCertificateProcessor
protected void preProcessDecreaseAuthorization(Order pOrder, PaymentGroup pPaymentGroup, double pDecreaseAmount) throws CommerceException
pOrder
- the Order that the PaymentGroup exists inpPaymentGroup
- the PaymentGroup to be decreased in authorizationpDecreaseAmount
- the amount by which the amount is decreasingCommerceException
public void decreaseAuthorization(Order pOrder, PaymentGroup pPaymentGroup, double pDecreaseAmount) throws CommerceException
CommerceException
protected void postProcessDecreaseAuthorization(PaymentGroup pPaymentGroup, PaymentStatus pStatus, double pDecreaseAmount) throws CommerceException
pPaymentGroup
- the PaymentGroup which was decreased in authroization.pStatus
- the PaymentStatus object returned from the call of the payment processorpDecreaseAmount
- the amount by which the authorization amount is decreasingCommerceException
public void authorize(Order pOrder, PaymentGroup pPaymentGroup) throws CommerceException
pOrder
- the Order which contains the PaymentGrouppPaymentGroup
- the PaymentGroup to authorizePaymentException
- if an error occured while authorizing or pPaymentGroup is neither a
CreditCard or GiftCertificateCommerceException
CreditCardProcessor
,
GiftCertificateProcessor
,
StoreCreditProcessor
public void authorize(Order pOrder, PaymentGroup pPaymentGroup, double pAmount) throws CommerceException
preProcessAuthorize
method to perform any pre-processing.
Next, it actually performs an authorization by calling a pipeline
chain. The name of the chain to execute is determined by calling
the getAuthorizationChainName
method.
The following entries are added to the Map of parameters handed
to the pipeline chain
postProcessAuthorize
method is called.pOrder
- the Order which contains the PaymentGrouppPaymentGroup
- the PaymentGroup to authorizepAmount
- the amount to authorizePaymentException
- if an error occured while authorizingCommerceException
CreditCardProcessor
,
GiftCertificateProcessor
,
StoreCreditProcessor
public java.util.List authorize(Order pOrder, java.util.List pPaymentGroups) throws CommerceException
pOrder
- the Order which contains the PaymentGroupspPaymentGroups
- a list of PaymentGroups to authorizeInvalidParameterException
- if pPaymentGroups is nullCommerceException
authorize(Order, PaymentGroup)
public PipelineResult debit(Order pOrder, PaymentGroup pPaymentGroup) throws CommerceException
pPaymentGroup.getAmount()
.
To determine if the debit succeeded or failed, retrieve the last PaymentStatus object in the
debitStatus List property of the PaymentGroup and check the transactionSuccess and
errorMessage properties.pOrder
- the Order which contains the PaymentGrouppPaymentGroup
- the PaymentGroup to debitPaymentException
- if an error occured while debiting or pPaymentGroup is neither a
CreditCard or GiftCertificateCommerceException
CreditCardProcessor
,
GiftCertificateProcessor
,
StoreCreditProcessor
public PipelineResult debit(Order pOrder, PaymentGroup pPaymentGroup, double pAmount) throws CommerceException
preProcessDebit
method to perform any pre-processing.
Next, it actually performs a debit by calling a pipeline
chain. The name of the chain to execute is determined by calling
the getDebitChainName
method.
The following entries are added to the Map of parameters handed
to the pipeline chain
postProcessDebit
method is called.
To determine if the debit succeeded or failed, retrieve the last PaymentStatus object in the
debitStatus List property of the PaymentGroup and check the transactionSuccess and
errorMessage properties.pOrder
- the Order which contains the PaymentGrouppPaymentGroup
- the PaymentGroup to debitPaymentException
- if an error occured while debitingCommerceException
CreditCardProcessor
,
GiftCertificateProcessor
,
StoreCreditProcessor
public java.util.List debit(Order pOrder, java.util.List pPaymentGroups) throws CommerceException
pOrder
- the Order which contains the PaymentGroupspPaymentGroups
- a list of PaymentGroups to debitInvalidParameterException
- if pPaymentGroups is nullCommerceException
debit(Order, PaymentGroup)
public void credit(Order pOrder, PaymentGroup pPaymentGroup) throws CommerceException
credit
method that takes an amount parameter. This amount is obtained from the pPaymentGroup.
To determine if the credit succeeded or failed, retrieve the last PaymentStatus object in the
creditStatus List property of the PaymentGroup and check the transactionSuccess and
errorMessage properties.pOrder
- the Order which contains the PaymentGrouppPaymentGroup
- the PaymentGroup to creditPaymentException
- if an error occured while crediting or pPaymentGroup is neither a
CreditCard or GiftCertificateCommerceException
CreditCardProcessor
,
GiftCertificateProcessor
,
StoreCreditProcessor
public void credit(Order pOrder, PaymentGroup pPaymentGroup, double pAmount) throws CommerceException
preProcessCredit
method to perform any pre-processing.
Next, it actually performs a credit by calling a pipeline
chain. The name of the chain to execute is determined by calling
the getCreditChainName
method.
The following entries are added to the Map of parameters handed
to the pipeline chain
postProcessCredit
method is called.
To determine if the credit succeeded or failed, retrieve the last PaymentStatus object in the
creditStatus List property of the PaymentGroup and check the transactionSuccess and
errorMessage properties.pOrder
- the Order which contains the PaymentGrouppPaymentGroup
- the PaymentGroup to creditpAmount
- the amount to credit to this PaymentGroupPaymentException
- if an error occured while crediting or pPaymentGroup is neither a
CreditCard or GiftCertificateCommerceException
CreditCardProcessor
,
GiftCertificateProcessor
,
StoreCreditProcessor
public java.util.List credit(Order pOrder, java.util.List pPaymentGroups) throws CommerceException
pOrder
- the Order which contains the PaymentGroupspPaymentGroups
- a list of PaymentGroups to creditInvalidParameterException
- if pPaymentGroups is nullCommerceException
credit(Order, PaymentGroup)
protected PaymentStatus authorizeCreditCard(Order pOrder, CreditCard pPaymentGroup, double pAmount) throws CommerceException
pOrder
- the Order which contains the PaymentGrouppPaymentGroup
- the credit card PaymentGroup on which to authorizepAmount
- the amount to be authorized on the PaymentGroupPaymentException
- if an error occured while authorizing or pPaymentGroup is
neither a CreditCard or GiftCertificate.CommerceException
protected PaymentStatus authorizeGiftCertificate(Order pOrder, GiftCertificate pPaymentGroup, double pAmount) throws CommerceException
pOrder
- the Order which contains the PaymentGrouppPaymentGroup
- the gift certificate PaymentGroup on which to authorizepAmount
- the amount to be authorized on the PaymentGroupPaymentException
- if an error occured while authorizing or pPaymentGroup is
not a GiftCertificate.CommerceException
protected PaymentStatus authorizeStoreCredit(Order pOrder, StoreCredit pPaymentGroup, double pAmount) throws CommerceException
pOrder
- the Order which contains the PaymentGrouppPaymentGroup
- the StoreCredit PaymentGroup on which to authorizepAmount
- the amount to be authorized on the PaymentGroupPaymentException
- if an error occured while authorizing or pPaymentGroup is
not a StoreCredit.CommerceException
public void expireGiftCertificateAuthorization(Order pOrder, GiftCertificate pPaymentGroup, double pAmount) throws CommerceException
pOrder
- the Order which contains the PaymentGrouppPaymentGroup
- the gift certificate PaymentGroup on which to expire authorizationpAmount
- the amount to be expired on the PaymentGroupPaymentException
- if an error occured while expiring the authorization or pPaymentGroup is
not a GiftCertificate.CommerceException
public void expireStoreCreditAuthorization(Order pOrder, StoreCredit pPaymentGroup, double pAmount) throws CommerceException
pOrder
- the Order which contains the PaymentGrouppPaymentGroup
- the StoreCredit PaymentGroup on which to expire authorizationpAmount
- the amount to be expired on the PaymentGroupPaymentException
- if an error occured while expiring the authorization or pPaymentGroup is
not a StoreCredit.CommerceException
protected PaymentStatus debitCreditCard(Order pOrder, CreditCard pPaymentGroup, double pAmount) throws CommerceException
pOrder
- the Order which contains the PaymentGrouppPaymentGroup
- the PaymentGroup against which we are debittingpAmount
- the amount to debit the PaymentGroupPaymentException
- if an error occured while debiting or if the pPaymentGroup
passed in is invalid.CommerceException
protected PaymentStatus debitGiftCertificate(Order pOrder, GiftCertificate pPaymentGroup, double pAmount) throws CommerceException
pOrder
- the Order which contains the PaymentGrouppPaymentGroup
- the PaymentGroup against which we are debittingpAmount
- the amount to debit the PaymentGroupPaymentException
- if an error occured while debiting or if the pPaymentGroup
passed in is invalid.CommerceException
protected PaymentStatus debitStoreCredit(Order pOrder, StoreCredit pPaymentGroup, double pAmount) throws CommerceException
pOrder
- the Order which contains the PaymentGrouppPaymentGroup
- the PaymentGroup against which we are debitingpAmount
- the amount to debit the PaymentGroupPaymentException
- if an error occured while debiting or if the pPaymentGroup
passed in is invalid.CommerceException
protected PaymentStatus creditCreditCard(Order pOrder, CreditCard pPaymentGroup, double pAmount) throws CommerceException
pOrder
- - the order that contains the PaymentGrouppPaymentGroup
- - the credit card payment group that should be creditedpAmount
- - the amount that the payment group should be creditedCommerceException
public CreditCardStatus creditCreditCard(CreditCardInfo pCreditCardInfo)
pCreditCardInfo
- - the information which is passed to the credit card processorprotected PaymentStatus creditGiftCertificate(Order pOrder, GiftCertificate pPaymentGroup, double pAmount) throws CommerceException
pOrder
- - the order that contains the PaymentGrouppPaymentGroup
- - the gift certificate payment group that should be creditedpAmount
- - the amount that the payment group should be creditedCommerceException
protected PaymentStatus creditStoreCredit(Order pOrder, StoreCredit pPaymentGroup, double pAmount) throws CommerceException
pOrder
- - the order that contains the PaymentGrouppPaymentGroup
- - the StoreCredit payment group that should be creditedpAmount
- - the amount that the payment group should be creditedCommerceException
public GiftCertificateStatus creditGiftCertificate(GiftCertificateInfo pGiftCertificateInfo)
pGiftCertificateInfo
- - the information which is passed to the gift certificate processorpublic StoreCreditStatus creditStoreCredit(StoreCreditInfo pStoreCreditInfo)
pStoreCreditInfo
- - the information which is passed to the StoreCredit processorprotected void preProcessAuthorize(Order pOrder, PaymentGroup pPaymentGroup, double pAmount) throws CommerceException
pOrder
- the Order that the PaymentGroup exists inpPaymentGroup
- the PaymentGroup to be authorizedpAmount
- the amount of the transactionCommerceException
protected void postProcessAuthorize(PaymentGroup pPaymentGroup, PaymentStatus pStatus, double pAmount) throws CommerceException
pPaymentGroup
- the PaymentGroup which was authorizedpStatus
- the PaymentStatus object returned from the authorize call of the payment processorpAmount
- the amount of the transactionCommerceException
protected void preProcessDebit(Order pOrder, PaymentGroup pPaymentGroup, double pAmount) throws CommerceException
pOrder
- the Order that the PaymentGroup exists inpPaymentGroup
- the PaymentGroup to be debitedpAmount
- the amount of the transactionCommerceException
protected void postProcessDebit(PaymentGroup pPaymentGroup, PaymentStatus pStatus, double pAmount) throws CommerceException
pPaymentGroup
- the PaymentGroup which was debitedpStatus
- the PaymentStatus object returned from the debit call of the payment processorpAmount
- the amount of the transactionCommerceException
protected void preProcessCredit(Order pOrder, PaymentGroup pPaymentGroup, double pAmount) throws CommerceException
pOrder
- the Order that the PaymentGroup exists inpPaymentGroup
- the PaymentGroup to be creditedpAmount
- the amount of the transactionCommerceException
protected void postProcessCredit(PaymentGroup pPaymentGroup, PaymentStatus pStatus, double pAmount) throws CommerceException
pPaymentGroup
- the PaymentGroup which was creditedpStatus
- the PaymentStatus object returned from the credit call of the payment processorpAmount
- the amount of the transactionCommerceException
public PaymentStatus getLastAuthorizationStatus(PaymentGroup pPaymentGroup) throws CommerceException
pPaymentGroup
- the PaymentGroup to get the PaymentStatus fromCommerceException
public PaymentStatus getLastDebitStatus(PaymentGroup pPaymentGroup) throws CommerceException
pPaymentGroup
- the PaymentGroup to get the PaymentStatus fromCommerceException
public boolean isAmountTooHigh(double pAmountSoFar, double pNewAmount, PaymentGroup pPaymentGroup)
preProcessAuthorize, preProcessDebit, preProcessCredit
where pAmountSoFar is the
amount that has previously been authorized, debited, or credited and pNewAmount is the
amount that will soon be authorized, debited, or credited.pAmountSoFar
- The amount that has already been "processed"pNewAmount
- The amount that is going to be "processed" if this method returns falsepPaymentGroup
- The payment group that will be modifiedprotected java.lang.String getChainName(PaymentGroup pPaymentGroup) throws CommerceException
paymentGroupToChainName
map. They key is the
class name of the payment group. The resulting value should be the
corresponding chain.pPaymentGroup
- the payment group whose pipeline chain is obtainedCommerceException
- if pPaymentGroup is null, or no entry
in the map could be found for the payment group class.protected java.lang.String getAuthorizationChainName(PaymentGroup pPaymentGroup) throws CommerceException
getChainName
method.pPaymentGroup
- the payment group that the pipeline chain will
be obtained forCommerceException
- if an error occursprotected java.lang.String getDebitChainName(PaymentGroup pPaymentGroup) throws CommerceException
getChainName
method.pPaymentGroup
- the payment group that the pipeline chain will
be obtained forCommerceException
- if an error occursprotected java.lang.String getDecreaseAuthorizationChainName(PaymentGroup pPaymentGroup) throws CommerceException
getChainName
method.pPaymentGroup
- the payment group that the pipeline chain will
be obtained forCommerceException
- if an error occursprotected java.lang.String getCreditChainName(PaymentGroup pPaymentGroup) throws CommerceException
getChainName
method.pPaymentGroup
- the payment group that the pipeline chain will
be obtained forCommerceException
- if an error occursprotected PipelineResult runProcessorChain(java.lang.String pChainName, PaymentManagerPipelineArgs pParameters) throws CommerceException
pChainName
- the name of the chain to runpParameters
- the parameters to hand to the chainCommerceException
- if an error occurs