Implementing the payment gateway plugin

For demonstration purposes only, the base configuration of PolicyCenter provides an implementation of the PaymentGatewayPlugin interface in gw.plugin.paymentgateway.StandAlonePaymentGatewayPlugin. Various plugin methods in this class return hard-coded values rather than calling the payment gateway to retrieve information. This class does not use any of the exit point from PolicyCenter to the payment gateway, the entry point that returns from the payment gateway, or the silent post servlet. In this demonstration plugin class, the redirectToPaymentGateway plugin method calls a demonstration version of a payment system that PolicyCenter itself implements as PCF files. These files are located in the Page Configuration folder pcf/payment/demo.

Create your own plugin class to implement the PaymentGatewayPlugin interface. Change the plugin registry of the PaymentGatewayConfigPlugin interface to use your plugin class. Your plugin class must be able to:

  • Take information about the payment amount and electronic payment instrument from the Payment screen in the PolicyCenter user interface. Save the payment instrument if the user selects Save for Future Use.
  • Send the payment information to an external payment gateway in the form that the gateway requires.
  • Retrieve success or failure information about a payment request from the payment gateway. Save information about a successful request on the Job entity instance for the policy period. Send information about a successful payment or credit to the billing system.
  • Ensure that a payment request does not get processed multiple times. Recognize that the Up-front Payment user interface does not show a successful payment and synchronize the user interface to show the result of the payment gateway transaction.
  • Use the payment gateway to reverse a payment, and then remove the reversed payment from the Job entity instance.