Implementing a payment gateway response class

PolicyCenter uses a Gosu object that represents a response from the payment gateway to track the result of any request to the gateway. Many methods in the payment gateway plugin use a payment gateway response object as either an argument or a return value. The up-front payment state container, the silent post servlet, and the payment gateway forward page in the demonstration implementation of a payment gateway use or create these objects. The Gosu class implements the gw.api.payment.paymentgateway.PaymentGatewayResponse interface. This interface provides the following read-only properties:

  • Result – The String value of the code that the payment gateway returns, for example, “0” for success
  • ReferenceNumber – The String value that identifies the transaction
  • ResponseMessage – The String value that the payment gateway returns, for example, “Approved”
  • Amount – The String value that the payment gateway charged to the credit card
  • Token – The String value that contains the secure token for the transaction
  • OriginalTransactionID – The String value equal to the ReferenceNumber of a previous transaction for crediting or checking the status of that transaction
  • TransactionType – The PaymentTransactionType value for installments or reporting

The gw.payment.paymentgateway.impl.PaymentGatewayResponseBase class is a demonstration implementation of the payment gateway response. Edit this class or create your own implementation to support the requirements of your payment gateway.