When an Order is first created, it has an empty PaymentGroup, which serves as the default PaymentGroup for the Order. The type of default PaymentGroup that is created is determined by the defaultPaymentGroupType property of the OrderTools component. By default, this property is set to CreditCard.

When a CommerceItem is added to the Order, that item is automatically a part of the default PaymentGroup because it is assumed that when there is only one PaymentGroup, all CommerceItem costs – along with all shipping and tax costs -- are a part of that group. However, once a second PaymentGroup is added to the Order, the existing CommerceItem, any new commerce items, and all shipping and tax costs must be explicitly assigned to one of the two payment groups; any items that were in the default PaymentGroup are no longer a part of any PaymentGroup.

Before the Order is checked out, all of the order’s costs must be a part of a PaymentGroup. This requirement is checked during the checkout process by the validateForCheckout pipeline, which is executed by the processOrder pipeline. Each processor in the validateForCheckout pipeline validates a different part of the Order as complete. The payment groups in the Order are considered complete if the following criteria are met:

If the Order has only one payment group, then the assignment of Order costs is automatic. However, if the Order has more than one payment group, you must explicitly assign the Order costs to the payment groups. You can do so using one of following methods:

For more information on the processOrder and validateForCheckout pipelines, see the Checking Out an Order section of the Configuring Purchase Process Services chapter. For information on the PaymentGroupCommerceItemRelationship and PaymentGroupShippingGroupRelationship objects that are described in the following subsections, see the Relationship Types section in this chapter.

Note: The priority of a Relationship in an Order, which is determined by the relationship’s type, plays a role in when the Relationship is processed as the Order proceeds through the checkout process. For more on relationship types and priority, see the Relationship Priority subsection of the Using Relationship Objects section in the Working With Purchase Process Objects chapter.

loading table of contents...