public class PaymentManager extends GenericService implements PaymentTypeProvider
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 |
protected java.util.Map<java.lang.String,PaymentType> |
mSupportedPaymentTypesByPaymentGroupIdentifier
Payment types supported by payment manager
|
static java.lang.String |
NO_PAYMENT_TYPE_PROVIDER |
protected static char |
PAYMENT_TYPE_STRING_DELIMITER |
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.
|
protected java.util.Map<java.lang.String,PaymentType> |
createSupportedPaymentTypesMap()
Generate the supported payment types in map form, keyed by payment group identifier.
|
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 |
doStartService()
This is called after a Service has been created, placed into the
naming hierarchy, and initialized with its configured property
values.
|
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
|
protected PaymentType |
getGroupPaymentType(java.lang.String pPaymentGroupIdentifier)
Selects an already generated payment type object corresponding to the payment group
identifier passed in.
|
boolean |
getIgnoreTransactionsWithZeroAmount()
Returns property ignoreTransactionsWithZeroAmount
|
boolean |
getIncludePaymentGroupsWithoutOrderRelationship()
Return flag stating whether or not to include payment types for
payment groups which have no explicit relationship to the current order.
|
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
|
ServiceMap |
getPaymentGroupIdentifierToPaymentTypeProvider()
Retrieves a map which associates payment group identifiers with components which
can generate the payment types associated with that group.
|
PaymentGroupManager |
getPaymentGroupManager()
Retrieve the payment group manager property.
|
java.util.Properties |
getPaymentGroupToChainNameMap()
Return the PaymentGroupToChainNameMap property.
|
PaymentType |
getPaymentTypeForPaymentGroup(PaymentGroup pPaymentGroup)
Get a payment type object for a specific payment group which has a payment amount greater than zero.
|
PaymentType |
getPaymentTypeForString(java.lang.String pPaymentGroupIdentifier,
java.lang.String pRemainderOfPaymentTypeString)
Create a payment type object based upon a formatted string.
|
java.util.Set<PaymentType> |
getPaymentTypes(Order pOrder)
Get a set of payment type objects associated with an order.
|
java.util.Set<PaymentType> |
getPaymentTypes(java.util.Set<java.lang.String> pPaymentTypeStrings)
Get payment type objects from a set of payment type strings.
|
PipelineManager |
getPipelineManager()
Return the PipelineManager property.
|
PricingTools |
getPricingTools()
PricingTools is used to round amounts during comparisons.
|
StoreCreditProcessor |
getStoreCreditProcessor()
Returns property StoreCreditProcessor
|
java.util.Set<PaymentType> |
getSupportedPaymentTypes(java.lang.String pPaymentGroupIdentifier) |
boolean |
isAmountTooHigh(double pAmountSoFar,
double pNewAmount,
PaymentGroup pPaymentGroup)
This method will add pAmountSoFar and pNewAmount.
|
boolean |
isAmountTooHigh(double pAmountSoFar,
double pNewAmount,
PaymentGroup pPaymentGroup,
java.lang.String pCurrencyCode)
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.
|
java.util.List<PaymentType> |
retrieveAllSupportedPaymentTypes()
Retrieves a list of all supported payment types in the system.
|
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 |
setIncludePaymentGroupsWithoutOrderRelationship(boolean pIncludePaymentGroupsWithoutOrderRelationship)
Set a flag stating whether or not to include payment types for payment groups
which have no explicit relationship to the current order.
|
void |
setInStorePaymentProcessor(InStorePaymentProcessor pInStorePaymentProcessor)
Sets the inStorePaymentProcessor
|
void |
setOrderManager(OrderManager pOrderManager)
Sets the orderManager
|
void |
setPaymentGroupIdentifierToPaymentTypeProvider(ServiceMap pPaymentGroupIdentifierToPaymentTypeProvider)
Set a service map which associates types of payment group with components which can generate
the types of payment associated with that group.
|
void |
setPaymentGroupManager(PaymentGroupManager pPaymentGroupManager)
Set the payment group manager property.
|
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, 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
protected static final char PAYMENT_TYPE_STRING_DELIMITER
public static final java.lang.String NO_PAYMENT_TYPE_PROVIDER
protected java.util.Map<java.lang.String,PaymentType> mSupportedPaymentTypesByPaymentGroupIdentifier
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 InStorePaymentProcessor getInStorePaymentProcessor()
public void setInStorePaymentProcessor(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()
public ServiceMap getPaymentGroupIdentifierToPaymentTypeProvider()
public void setPaymentGroupIdentifierToPaymentTypeProvider(ServiceMap pPaymentGroupIdentifierToPaymentTypeProvider)
pPaymentGroupIdentifierToPaymentTypeProvider
- the map of payment group types
to payment type providers to use. The map is not expected to contain null values.public PaymentGroupManager getPaymentGroupManager()
public void setPaymentGroupManager(PaymentGroupManager pPaymentGroupManager)
pPaymentGroupManager
- The payment group manager to use.public boolean getIncludePaymentGroupsWithoutOrderRelationship()
getPaymentTypes(Order pOrder)
public void setIncludePaymentGroupsWithoutOrderRelationship(boolean pIncludePaymentGroupsWithoutOrderRelationship)
pIncludePaymentGroupsWithoutOrderRelationship
- A boolean stating
whether payment groups without any relationship to the order should be
considered or not.getPaymentTypes(Order pOrder)
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 modifiedpublic boolean isAmountTooHigh(double pAmountSoFar, double pNewAmount, PaymentGroup pPaymentGroup, java.lang.String pCurrencyCode)
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 modifiedpCurrencyCode
- currency code which is used for rounding operationprotected 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 occurspublic java.util.List<PaymentType> retrieveAllSupportedPaymentTypes() throws CommerceException
A
- CommerceExcpetion if an error occurred.CommerceException
public java.util.Set<PaymentType> getPaymentTypes(java.util.Set<java.lang.String> pPaymentTypeStrings) throws CommerceException
pPaymentTypeStrings
- The set of strings to create payment type objects from.CommerceException
- if a payment type string could not be parsed or an
unsupported payment group type was found.public java.util.Set<PaymentType> getPaymentTypes(Order pOrder) throws CommerceException
pOrder
- The order whose payment groups we are interested in getting payment
types for.CommerceException
- if the payment group identifier couldn't be matched to
a known payment group type.public java.util.Set<PaymentType> getSupportedPaymentTypes(java.lang.String pPaymentGroupIdentifier) throws InvalidParameterException
getSupportedPaymentTypes
in interface PaymentTypeProvider
pPaymentGroupIdentifier
- An identifier for the group we're going to get payment types for.InvalidParameterException
- if the payment group identifier passed in was deemed invalid.protected PaymentType getGroupPaymentType(java.lang.String pPaymentGroupIdentifier) throws InvalidParameterException
pPaymentGroupIdentifier
- The payment group identifier we're interested in.InvalidParameterException
- if the payment group identifier had no corresponding
payment type object.public PaymentType getPaymentTypeForPaymentGroup(PaymentGroup pPaymentGroup) throws InvalidParameterException
getPaymentTypeForPaymentGroup
in interface PaymentTypeProvider
pPaymentGroup
- The payment group whose payment type we're interested in.InvalidParameterException
- if the payment group identifier passed in was deemed invalid.public PaymentType getPaymentTypeForString(java.lang.String pPaymentGroupIdentifier, java.lang.String pRemainderOfPaymentTypeString) throws InvalidParameterException
getPaymentTypeForString
in interface PaymentTypeProvider
pPaymentGroupIdentifier
- An identifier for the payment group which the payment type will related to.pRemainderOfPaymentTypeString
- The original payment string will have consisted of the group identifier followed
by other info specific to that payment type. So this is the rest of the string minus the group identifier
(and first delimiter). It will be up to individual providers what to do with this information, but one
expected use will be that it denotes a variation of a payment group type.InvalidParameterException
- if the payment group identifier passed in was deemed invalid.protected java.util.Map<java.lang.String,PaymentType> createSupportedPaymentTypesMap()
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting up