|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.commerce.order.PaymentGroupManager
public class PaymentGroupManager
This class is the business layer object for managing and manipulating PaymentGroups. This class holds all the business logic for manipulating all types of PaymentGroups.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
protected static java.util.ResourceBundle |
sResourceBundle
Resource Bundle |
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 | |
---|---|
PaymentGroupManager()
Constructs a PaymentGroupManager object. |
Method Summary | |
---|---|
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. |
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 |
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 |
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 |
---|
public static java.lang.String CLASS_VERSION
protected static java.util.ResourceBundle sResourceBundle
Constructor Detail |
---|
public PaymentGroupManager()
Method Detail |
---|
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 fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
OrderTools.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 create
ObjectCreationException
- if the instantiation of an object fails
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
public 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.CreditCardTypes
InvalidParameterException
- thrown if any of the required parameters are null
CommerceException
CreditCard
public 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 number
InvalidParameterException
- thrown if any of the required parameters are null
CommerceException
GiftCertificate
public 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 number
InvalidParameterException
- thrown if any of the required parameters are null
CommerceException
StoreCredit
public void addPaymentGroupToOrder(Order pOrder, PaymentGroup pPaymentGroup) throws CommerceException
pOrder
- the Order to add the PaymentGroup topPaymentGroup
- the PaymentGroup to add to the Order
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
public 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 to
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
public void removeAllPaymentGroupsFromOrder(Order pOrder) throws CommerceException
pOrder
- the Order which contains the PaymentGroups to be removed
InvalidParameterException
- thrown if any of the parameters are null
ObjectRemovalException
- thrown if a PaymentGroup cannot be removed
CommerceException
public 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 null
ObjectRemovalException
- thrown if a PaymentGroup cannot be removed
CommerceException
public 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 Order
InvalidParameterException
- thrown if any of the parameters are null
PaymentGroupNotFoundException
- if a PaymentGroup with the given id is not found in the given order
ObjectRemovalException
- thrown if the PaymentGroup contains any relationships
CommerceException
public 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 PaymentGroup
InvalidParameterException
- thrown if any of the parameters are null
PaymentGroupNotFoundException
- if a PaymentGroup with the given id is not found in the given order
ObjectRemovalException
- thrown if a relationship cannot be removed
CommerceException
public java.util.List getAllPaymentGroupRelationships(Order pOrder) throws CommerceException
pOrder
- the Order whose relationships are sought
InvalidParameterException
- thrown if order parameter is null
CommerceException
Relationship
,
PaymentGroupRelationship
,
PaymentGroupCommerceItemRelationship
,
PaymentGroupShippingGroupRelationship
,
PaymentGroupOrderRelationship
public PipelineResult recalculatePaymentGroupAmounts(Order pOrder) throws CommerceException
pOrder
- the Order to recalculate the PaymentGroups in
CommerceException
- thrown if an error occurs while recalculating the amountspublic void removeEmptyPaymentGroups(Order pOrder) throws CommerceException
pOrder
- the Order which contains the PaymentGroups
CommerceException
- 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 relationship
InvalidParameterException
- thrown if any of the parameters are null
RelationshipNotFoundException
- if a relationship is not found
CommerceException
public 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 relationship
InvalidParameterException
- thrown if any of the parameters are null
RelationshipNotFoundException
- if a relationship is not found
CommerceException
public 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 relationship
InvalidParameterException
- thrown if any of the parameters are null
RelationshipNotFoundException
- if a relationship is not found
CommerceException
public boolean isPaymentGroupUsed(Order pOrder, PaymentGroup pPaymentGroup)
pOrder
- The order containing the payment grouppPaymentGroup
- The payment group being checked
public boolean paymentGroupIsModifiable(PaymentGroup pPaymentGroup)
pPaymentGroup
- the shipping group
public java.util.List getNonModifiablePaymentGroups(Order pOrder)
pPaymentGroup
- the payment group
public 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
value
boolean
value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |