atg.commerce.order
Class PaymentGroupImpl

java.lang.Object
  extended by atg.commerce.order.CommerceIdentifierImpl
      extended by atg.commerce.order.PaymentGroupImpl
All Implemented Interfaces:
ChangedProperties, CommerceIdentifier, CommerceItemRelationshipContainer, OrderRelationshipContainer, PaymentGroup, ShippingGroupRelationshipContainer, java.io.Serializable, java.util.Observer
Direct Known Subclasses:
CreditCard, GiftCertificate, InvoiceRequest, StoreCredit

public class PaymentGroupImpl
extends CommerceIdentifierImpl
implements PaymentGroup, ChangedProperties

This class is an implementation of a PaymentGroup. It represents all the information which designates a payment. Examples would be credit card, check, COD, etc. This class should not be used directly because it does not provide any specific properties for any specific types of payment. Rather, subclasses such as CreditCard and GiftCertificate should be used.

See Also:
CreditCard, GiftCertificate, Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
PaymentGroupImpl()
           
 
Method Summary
 void addAuthorizationStatus(PaymentStatus pAuthorizationStatus)
          Adds an authorizationStatus to the CreditCard
 void addChangedProperty(java.lang.String pPropertyName)
          Adds a changedProperty
 void addCommerceItemRelationship(CommerceItemRelationship pCommerceItemRelationship)
          Add the CommerceItemRelationship to the container.
 void addCommerceItemRelationship(CommerceItemRelationship pCommerceItemRelationship, int pIndex)
          Add the CommerceItemRelationship to the container at the given index.
 void addCreditStatus(PaymentStatus pCreditStatus)
          Adds a creditStatus to the CreditCard
 void addDebitStatus(PaymentStatus pDebitStatus)
          Adds a debitStatus to the CreditCard
 void addOrderRelationship(OrderRelationship pOrderRelationship)
          Add the OrderRelationship to the container.
 void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship)
          Add the ShippingGroupRelationship to the container.
 void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship, int pIndex)
          Add the ShippingGroupRelationship to the container at the given index.
 void clearChangedProperties()
          Clears the changedProperties List
 double getAmount()
          returns the amount associated with this PaymentGroup.
 double getAmountAuthorized()
          Returns property amountAuthorized.
 double getAmountCredited()
          Returns property amountCredited.
 double getAmountDebited()
          Returns property amountDebited.
 java.util.List getAuthorizationStatus()
          Returns the authorizationStatus
 java.util.Set getChangedProperties()
          Returns the changedProperties
 CommerceItemRelationship getCommerceItemRelationship(java.lang.String pCommerceItemRelationshipId)
          Returns the CommerceItemRelationship whose id is pCommerceItemRelationshipId.
 int getCommerceItemRelationshipCount()
          Returns the number of CommerceItemRelationships in the container.
 java.util.List getCommerceItemRelationships()
          Returns a List of CommerceItemRelationships
 java.util.List getCreditStatus()
          Returns the creditStatus
 java.lang.String getCurrencyCode()
          Returns the currencyCode
 java.util.List getDebitStatus()
          Returns the debitStatus
 OrderRelationship getOrderRelationship()
          Returns the OrderRelationship.
 int getOrderRelationshipCount()
          Returns the number of OrderRelationships in the container.
 java.lang.String getPaymentGroupClassType()
          Returns the paymentGroupClassType
 java.lang.String getPaymentMethod()
          Returns the paymentMethod
 java.lang.Object getPropertyValue(java.lang.String pPropertyName)
          Returns a property value
 MutableRepositoryItem getRepositoryItem()
          Returns the repositoryItem
 java.lang.String getRequisitionNumber()
          Return the requisition info associated with this payment group
 boolean getSaveAllProperties()
          Returns the saveAllProperties
 ShippingGroupRelationship getShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
          Returns the ShippingGroupRelationship whose id is pShippingGroupRelationshipId.
 int getShippingGroupRelationshipCount()
          Returns the number of ShippingGroupRelationships in the container.
 java.util.List getShippingGroupRelationships()
          Returns a List of ShippingGroupRelationships
 java.util.Map getSpecialInstructions()
          Returns the specialInstructions
 int getState()
          returns the PaymentGroup state.
 java.lang.String getStateAsString()
          returns the PaymentGroup state as a String.
 java.lang.String getStateAsUserResource()
          returns the PaymentGroup state as a user resource
 java.lang.String getStateDetail()
          returns the PaymentGroup state details.
 java.util.Date getSubmittedDate()
          Returns the submittedDate
 boolean isChanged()
          Returns the isChanged flag
 void removeAllCommerceItemRelationships()
          Removes all the CommerceItemRelationships.
 void removeAllShippingGroupRelationships()
          Removes all the ShippingGroupRelationships.
 CommerceItemRelationship removeCommerceItemRelationship(java.lang.String pCommerceItemRelationshipId)
          Removes a CommerceItemRelationship whose id is passed in.
 OrderRelationship removeOrderRelationship()
          Removes a OrderRelationship.
 ShippingGroupRelationship removeShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
          Removes a ShippingGroupRelationship whose id is passed in.
 void setAmount(double pAmount)
          sets the amount associated with this PaymentGroup.
 void setAmountAuthorized(double pAmountAuthorized)
          Sets property amountAuthorized
 void setAmountCredited(double pAmountCredited)
          Sets property amountCredited
 void setAmountDebited(double pAmountDebited)
          Sets property amountDebited
 void setChanged(boolean pChanged)
          Marks this object as changed
 void setCurrencyCode(java.lang.String pCurrencyCode)
          Sets the currencyCode
 void setPaymentGroupClassType(java.lang.String pPaymentGroupClassType)
          Sets the paymentGroupClassType
 void setPaymentMethod(java.lang.String pPaymentMethod)
          Sets the paymentMethod
 void setPropertyValue(java.lang.String pPropertyName, java.lang.Object pPropertyValue)
          Sets a property value
 void setRepositoryItem(MutableRepositoryItem pRepositoryItem)
          Sets the repositoryItem
 void setRequisitionNumber(java.lang.String pRequisitionNumber)
          Set the requisition info associated with this payment group
 void setSaveAllProperties(boolean pSaveAllProperties)
          Sets the saveAllProperties
 void setSpecialInstructions(java.util.Map pSpecialInstructions)
          Sets the specialInstructions
 void setState(int pState)
          sets the PaymentGroup state.
 void setStateAsString(java.lang.String pState)
          sets the PaymentGroup state as a String.
 void setStateDetail(java.lang.String pStateDetail)
          sets the PaymentGroup state details.
 void setSubmittedDate(java.util.Date pSubmittedDate)
          Sets the submittedDate
 java.lang.String toString()
          Method that renders the general information in a readable string format
 void update(java.util.Observable o, java.lang.Object arg)
          This method is called whenever a property in a contained object changes and the containing object needs to be notified.
 
