The InvoiceRequestProcessor does the work of creating invoices, based on the InvoiceRequestInfo object it receives. InvoiceRequestProcessor is then used by the PaymentManager, just like the credit card and gift certificate processors.

The InvoiceRequestProcessor holds authorize(), debit(), and credit() methods. Authorize() and credit() are empty; you can add any business logic your sites need for these procedures. The debit() method invokes the InvoiceManager’s createInvoice() method, which creates a new invoice from the order and other information, then sends a JMS message indicating that the invoice was created.

To enable invoice payment, add a line to the PaymentNameToChainNameMap configuration file, located at /atg/commerce/payment/PaymentManager:

paymentGroupToChainNameMap=\
  atg.commerce.order.CreditCard=creditCardProcessorChain,\
  atg.commerce.order.GiftCertificate=giftCertificateProcessorChain,\
  atg.commerce.order.StoreCredit=storeCreditProcessorChain,\
  atg.commerce.order.Invoice=invoiceRequestProcessorChain

If you want to add further validation logic to your invoice processing, you should extend the InvoiceRequestProcessor.authorize() method. An example of how to extend validation can be found in the Extending Order Validation to Support New Payment Methods section of the Configuring Purchase Process Services chapter.