public class PaymentGroupManager extends GenericService
| Modifier and Type | Field and Description | 
|---|---|
static java.lang.String | 
CLASS_VERSION
Class version string 
 | 
protected static java.util.ResourceBundle | 
sResourceBundle
Resource Bundle 
 | 
SERVICE_INFO_KEYDEFAULT_LOG_TRACE_STATUSDEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS| Constructor and Description | 
|---|
PaymentGroupManager()
Constructs a PaymentGroupManager object. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addPaymentGroupToOrder(Order pOrder,
                      PaymentGroup pPaymentGroup)
Adds the given PaymentGroup to the given order. 
 | 
void | 
addPaymentGroupToOrder(Order pOrder,
                      PaymentGroup pPaymentGroup,
                      int pIndex)
Adds the given PaymentGroup to the given order in the specified location. 
 | 
PaymentGroup | 
createPaymentGroup()
Creates a new PaymentGroup object using the type mapped to the defaultPaymentGroupType
 property in OrderTools. 
 | 
PaymentGroup | 
createPaymentGroup(java.lang.String pPaymentGroupType)
Creates a new PaymentGroup object using the type mapped to the defaultPaymentGroupType
 property in OrderTools. 
 | 
java.util.List | 
getAllPaymentGroupRelationships(Order pOrder)
Provides a List of all PaymentGroupRelationships associated with the given Order. 
 | 
java.util.List | 
getNonModifiablePaymentGroups(Order pOrder)
This method determines whether the payment group is in a condusive
 to editing state 
 | 
java.lang.String[] | 
getNonModifiablePaymentGroupStates()  | 
OrderTools | 
getOrderTools()
Returns property orderTools 
 | 
PaymentGroupCommerceItemRelationship | 
getPaymentGroupCommerceItemRelationship(Order pOrder,
                                       java.lang.String pItemId,
                                       java.lang.String pPaymentGroupId)
Returns the relationship object which exists between the given CommerceItem and PaymentGroup. 
 | 
PaymentGroupOrderRelationship | 
getPaymentGroupOrderRelationship(Order pOrder,
                                java.lang.String pPaymentGroupId)
Returns the relationship object which exists between the given Order and PaymentGroup. 
 | 
PaymentGroupOrderRelationship | 
getPaymentGroupOrderRelationshipIfExists(Order pOrder,
                                        java.lang.String pPaymentGroupId)  | 
PaymentGroupShippingGroupRelationship | 
getPaymentGroupShippingGroupRelationship(Order pOrder,
                                        java.lang.String pPaymentGroupId,
                                        java.lang.String pShippingGroupId)
Returns the relationship object which exists between the given ShippingGroup and PaymentGroup. 
 | 
void | 
initializeCreditCard(CreditCard pCreditCard,
                    java.lang.String pCreditCardNumber,
                    java.lang.String pCreditCardType)
Initializes a CreditCard object to contain the given data. 
 | 
void | 
initializeGiftCertificate(GiftCertificate pGiftCertificate,
                         java.lang.String pProfileId,
                         java.lang.String pGiftCertificateNumber)
Initializes a GiftCertificate object to contain the given data. 
 | 
void | 
initializeStoreCredit(StoreCredit pStoreCredit,
                     java.lang.String pProfileId,
                     java.lang.String pStoreCreditNumber)
Initializes a StoreCredit object to contain the given data. 
 | 
boolean | 
isPaymentGroupInOrder(Order pOrder,
                     java.lang.String pPaymentGroupId)
isPaymentGroupInOrder is used to determine if the PaymentGroup
 is already in the Order. | 
boolean | 
isPaymentGroupUsed(Order pOrder,
                  PaymentGroup pPaymentGroup)
This returns true if this is the only payment group in the order, or
 if this payment group is not empty. 
 | 
boolean | 
paymentGroupIsModifiable(PaymentGroup pPaymentGroup)
This method determines whether the payment group is in a condusive
 to editing state 
 | 
PipelineResult | 
recalculatePaymentGroupAmounts(Order pOrder)
Recalculates the amounts for each PaymentGroup supplied in pPaymentGroupList. 
 | 
void | 
removeAllPaymentGroupsFromOrder(Order pOrder)
Removes all the PaymentGroups and their Relationships from an Order. 
 | 
void | 
removeAllPaymentGroupsFromOrder(Order pOrder,
                               java.util.List pExclusions)
Removes PaymentGroups and their Relationships from an Order, retaining
 the PaymentGroups passed in via the exclusion list parameter. 
 | 
