Payment gateway plugin

PolicyCenter supports electronic payment of the up-front payment for a policy job. To customize how PolicyCenter communicates with an electronic payment service, implement your own version of the payment gateway plugin interface PaymentGatewayPlugin. The plugin handles communication between PolicyCenter and any payment gateway that you need to support, such as PayPal or BarclayCard SmartPay. The interface methods provide the typical functionality of a payment gateway.

The base configuration implements the plugin in the Gosu StandAlonePaymentGatewayPlugin class. The plugin emulates the interaction with a payment gateway by running the PCF files in the pcf/payment/demo folder under the Page Configuration folder. You can examine this plugin to see the basic tasks that a payment gateway performs. Typically, you create your own implementation of this plugin to communicate between PolicyCenter and the payment gateways that you support.

The following table lists the required methods and their purpose.

Method

Description

getCardDetails

Gets a representation of the credit card as a payment instrument.

inquiryPaymentGatewayTransaction

Returns a payment gateway response object that contains information about the status of a transaction.

isApprovedTransaction

Returns a boolean value, which has a value of true if the specified transaction succeeded and false otherwise. This method uses the response object that inquiryPaymentGatewayTransaction returns to get this information.

isVoidedTransaction

Returns a boolean value, which has a value of true if the specified transaction has been voided and false otherwise. This method uses the response object that inquiryPaymentGatewayTransaction returns to get this information.

mapSilentPostRequestToPaymentGatewayResponse

Returns a payment gateway response object that maps the parameters from an incoming HTTP servlet request to payment gateway response properties. The servlet handles closure of the browser when the user is accessing the payment gateway.

redirectToPaymentGateway

Uses exit points to redirect from PolicyCenter to the supported payment gateways.

refundFullAmountForTransaction

Returns a payment gateway response object that contains information about an attempt to refund a credit card transaction. PolicyCenter can perform this action only before binding a job.

requestSecureToken

Returns a payment gateway response object that contains a secure token for communication with the payment gateway as part of the payment gateway response. Implement code for each payment gateway that you need to support.

submitAccountVerification

Returns a payment gateway response object that contains information about the status of a new credit card verification. If the payment gateway does not require this verification, create a successful response without calling the gateway.

takePaymentUsingPaymentInstrument

Returns a payment gateway response object that contains information about an attempt to use a payment instrument to make a payment.

See also