Sometimes you may find that you need to extend the way a given payment operation works. For example, you may have an unusual credit operation that you want to perform on credit cards.

This section provides information on how to extend the way payment operations work for a given payment method, using the CreditCard payment method as an example. The process to extend the payment operations of the StoreCredit payment method, the GiftCertificate payment method, and the InvoiceRequest payment method (ATB Business Commerce only) works in the same fashion.

As described in the previous section, the PaymentManager.properties file at /atg/commerce/payment/PaymentManager is configured to map CreditCard objects to the creditCardProcessorChain pipeline. Like all of the default payment pipelines, creditCardProcessorChain is composed of two processors. The first processor – CreateCreditCardInfo -- aggregates the necessary information for performing the requested payment action (for example, CREDIT) and creates an XXXInfo object (for example, CreditCardInfo) for use in that action. The second processor – ProcessCreditCard --performs the actual operation – authorizing, debiting, or crediting the appropriate payment method.

The ProcessCreditCard processor is located in Nucleus at /atg/commerce/payment/processor/ProcessCreditCard, and it is instantiated from class atg.commerce.payment.processor.ProcProcessCreditCard, which extends atg.commerce.payment.processor.ProcProcessPaymentGroup. The ProcessCreditCard processor authorizes, debits, and credits a CreditCardPaymentGroup by calling through to a CreditCardProcessor object to perform the actual operations. The specific object used to perform the actual operations is retrieved from PaymentManager.creditCardProcessor; this property points to an object instantiated from a class that implements the atg.payment.creditCard.CreditCardProcessor interface.

To change the way credit cards are operated on, write a new class that implements the CreditCardProcessor interface and provides the additional functionality your site requires, then create and configure an instance of the new class in Nucleus, and finally change the PaymentManager.creditCardProcessor property to point to the new component.

 
loading table of contents...