Methods inherited from class atg.commerce.order.CommerceIdentifierImpl
getId, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface atg.commerce.order.CommerceIdentifier
getId
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

PaymentGroupImpl

public PaymentGroupImpl()
Method Detail

getPaymentGroupClassType

public java.lang.String getPaymentGroupClassType()
Returns the paymentGroupClassType

Specified by:
getPaymentGroupClassType in interface PaymentGroup

setPaymentGroupClassType

public void setPaymentGroupClassType(java.lang.String pPaymentGroupClassType)
Sets the paymentGroupClassType

Specified by:
setPaymentGroupClassType in interface PaymentGroup

getPaymentMethod

public java.lang.String getPaymentMethod()
Returns the paymentMethod

Specified by:
getPaymentMethod in interface PaymentGroup

setPaymentMethod

public void setPaymentMethod(java.lang.String pPaymentMethod)
Sets the paymentMethod

Specified by:
setPaymentMethod in interface PaymentGroup

getAmount

public double getAmount()
returns the amount associated with this PaymentGroup.

Specified by:
getAmount in interface PaymentGroup

setAmount

public void setAmount(double pAmount)
sets the amount associated with this PaymentGroup.

Specified by:
setAmount in interface PaymentGroup
Parameters:
pAmount - the amount to set for this payment

