Payment group type configuration is defined using the atg.commerce.csr.order.
PaymentGroupTypeConfiguration
class. The class contains the following:

atg.commerce.csr.order.PaymentGroupTypeConfiguration extends
atg.commerce.csr.order.CommerceTypeConfiguration
protected PageFragment mEditRefundMethodPageFragment;
protected PageFragment mDisplayRefundMethodPageFragment;
mEditRefundMethodPageFragmentTitleKey;

The PaymentGroupTypeConfiguration class configures the payment group and refund methods. The base class properties configure the payment group. The refund methods are used for the returns and exchange pages.

The following payment group types are provided in these locations:

File

Location

Configuration File

<ATG9dir>/CSC9.3/DCS-CSR/config/atg/commerce/custsvc/ui/

Page Fragments

<ATG9dir>/CSC9.3/DCS-CSR/config/atg/commerce/custsvc/ui/
fragments/order/

Display JSPs

<ATG9dir>/CSC9.3/web-apps/DCS-CSR/include/order/

Add and Edit JSPs

<ATG9dir>/CSC9.3/web-apps/DCS-CSR/panels/order/billing/

There are three default payment group types, including Credit Card, Store Credit and Gift Certificate. To make customizations, you can modify the page fragments and override the component or page fragment properties. Payment group information is displayed on a number of pages, including the billing, order view, email and refund method pages. Payment group information is displayed using the PaymengGroupTypeConfiguration.displayPageFragment and PaymentGroupTypeConfiguration.displayRefundMethodPageFragment property values.

The following table provides display information on Credit Card type payment groups:

Value

Title

Content

Example

Value1

Type

[credit card type] – [last four digits of card]

Visa - 2112

Value2

Expiration Date

[card expiration year] / [card expiration year]

11/12

Value3

Billing Address

[first] [last]
[address 1]
[address 2]
[city], [state] [zip code] [country]
[phone number]

Bob Smith
119 Grand Street
Apt. 1509
Brooklyn, NY 10023
USA
212-555-4321

Status

Status

[payment group status]

Authorization succeeded

The following table provides display information on Store Credit type payment groups:

Value

Title

Content

Example

Value1

Type

Store Credit – Store Credit Number

Store Credit – 1c1123

Value2

Amt. Remaining

[store credit remaining]

15.32

Value3

Blank

[blank]

blank

Status

Status

[payment group status]

Debited

The following table provides display information on Gift Certificate type payment groups:

Value

Title

Content

Example

Value1

Type

Gift Certificate – Gift Certificate Number

Gift Certificate – 1g4332

Value2

Amt. Remaining

[amount remaining]

15.32

Value3

Blank

[blank]

blank

Status

Status

[payment group status]

Debited

The display values are used in the following locations:

Display Pages

Value1

Value2

Value3

Status

Billing
Order Review
Refund Type
Confirmation Emails

X

X

X

Order View
Scheduled Orders
Refund Review

X

X

X

X

The /atg/commerce/custsvc/ui/CreditCardConfiguration.properties, StoreCreditConfiguration.properties and GiftCertificateConfiguration.properties files hold all of the properties of the page fragments. The configuration file contains the page fragment location.

The following examples use the Credit Card payment group; however, all three payment group types have corresponding files.

The following is an example of the CreditCardConfiguration.properties file:

$class=atg.commerce.csr.order.PaymentGroupTypeConfiguration
addPageFragment=/atg/commerce/custsvc/ui/fragments/order/AddCreditCard
editPageFragment=/atg/commerce/custsvc/ui/fragments/order/EditCreditCard
displayPageFragment=/atg/commerce/custsvc/ui/fragments/order/
  DisplayCreditCard

type=creditCard
addPageFragmentTitleKey=addCreditCardTitle
editPageFragmentTitleKey=editCreditCardTitle
resourceBundle=atg.commerce.csr.order.WebAppResources

editRefundMethodPageFragment=/atg/commerce/custsvc/ui/fragments/order/
  EditCreditCardRefundMethod
displayRefundMethodPageFragment=/atg/commerce/custsvc/ui/fragments/order/
  DisplayCreditCardRefundMethod
editRefundMethodPageFragmentTitleKey=editCreditCardRefundMethodTitle

The CreditCardConfiguration.properties file identifies the location of the page fragment, which in turn, defines your page fragment JSP file and the servletContext. For example:

$class=atg.web.PageFragment

URL=/include/order/displayCreditCard.jsp
servletContext=DCS-CSR

The displayCreditCard.jsp file contains the values for the display details, including the title and the content. You must modify the default value1, value2, value3 and status properties with your custom information. The combination of these parameters defines one display value, such as value1:

Example: Payment Group Display Page Fragment Components

The following is a portion of the default configuration of the displayCreditCard.jsp file. In this example, the displayHeading parameter, which defines the display value1 title, is set to use the Billing Summary header. The displayValue parameter, which defines the display value1 content, is set to display the credit card information:

<c:if test="${propertyName == 'value1'}">
  <c:if test="${displayHeading == true}">
    <fmt:message key='billingSummary.commerceItem.header.type'/>
  </c:if>
  <c:if test="${displayValue == true}">
    <csr:displayCreditCardType creditCard="${paymentGroup}"/>
  </c:if>
</c:if>

To display your customized payment group title and content, modify the displayHeading and displayValues accordingly. For example, in the GiftCertificate.jsp file, the value1 title has been modified to use the same displayHeading but the displayValue has been modified to use the newOrderBilling gift certificate value:

