Supporting multiple payment protocols with a payment plug-in

A payment plug-in can support one or more payment methods. For example, a plug-in can accept transactions for credit card brand X and credit card brand Y. Or, it could support credit card transactions and the processing of electronic checks.

The SimpleOffline plug-in provided in WebSphere Commerce is a working example of how a single plug-in can accommodate the use of various payment methods.

An XML file, SimpleOfflinePlugin.xml, contains a list of the unique parameters (plug-in properties) required for each supported payment method and for communication with the payment back-end system. The SimpleOffline plug-in uses the SimpleOfflinePlugin.xml file to check that all of the required parameters for the specified payment instruction are present before proceeding with a transaction.

The mapping of a payment method (such as a particular brand of credit card) to a plug-in is done through payment system name, which is used in a Payment Rules configuration XML file (PaymentMethodConfiguration.xml file or RefundMethodConfigurations.xml file).

Protocol information related to a payment method is obtained through the getExtendedData method as described in the API information for the PaymentInstruction interface.

If you are writing your own plug-in, review the Payment plug-in specification and refer to the description of the SimpleOffline plug-in to see an example of how multiple payment methods are included in a plug-in.