getAmountAuthorized

public double getAmountAuthorized()
Returns property amountAuthorized. This property represents the amount that has been authorized to-date for this PaymentGroup.

Specified by:
getAmountAuthorized in interface PaymentGroup
Returns:
returns property amountAuthorized

setAmountAuthorized

public void setAmountAuthorized(double pAmountAuthorized)
Sets property amountAuthorized

Specified by:
setAmountAuthorized in interface PaymentGroup
Parameters:
pAmountAuthorized - the value to set for property amountAuthorized

getAmountDebited

public double getAmountDebited()
Returns property amountDebited. This property represents the amount that has been debited to-date for this PaymentGroup.

Specified by:
getAmountDebited in interface PaymentGroup
Returns:
returns property amountDebited

setAmountDebited

public void setAmountDebited(double pAmountDebited)
Sets property amountDebited

Specified by:
setAmountDebited in interface PaymentGroup
Parameters:
pAmountDebited - the value to set for property amountDebited

getAmountCredited

public double getAmountCredited()
Returns property amountCredited. This property represents the amount that has been credited to-date for this PaymentGroup.

Specified by:
getAmountCredited in interface PaymentGroup
Returns:
returns property amountCredited

setAmountCredited

public void setAmountCredited(double pAmountCredited)
Sets property amountCredited

Specified by:
setAmountCredited in interface PaymentGroup
Parameters:
pAmountCredited - the value to set for property amountCredited

getCurrencyCode

public java.lang.String getCurrencyCode()
Returns the currencyCode

Specified by:
getCurrencyCode in interface PaymentGroup

setCurrencyCode

public void setCurrencyCode(java.lang.String pCurrencyCode)
Sets the currencyCode

Specified by:
setCurrencyCode in interface PaymentGroup

getState

public int getState()
returns the PaymentGroup state.

Specified by:
getState in interface PaymentGroup

setState

public void setState(int pState)
sets the PaymentGroup state.

Specified by:
setState in interface PaymentGroup
Parameters:
pState - the state to set

getStateAsString

public java.lang.String getStateAsString()
returns the PaymentGroup state as a String.


setStateAsString

public void setStateAsString(java.lang.String pState)
sets the PaymentGroup state as a String.

Parameters:
pState - the state to set

getStateAsUserResource

public java.lang.String getStateAsUserResource()
returns the PaymentGroup state as a user resource


getStateDetail

public java.lang.String getStateDetail()
returns the PaymentGroup state details.

Specified by:
getStateDetail in interface PaymentGroup

setStateDetail

public void setStateDetail(java.lang.String pStateDetail)
sets the PaymentGroup state details.

Specified by:
setStateDetail in interface PaymentGroup
Parameters:
pStateDetail - the stateDetail to set

getAuthorizationStatus

public java.util.List getAuthorizationStatus()
Returns the authorizationStatus

Specified by:
getAuthorizationStatus in interface PaymentGroup

addAuthorizationStatus

public void addAuthorizationStatus(PaymentStatus pAuthorizationStatus)
Adds an authorizationStatus to the CreditCard

Specified by:
addAuthorizationStatus in interface PaymentGroup

getDebitStatus

public java.util.List getDebitStatus()
Returns the debitStatus

Specified by:
getDebitStatus in interface PaymentGroup

addDebitStatus

public void addDebitStatus(PaymentStatus pDebitStatus)
Adds a debitStatus to the CreditCard

Specified by:
addDebitStatus in interface PaymentGroup

getCreditStatus

public java.util.List getCreditStatus()
Returns the creditStatus

Specified by:
getCreditStatus in interface PaymentGroup

addCreditStatus

public void addCreditStatus(PaymentStatus pCreditStatus)
Adds a creditStatus to the CreditCard

Specified by:
addCreditStatus in interface PaymentGroup

getSubmittedDate

public java.util.Date getSubmittedDate()
Returns the submittedDate

Specified by:
getSubmittedDate in interface PaymentGroup

setSubmittedDate

public void setSubmittedDate(java.util.Date pSubmittedDate)
Sets the submittedDate

