CreditServiceHandler Interface
The instance of the CreditServiceHandler
interface is used to:
Transform requests before sending them it to the Service Provider
Transform the response before sending it back to the SAP POS Store Data Transfer for Retail client
It serves as an intermediary for translating the message format specifics and must be implemented for each Service Provider.
The ISO8583Base
class is used as an intermediate format for manipulating the request and response objects. It is obtained by converting the incoming XML message (represented by TNXMLMessage
class). It is also used to get the instance
of the TNXMLMessage
class, when response is received from the Service Provider.
As shown in the diagrams for Synchronous EFT Framework and Asynchronous EFT Framework, the appropriate getExternalRequest
method
of this class is called by the EFTService
to convert the request (ISO8583Base
representation) to the Service Provider expected format.
When response is received from the Service Provider:
The EFTService
uses the CreditServiceHandler
to convert a raw bytes representing the response to the internal response representation (CreditSetviceResponse
class)
The CreditServiceHandler
is invoked again to convert the CreditSetviceResponse
obtained at the previous step to the instance of ISO8583Base
.
The ISO8583Base
instance is converted to the TNXMLMessage
instance, containing message format understandable by the SAP POS Store Data Transfer for Retail client (that is, compliant with Transnet.XML Message specification),
and the response is returned back to the client.
For the details on the CreditServiceHandler
interface, see SAP POS Store Data Transfer for Retail JavaDocs. Not all implementations require all the methods defined
by the CreditServiceHandler
interface. The core of SAP POS Store Data Transfer for Retail provides the BaseCreditServiceHandler
class implementing the interface. This class provides stub implementation of the CreditServiceHandler
interface.
Recommendation
To avoid extra work, we recommend that the handler class should extend the BaseCreditServiceHandler
and override only the required methods. There are three types of methods in the CreditServiceHandler
interface discussed in the following
sections.