void | 
removeAllRelationshipsFromPaymentGroup(Order pOrder,
                                      java.lang.String pPaymentGroupId)
Removes all the relationships from the PaymentGroup with the given id in the given order. 
 | 
void | 
removeAllRelationshipsFromPaymentGroup(PaymentGroup pPaymentGroup)
Removes all relationships from the given PaymentGroup. 
 | 
void | 
removeEmptyPaymentGroups(Order pOrder)
Removes all the PaymentGroups which are not being used. 
 | 
void | 
removePaymentGroupFromOrder(Order pOrder,
                           java.lang.String pPaymentGroupId)
Removes the given PaymentGroup from the given order. 
 | 
void | 
setNonModifiablePaymentGroupStates(java.lang.String[] pNonModifiablePaymentGroupStates)
Sets array of payment group states that indicate that a payment
 group is not modifiable 
 | 
void | 
setOrderTools(OrderTools pOrderTools)
Sets property orderTools 
 | 
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, toStringvlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarningpublic static java.lang.String CLASS_VERSION
protected static java.util.ResourceBundle sResourceBundle
public PaymentGroupManager()
public OrderTools getOrderTools()
public void setOrderTools(OrderTools pOrderTools)
pOrderTools - the value to set for property orderToolspublic void setNonModifiablePaymentGroupStates(java.lang.String[] pNonModifiablePaymentGroupStates)
pNonModifiablePaymentGroupStates - an array of payment group states
        that indicate that a payment group is not modifiablepublic java.lang.String[] getNonModifiablePaymentGroupStates()
public PaymentGroup createPaymentGroup() throws CommerceException
ObjectCreationException - if the instantiation of an object failsInvalidParameterException - thrown if any of the parameters are nullCommerceExceptionOrderTools.getDefaultPaymentGroupType()public PaymentGroup createPaymentGroup(java.lang.String pPaymentGroupType) throws CommerceException
pPaymentGroupType - the type that is mapped in the OrderTools.properties file to the class of
                   the desired type to createObjectCreationException - if the instantiation of an object failsInvalidParameterException - thrown if any of the parameters are nullCommerceExceptionpublic void initializeCreditCard(CreditCard pCreditCard, java.lang.String pCreditCardNumber, java.lang.String pCreditCardType) throws CommerceException
