Class Name

atg.commerce.order.purchase.PaymentGroupDroplet

Component(s)

/atg/commerce/order/purchase/PaymentGroupDroplet

The PaymentGroupDroplet servlet bean is used to initialize a user’s PaymentGroups and CommerceIdentifierPaymentInfo objects for use by the PaymentGroupFormHandler. The PaymentGroupDroplet servlet bean is instantiated from atg.commerce.order.purchase.PaymentGroupDroplet. The PaymentGroupDroplet class is composed of the following containers:

For more information on these containers, the PaymentGroupDroplet servlet bean, and the PaymentGroupFormHandler form handler, refer to the Preparing a Complex Order for Checkout section in the Configuring Purchase Process Services chapter in the ATG Commerce Programming Guide.

Input Parameters

clear
When this parameter is set to true, PaymentGroupDroplet clears both the user’s CommerceIdentifierPaymentInfoContainer and PaymentGroupMapContainer.

clearPaymentGroups
When this parameter is set to true, PaymentGroupDroplet clears the user’s PaymentGroupMapContainer. This should be done at least once per Order if the PaymentGroup objects are subject to change after placing an Order (most likely because the PaymentGroup objects are from the ClaimableRepository).

clearPaymentInfos
When this parameter is set to true, PaymentGroupDroplet clears the user’s CommerceIdentifierPaymentInfoContainer. This should be done at least once per Order to create fresh CommerceIdentifierPaymentInfo objects that refer to each Order’s unique CommerceIdentifier objects.

createAllPaymentInfos

When this parameter is set to true, PaymentGroupDroplet creates an OrderPaymentInfo for all PaymentGroups in the user’s profile. This option supports a different type of user interface than that which is described in the Creating Potential Payment Groups section. In this UI, the user is presented with a form that has a list of PaymentGroups. The user provides the amount to be paid by each PaymentGroup directly in the form, effectively setting the amount property for each OrderPaymentInfo object. If the user adds additional PaymentGroups during the checkout process, you should call the PaymentGroupDroplet again to create OrderPaymentInfo objects for the newly added PaymentGroups.

This option is False by default.

initBasedonOrder

When this parameter is set to true, PaymentGroupDroplet creates a CommerceIdentifierPaymentInfo object for each PaymentGroup relationship object in the Order. The types of CommerceIdentifierPaymentInfo objects that are created correspond to the PaymentGroup relationship types. For example, if a PaymentGroupCommerceItemRelationship exists in the Order, PaymentGroupDroplet creates a corresponding CommerceItemPaymentInfo object and adds it to the CommerceIdentifierPaymentInfoContainer. Each CommerceIdentifierPaymentInfo object is initialized with the PaymentGroup that exists in its corresponding PaymentGroup relationship object.

This option is provided for the scenario where a customer has already gone part way through the checkout process and the order already contains some PaymentGroup relationship objects. Set to False by default.

initItemPayment

When this parameter is set to true, PaymentGroupDroplet creates a CommerceItemPaymentInfo object for each CommerceItem in the order and adds them to the CommerceIdentifierPaymentInfoContainer. If a user has a default PaymentGroup in his or her profile, the CommerceItemPaymentInfo object is initialized with that PaymentGroup. Set to False by default.

Note: A CommerceItemPaymentInfo object is a CommerceIdentifierPaymentInfo object whose CommerceIdentifier is a CommerceItem; it is used for CommerceItem payment information.

initOrderPayment

When this parameter is set to true, PaymentGroupDroplet creates an OrderPaymentInfo object and adds it to the CommerceIdentifierPaymentInfoContainer. If a user has a default PaymentGroup in his or her profile, the OrderPaymentInfo object is initialized with that PaymentGroup. Set to True by default.

Note: An OrderPaymentInfo object is a CommerceIdentifierPaymentInfo object whose CommerceIdentifier is an Order; it is used for Order payment information.

initPaymentGroups
When this parameter is set to true, the PaymentGroup types supplied in the paymentGroupTypes input parameter will be initialized.

initShippingPayment

When this parameter is set to true, PaymentGroupDroplet creates a ShippingGroupPaymentInfo object for each ShippingGroup in the order and adds them to the CommerceIdentifierPaymentInfoContainer. If a user has a default PaymentGroup in his or her profile, the ShippingGroupPaymentInfo object is initialized with that PaymentGroup. Set to False by default.

Note: A ShippingGroupPaymentInfo object is a CommerceIdentifierPaymentInfo object whose CommerceIdentifier is a ShippingGroup; it is used for ShippingGroup payment information.

initTaxPayment

When this parameter is set to true, PaymentGroupDroplet creates a TaxPaymentInfo object and adds it to the CommerceIdentifierPaymentInfoContainer.

Note: A TaxPaymentInfo object is a CommerceIdentifierPaymentInfo object whose CommerceIdentifier is an Order; it is used for tax payment information.

order
The user’s order. You can use this parameter to override the default setting for PaymentGroupDroplet.order.

paymentGroupTypes
A comma-separated list of PaymentGroup types, such as creditCard, storeCredit, giftCertificate, that is used to determine which PaymentGroupInitializer components are executed.

The PaymentGroupInitializer components are responsible for creating and initializing the appropriate PaymentGroup objects and adding them to the PaymentGroupMapContainer. Each possible PaymentGroup type is configured to reference a PaymentGroupInitializer component in the PaymentGroupInitializerServiceMap. The keys into the map are the Strings supplied in this paymentGroupTypes input parameter; the values are the underlying PaymentGroupInitializer components that do the initialization work for that PaymentGroup type.

By default, the PaymentGroupDroplet servlet bean is configured with the following PaymentGroupInitializer components:

## ServiceMap of paymentGroupTypes to PaymentGroupInitializer Nucleus components

paymentGroupInitializers=\
giftCertificate=/atg/commerce/order/purchase/GiftCertificateInitializer,\
storeCredit=/atg/commerce/order/purchase/StoreCreditInitializer,\
creditCard=/atg/commerce/order/purchase/CreditCardInitializer
Output Parameters

paymentInfo
The Map referenced by the CommerceIdentifierPaymentInfoContainer.

order
The Order object that represents the user’s order.

paymentGroups
The Map referenced by the PaymentGroupMapContainer.

Open Parameters

output
The open parameter rendered always.

Example

This example creates CreditCard, StoreCredit, and GiftCertificate PaymentGroup objects based on their availability for the current user. Additionally, it creates CommerceItemPaymentInfo objects, ShippingGroupPaymentInfo objects, and a TaxPaymentInfo object. The example enables the user to pay for CommerceIdentifiers at the line item level with any of their available PaymentGroup objects.

<dsp:droplet name="PaymentGroupDroplet">
  <dsp:param value="true" name="clear"/>
  <dsp:param value="giftCertificates, storeCredit, creditCard"
              name="paymentGroupTypes"/>
  <dsp:param value="true" name="initPaymentGroups"/>
  <dsp:param value="true" name="initItemPayment"/>
  <dsp:param value="true" name="initTaxPayment"/>
  <dsp:param value="true" name="initShippingPayment"/>
  <dsp:oparam name="output">Manipulation of objects here…
  </dsp:output>
</dsp:droplet>
 
loading table of contents...