Step 1: Designing a payments cassette plug-in

In this part of the tutorial you will design a payments cassette plug-in and prepare the development environment for it. To design the plug-in, understand the Payment plug-in specification and the payment service system you are working with. In this tutorial, the payment service system is the old implementation of IBM WebSphere Commerce Payments.

Follow these steps to design and prepare your development environment:

  1. Make sure that your client API is ready for your payment service system.
    For IBM WebSphere Commerce Payments component, the client API is included in the WCDE_installdir/workspace/WC/lib/payment/etillCal.zip
    This client API package handles the http/https communication protocol and also parses the message protocol format that WebSphere Commerce Payments accepts. If your payment service system has no client API, you should create one for Java so that you can reuse it for other client applications. This client API will wrap all the low level communication and message processing to the high level API, where the client inputs all the required parameters and gets the returned java object that contains the response information.
  2. Map the plug-in specification objects to the WebSphere Commerce Payments financial objects. Mapping the object in two systems lets the plug-in know how to find the information from the back-end system. You can find table showing the object mapping between the payments plug-in and the old Payments component in the file Mappings of WebSphere Commerce Payments objects to WebSphere Commerce Payments objects in the online help.
  3. Models the behaviors of each financial API for the payment plug-in specifications. You need to map each API to the available APIs of your client API library. If one API is not supported, you can also throw PluginFunctionNotSupportedException. For Payments Client API Library, all the APIs are named as actions. You can find the table showing the financial transaction APIs supported by the payments cassette plug-in and the payment query APIs supported by the WC Payments Cassette plug-in in the file Payments Cassette plug-in financial transactions in the online help.
  4. Maps the Payment System exception and return code to payment plug-in specification exceptions. This step is to make sure that the error handling is correct.
    You can find the table showing the exceptions that are thrown by the payments cassette plug-in, with specific meanings in a WebSphere Commerce Payments context, and also the exceptions thrown by the payments cassette plug-in that are related to non-zero return codes received from WebSphere Commerce Payments in the file Payments Cassette plug-in exceptions in the online help.
  5. Define your messages for your plug-in. The message helps the client to know the process results in the natural language. For the WebSphere Commerce Payments plug-in, we will create error messages for each primary and secondary return code. These return codes are defined by the old implementation of WebSphere Commerce Payments. Now all the important parts of your design are complete. Next we prepare the development environment.
  6. Ensure that you have installed IBM WebSphere Commerce Developer and created and configured a server for a remote payment instance to use IBM WebSphere Commerce Developer as its user realm. (You can refer Create a WebSphere Commerce Payments instance for more information.) You have now designed your plug-in. In the next step of the tutorial, you will learn how to create the plug-in.