Specified by:
setSubmittedDate in interface PaymentGroup

getSpecialInstructions

public java.util.Map getSpecialInstructions()
Returns the specialInstructions

Specified by:
getSpecialInstructions in interface PaymentGroup

setSpecialInstructions

public void setSpecialInstructions(java.util.Map pSpecialInstructions)
Sets the specialInstructions


setRequisitionNumber

public void setRequisitionNumber(java.lang.String pRequisitionNumber)
Set the requisition info associated with this payment group

Specified by:
setRequisitionNumber in interface PaymentGroup

getRequisitionNumber

public java.lang.String getRequisitionNumber()
Return the requisition info associated with this payment group

Specified by:
getRequisitionNumber in interface PaymentGroup

getCommerceItemRelationships

public java.util.List getCommerceItemRelationships()
Returns a List of CommerceItemRelationships

Specified by:
getCommerceItemRelationships in interface CommerceItemRelationshipContainer

addCommerceItemRelationship

public void addCommerceItemRelationship(CommerceItemRelationship pCommerceItemRelationship)
                                 throws DuplicateRelationshipException,
                                        InvalidParameterException
Add the CommerceItemRelationship to the container. If the CommerceItemRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addCommerceItemRelationship in interface CommerceItemRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

addCommerceItemRelationship

public void addCommerceItemRelationship(CommerceItemRelationship pCommerceItemRelationship,
                                        int pIndex)
                                 throws DuplicateRelationshipException,
                                        InvalidParameterException
Add the CommerceItemRelationship to the container at the given index. If the CommerceItemRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addCommerceItemRelationship in interface CommerceItemRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

removeCommerceItemRelationship

public CommerceItemRelationship removeCommerceItemRelationship(java.lang.String pCommerceItemRelationshipId)
                                                        throws RelationshipNotFoundException,
                                                               InvalidParameterException
Removes a CommerceItemRelationship whose id is passed in. If the CommerceItemRelationship is not in the container then a RelationshipNotFoundException is thrown. Otherwise a reference to the removed CommerceItemRelationship is returned.

Specified by:
removeCommerceItemRelationship in interface CommerceItemRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

removeAllCommerceItemRelationships

public void removeAllCommerceItemRelationships()
Removes all the CommerceItemRelationships.

Specified by:
removeAllCommerceItemRelationships in interface CommerceItemRelationshipContainer

getCommerceItemRelationship

public CommerceItemRelationship getCommerceItemRelationship(java.lang.String pCommerceItemRelationshipId)
                                                     throws RelationshipNotFoundException,
                                                            InvalidParameterException
Returns the CommerceItemRelationship whose id is pCommerceItemRelationshipId. If theCommerceItemRelationship with the corresponding id is not in the container then a RelationshipNotFoundException is thrown.

Specified by:
getCommerceItemRelationship in interface CommerceItemRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getCommerceItemRelationshipCount

public int getCommerceItemRelationshipCount()
Returns the number of CommerceItemRelationships in the container.

Specified by:
getCommerceItemRelationshipCount in interface CommerceItemRelationshipContainer

getShippingGroupRelationships

public java.util.List getShippingGroupRelationships()
Returns a List of ShippingGroupRelationships

Specified by:
getShippingGroupRelationships in interface ShippingGroupRelationshipContainer

addShippingGroupRelationship

public void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship)
                                  throws DuplicateRelationshipException,
                                         InvalidParameterException
Add the ShippingGroupRelationship to the container. If the ShippingGroupRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

addShippingGroupRelationship

public void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship,
                                         int pIndex)
                                  throws DuplicateRelationshipException,
                                         InvalidParameterException
Add the ShippingGroupRelationship to the container at the given index. If the ShippingGroupRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

removeShippingGroupRelationship

public ShippingGroupRelationship removeShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
                                                          throws RelationshipNotFoundException,
                                                                 InvalidParameterException
Removes a ShippingGroupRelationship whose id is passed in. If the ShippingGroupRelationship is not in the container then a RelationshipNotFoundException is thrown. Otherwise a reference to the removed ShippingGroupRelationship is returned.

Specified by:
removeShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