<c:if test="${propertyName == 'value1'}">
  <c:if test="${displayHeading == true}">
    <fmt:message key='billingSummary.commerceItem.header.type'/>
  </c:if>
  <c:if test="${displayValue == true}">
    <fmt:message
     key="newOrderBilling.displayPaymentMethods.giftCertificate"/>
    <c:if test="${!empty paymentGroup && !empty
      paymentGroup.giftCertificateNumber }">
      <fmt:message key="common.hyphen"/>
      &nbsp;
      <c:out value="${paymentGroup.giftCertificateNumber}"/>
    </c:if>
  </c:if>
</c:if>

As noted above, the title and content for value1 is shown on the Billing, Order Review, Refund Type, Order View, Scheduled Orders and Refund Review pages and on confirmation emails. You may also modify the value2 and value3 property as needed. Note that Store Credit and Gift Certificate payment groups do not use the value3 property by default, so it is left blank. You may add the displayHeading and displayvalues to the property as required.

Other components that can be customized within the display page fragment include the status property. This property is used to identify the status of the group object and is displayed only on the Order View, Scheduled Orders and Refund Review pages. The default title for all payment groups is Status. Modify the display value to point to your customized information as needed. The following is an example of the displayCreditCard.jsp status:

<c:if test="${propertyName == 'status'}">
  <c:if test="${displayHeading == true}">
    <fmt:message key='billingSummary.commerceItem.header.state/>
  </c:if>
  <c:if test="${displayValue == true}">
  <dsp:droplet name="PaymentGroupStateDescriptions">
    <dsp:param name="state" value="${paymentGroup.stateAsString}"/>
    <dsp:param name="elementName" value="stateDescription"/>
    <dsp:oparam name="output">
      <dsp:droplet name="IsHighlightedState">
        <dsp:param name="obj" value="${paymentGroup}"/>
        <dsp:oparam name="true">
            <span class="atg_commerce_csr_dataHighlight"><dsp:valueof
              param="stateDescription"></dsp:valueof></span>
        </dsp:oparam>
        <dsp:oparam name="false">
          <dsp:valueof param="stateDescription"></dsp:valueof>
        </dsp:oparam>
      </dsp:droplet>
    </dsp:oparam>
  </dsp:droplet>
  </c:if>
</c:if>
Customizing a Custom Payment Group Type

For additional information on creating customized Payment Groups, refer to the Working with Purchase Process Objects chapter of the ATG Commerce Programming Guide.

  1. Refer to the Order Tools section of the ATG Commerce Programming Guide to create a new payment group type. This includes defining the type-to-class name mapping for PaymentGroup objects.

  2. Refer to the Extending the Payment Process to Support a New Payment Method section of the ATG Commerce Programming Guide to create the payment group.

    Note: If you do not want to initialize the customer payment group type using the PaymentGroupDroplet, continue to Step 6.

  3. Write a new PaymentGroupInitializer implementation. The initializePaymentGroups() method should gather the user’s PaymentGroups by type and add them to the PaymentGroupMapContainer referenced by the PaymentGroupFormHandler.

  4. Within your custom application, create a new PaymentGroupInitializer implementation and add it to the ServiceMap in the PaymentGroupDroplet.properties file paymentGroupInitializers property. For example:

    /atg/commerce/custsvc/order/PaymentGroupDroplet.properties
    ## ServiceMap of paymentGroupTypes to PaymentGroupInitializer
    Nucleus components

    paymentGroupInitializers+=\
    newPayment=/atg/commerce/custsvc/order/NewPaymentInitializer

  5. Update the /atg/commerce/custsvc/util/CSRConfigurator.properties file
    paymentGroupTypesToBeInitialized
    and paymentGroupTypesConfigurations properties to include your new payment group type.

    This configuration initializes payment group types in the PaymentGroupDroplet. By default, this property initializes the creditCard and storeCredit types. To initialize a new payment group type, add your new payment group type to the paymentGroupTypesToBeInitialized property. For example:

    /atg/commerce/custsvc/util/CSRConfigurator.properties

    ## Payment group fragment settings
    paymentGroupTypesToBeInitialized=creditCard,storeCredit,newPayment
    paymentGroupTypeConfigurations+=\
              /atg/commerce/custsvc/ui/NewPaymentGroupConfiguration

  6. Add the payment group type configuration to the CSRConfigurator:

    atg.commerce.csr.util.CSRConfigurator
    protected String mPaymentGroupTypesToBeInitialized;
    protected CommerceTypeConfiguration[] mPaymentGroupTypeConfigurations;
    protected Map mPaymentGroupTypeConfigurationsAsMap = null;

    The following parameters are identified:

    • type – This property is the primary key used to identify the payment group type configuration. This property value should match the key defined in OrderTools.paymentTypeClassMap

    • paymentGroupTypeConfigurationsAsMap – This property is automatically generated based on the paymentGroupTypeConfigurations property values

    • PaymentGroupTypeConfiguration.type – This property is used as the key for the map and the value is the PaymentGroupTypeConfiguration componenet itself

Limiting Amounts for Payment Groups

When working on the Billing page an agent can enter any amount for a payment group. If the payment group is associated with a claimable item, the agent will not be allowed to enter more than the remaining or maximum -allowed amount.

You can limit the amount of your customized payment group types by extending the CSRPaymentGroupRemainingAmount droplet to set the payment group maximum-allowed and remaining amount limits.

The CSRPaymentGroupRemainingAmount droplet returns both the remaining and maximum-allowed amounts for the payment group. This droplet sets a maximum -allowed amount limitation in the Billing page and displays the remaining amount of the payment group on the Billing, Order View and Order Review pages.

This droplet takes in payment group and order as input parameters. The parameters for the PaymentGroupRemainingAmount droplet are:

You can calculate the remaining or maximum-allowed amounts for any custom payment groups by extending the getRemainingAmount() and getMaxAllowedAmount() methods within the droplet.

 
loading table of contents...