pCreditCard - the CreditCard object to initializepCreditCardNumber - the credit card numberpCreditCardType - the credit card type. See atg.payment.creditcard.CreditCardTypesInvalidParameterException - thrown if any of the required parameters are nullCommerceExceptionCreditCardpublic void initializeGiftCertificate(GiftCertificate pGiftCertificate, java.lang.String pProfileId, java.lang.String pGiftCertificateNumber) throws CommerceException
pGiftCertificate - the GiftCertificate object to initializepProfileId - the profile id for the user who owns this gift certificatepGiftCertificateNumber - the credit card numberInvalidParameterException - thrown if any of the required parameters are nullCommerceExceptionGiftCertificatepublic void initializeStoreCredit(StoreCredit pStoreCredit, java.lang.String pProfileId, java.lang.String pStoreCreditNumber) throws CommerceException
pStoreCredit - the StoreCredit object to initializepProfileId - the profile id for the user who owns this store creditpStoreCreditNumber - the store credit numberInvalidParameterException - thrown if any of the required parameters are nullCommerceExceptionStoreCreditpublic void addPaymentGroupToOrder(Order pOrder, PaymentGroup pPaymentGroup) throws CommerceException
pOrder - the Order to add the PaymentGroup topPaymentGroup - the PaymentGroup to add to the OrderInvalidParameterException - thrown if any of the parameters are nullCommerceExceptionpublic void addPaymentGroupToOrder(Order pOrder, PaymentGroup pPaymentGroup, int pIndex) throws CommerceException
pOrder - the Order to add the PaymentGroup topPaymentGroup - the PaymentGroup to add to the OrderpIndex - the location in the Order's list of PaymentGroups to add the PaymentGroup toInvalidParameterException - thrown if any of the parameters are nullCommerceExceptionpublic void removeAllPaymentGroupsFromOrder(Order pOrder) throws CommerceException
pOrder - the Order which contains the PaymentGroups to be removedInvalidParameterException - thrown if any of the parameters are nullObjectRemovalException - thrown if a PaymentGroup cannot be removedCommerceExceptionpublic void removeAllPaymentGroupsFromOrder(Order pOrder, java.util.List pExclusions) throws CommerceException
pOrder - the Order which contains the PaymentGroups to be removedpExclusions - the PaymentGroups to be retained (can be null or an empty list)InvalidParameterException - thrown if any required parameter is nullObjectRemovalException - thrown if a PaymentGroup cannot be removedCommerceExceptionpublic void removePaymentGroupFromOrder(Order pOrder, java.lang.String pPaymentGroupId) throws CommerceException
pOrder - the Order to remove the PaymentGroup frompPaymentGroupId - the id of the PaymentGroup to remove from the OrderInvalidParameterException - thrown if any of the parameters are nullPaymentGroupNotFoundException - if a PaymentGroup with the given id is not found in the given orderObjectRemovalException - thrown if the PaymentGroup contains any relationshipsCommerceExceptionpublic void removeAllRelationshipsFromPaymentGroup(Order pOrder, java.lang.String pPaymentGroupId) throws CommerceException
pOrder - the Order which contains the PaymentGroup to remove the relationships frompPaymentGroupId - the id of the PaymentGroupInvalidParameterException - thrown if any of the parameters are nullPaymentGroupNotFoundException - if a PaymentGroup with the given id is not found in the given orderObjectRemovalException - thrown if a relationship cannot be removedCommerceExceptionpublic void removeAllRelationshipsFromPaymentGroup(PaymentGroup pPaymentGroup) throws CommerceException
pPaymentGroup - the PaymentGroup from which all relationships needs to be removedCommerceExceptionPaymentGroup#removeAllCommerceItemRelationships()}, 
ShippingGroupRelationshipContainer.removeAllShippingGroupRelationships(), 
OrderRelationshipContainer.removeOrderRelationship()public java.util.List getAllPaymentGroupRelationships(Order pOrder) throws CommerceException
pOrder - the Order whose relationships are soughtInvalidParameterException - thrown if order parameter is nullCommerceExceptionRelationship, 
PaymentGroupRelationship, 
PaymentGroupCommerceItemRelationship, 
PaymentGroupShippingGroupRelationship, 
PaymentGroupOrderRelationshippublic PipelineResult recalculatePaymentGroupAmounts(Order pOrder) throws CommerceException
pOrder - the Order to recalculate the PaymentGroups inCommerceException - thrown if an error occurs while recalculating the amountspublic void removeEmptyPaymentGroups(Order pOrder) throws CommerceException
pOrder - the Order which contains the PaymentGroupsCommerceException - if an exception occurs while removing a PaymentGrouppublic PaymentGroupCommerceItemRelationship getPaymentGroupCommerceItemRelationship(Order pOrder, java.lang.String pItemId, java.lang.String pPaymentGroupId) throws CommerceException
pItemId - the id of the CommerceItem which makes up a half of the relationshippPaymentGroupId - the id of the PaymentGroup which makes up a half of the relationshipInvalidParameterException - thrown if any of the parameters are nullRelationshipNotFoundException - if a relationship is not foundCommerceExceptionpublic PaymentGroupShippingGroupRelationship getPaymentGroupShippingGroupRelationship(Order pOrder, java.lang.String pPaymentGroupId, java.lang.String pShippingGroupId) throws CommerceException
pShippingGroupId - the id of the ShippingGroup which makes up a half of the relationshippPaymentGroupId - the id of the PaymentGroup which makes up a half of the relationshipInvalidParameterException - thrown if any of the parameters are nullRelationshipNotFoundException - if a relationship is not foundCommerceExceptionpublic PaymentGroupOrderRelationship getPaymentGroupOrderRelationship(Order pOrder, java.lang.String pPaymentGroupId) throws CommerceException
pOrder - the Order which makes up half of the relationshippPaymentGroupId - the id of the PaymentGroup which makes up a half of the relationshipInvalidParameterException - thrown if any of the parameters are nullRelationshipNotFoundException - if a relationship is not foundCommerceExceptionpublic PaymentGroupOrderRelationship getPaymentGroupOrderRelationshipIfExists(Order pOrder, java.lang.String pPaymentGroupId) throws CommerceException
CommerceExceptionpublic boolean isPaymentGroupUsed(Order pOrder, PaymentGroup pPaymentGroup)
pOrder - The order containing the payment grouppPaymentGroup - The payment group being checkedpublic boolean paymentGroupIsModifiable(PaymentGroup pPaymentGroup)
pPaymentGroup - the shipping grouppublic java.util.List getNonModifiablePaymentGroups(Order pOrder)
pPaymentGroup - the payment grouppublic boolean isPaymentGroupInOrder(Order pOrder, java.lang.String pPaymentGroupId)
isPaymentGroupInOrder is used to determine if the PaymentGroup
 is already in the Order.pOrder - an Order valuepPaymentGroupId - a String valueboolean value