removeAllShippingGroupRelationships

public void removeAllShippingGroupRelationships()
Removes all the ShippingGroupRelationships.

Specified by:
removeAllShippingGroupRelationships in interface ShippingGroupRelationshipContainer

getShippingGroupRelationship

public ShippingGroupRelationship getShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
                                                       throws RelationshipNotFoundException,
                                                              InvalidParameterException
Returns the ShippingGroupRelationship whose id is pShippingGroupRelationshipId. If theShippingGroupRelationship with the corresponding id is not in the container then a RelationshipNotFoundException is thrown.

Specified by:
getShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getShippingGroupRelationshipCount

public int getShippingGroupRelationshipCount()
Returns the number of ShippingGroupRelationships in the container.

Specified by:
getShippingGroupRelationshipCount in interface ShippingGroupRelationshipContainer

addOrderRelationship

public void addOrderRelationship(OrderRelationship pOrderRelationship)
                          throws DuplicateRelationshipException,
                                 InvalidParameterException
Add the OrderRelationship to the container. If the OrderRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addOrderRelationship in interface OrderRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

removeOrderRelationship

public OrderRelationship removeOrderRelationship()
                                          throws RelationshipNotFoundException,
                                                 InvalidParameterException
Removes a OrderRelationship. If the OrderRelationship is not in the container then a RelationshipNotFoundException is thrown. Otherwise a reference to the removed OrderRelationship is returned.

Specified by:
removeOrderRelationship in interface OrderRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getOrderRelationship

public OrderRelationship getOrderRelationship()
                                       throws RelationshipNotFoundException,
                                              InvalidParameterException
Returns the OrderRelationship. If theOrderRelationship is not in the container then a RelationshipNotFoundException is thrown.

Specified by:
getOrderRelationship in interface OrderRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getOrderRelationshipCount

public int getOrderRelationshipCount()
Returns the number of OrderRelationships in the container. The returned value will be either 0 or 1.

Specified by:
getOrderRelationshipCount in interface OrderRelationshipContainer

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
This method is called whenever a property in a contained object changes and the containing object needs to be notified.

Specified by:
update in interface java.util.Observer
Parameters:
o - the object which changed
arg - the name of the property which changed

getSaveAllProperties

public boolean getSaveAllProperties()
Returns the saveAllProperties

Specified by:
getSaveAllProperties in interface ChangedProperties

setSaveAllProperties

public void setSaveAllProperties(boolean pSaveAllProperties)
Sets the saveAllProperties

Specified by:
setSaveAllProperties in interface ChangedProperties

isChanged

public boolean isChanged()
Returns the isChanged flag

Specified by:
isChanged in interface ChangedProperties

setChanged

public void setChanged(boolean pChanged)
Marks this object as changed

Specified by:
setChanged in interface ChangedProperties

getChangedProperties

public java.util.Set getChangedProperties()
Returns the changedProperties

Specified by:
getChangedProperties in interface ChangedProperties

addChangedProperty

public void addChangedProperty(java.lang.String pPropertyName)
Adds a changedProperty

Specified by:
addChangedProperty in interface ChangedProperties

clearChangedProperties

public void clearChangedProperties()
Clears the changedProperties List

Specified by:
clearChangedProperties in interface ChangedProperties

getRepositoryItem

public MutableRepositoryItem getRepositoryItem()
Returns the repositoryItem

Specified by:
getRepositoryItem in interface ChangedProperties

setRepositoryItem

public void setRepositoryItem(MutableRepositoryItem pRepositoryItem)
Sets the repositoryItem

Specified by:
setRepositoryItem in interface ChangedProperties

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String pPropertyName)
Returns a property value

Specified by:
getPropertyValue in interface ChangedProperties
Returns:
returns a property value

setPropertyValue

public void setPropertyValue(java.lang.String pPropertyName,
                             java.lang.Object pPropertyValue)
Sets a property value

Specified by:
setPropertyValue in interface ChangedProperties
Parameters:
pPropertyValue - the value to set for the given property value

toString

public java.lang.String toString()
Method that renders the general information in a readable string format

Overrides:
toString in class java.lang.Object