Skip to content

ISO8583 Connector Example

Given below is a sample scenario that demonstrates how the WSO2 ISO8583 Connector sends an ISO8583 message to financial networks using WSO2 Micro Integrator.

The ISO8583 message format is used for financial transactions such as ATM, POS, Credit Card, Mobile Banking, Internet Banking, KIOSK, e-commerce, etc. transactions.

The financial transaction involves communication between two systems through a socket connection. After the connection is established, each system can send messages in ISO8583 format, which commonly will be requested and the other system will send a response.

For example, the purchase made in a store may travel from the merchant terminal through another terminal such as banking systems. This requires a network or networks to the issuing bank where the card holder's account is held. Cardholder-originated transactions include purchase, withdrawal, deposit, refund, reversal, balance inquiry, payments, and inter-account transfers. ISO8583 also defines system-to-system messages for secure key exchanges, reconciliation of totals, and other administrative purposes. The response on authorizing or declining the transaction needs to be returned by the same route to the terminal

What you'll build

This example demonstrates, how to expose core banking system functionality working with ISO8583 protocol as an API. Here WSO2 EI acts as ISO8583 terminal for the banking network. In this scenario to mock the banking network we used Test mock server.

Given below is a sample API that illustrates how you can configure ISO8583 with the init operation and then use the iso8583.sendMessage operation to send an ISO8583 message for the financial transactions.

To know the further information about the init and iso8583.sendMessage operations please refer this link.

ISO8583 Connector

If you do not want to configure this yourself, you can simply get the project and run it.

Configure the connector in WSO2 Integration Studio

Follow these steps to set up the ESB Solution Project and the Connector Exporter Project.

  1. Open WSO2 Integration Studio and create an Integration Project. Creating a new Integration Project

  2. Right click on the project that you created and click on Add or Remove Connector -> Add Connector. You will get directed to the WSO2 Connector Store.

  3. Search for the specific connector and download it to the workspace. In this case, Salesforce is used as an example, but you can do this for the connector you require for your integration scenario.
    Search Connector in the Connector Store

  4. Click Finish, and your Integration Project is ready. The downloaded connector is displayed on the left side palette with its operations.

  5. You can drag and drop the operations to the design canvas and build your integration logic. Drag connector operations

  6. Right click on the created ESB Solution Project and select, -> New -> Rest API to create the REST API.

  7. Specify the API name as SendisoTestAPI and API context as /sendiso. You can go to the source view of the XML configuration file of the API and copy the following configuration (source view).

<?xml version="1.0" encoding="UTF-8"?>
<api context="/sendiso" name="SendisoTestAPI" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="POST">
        <inSequence>
            <log>
                <property name="status" value="Sending_an_ISO8583_Messsage"/>
            </log>
            <iso8583.init>
                <serverHost>localhost</serverHost>
                <serverPort>5010</serverPort>
            </iso8583.init>
            <iso8583.sendMessage/>
            <respond/>
        </inSequence>
        <outSequence>
            <log/>
            <send/>
        </outSequence>
        <faultSequence/>
    </resource>
</api>
Now we can export the imported connector and the API into a single CAR application. CAR application is the one we are going to deploy to server runtime.

Get the project

You can download the ZIP file and extract the contents to get the project code.

Download ZIP

Deployment

Follow these steps to deploy the exported CApp in the Enterprise Integrator Runtime.

Deploying on WSO2 Enterprise Integrator 7

You can copy the composite application to the /repository/deployment/server/carbonapps folder and start the server. Micro Integrator will be started and the composite application will be deployed. You can further refer to the application deployed through the CLI tool. You can download the CLI tool from here from the Other Resources section. Make sure you first export the PATH as below.

  $ export PATH=/path/to/mi/cli/directory/bin:$PATH
  1. Log in to Micro Integrator using the following command.

    ./mi remote login
  2. Provide default credentials admin for both username and password.

  3. In order to view the APIs deployed, execute the following command.

    ./mi api show
Click here for instructions on deploying on WSO2 Enterprise Integrator 6
  1. You can copy the composite application to the /repository/deployment/server/carbonapps folder and start the server.

  2. WSO2 EI server starts and you can login to the Management Console https://localhost:9443/carbon/ URL. Provide login credentials. The default credentials will be admin/admin.

  3. You can see that the API is deployed under the API section.

Testing

Invoke the API as shown below using the curl command. Curl Application can be downloaded from [here] (https://curl.haxx.se/download.html).

       curl -v POST -d 
       '<ISOMessage>
            <header>AAAAaw==</header>
            <data>
             <field id="104">000001161204171926FABCDE123ABD06414243</field>
             <field id="109">000termid1210Community106A5DFGR1112341234234</field>
             <field id="125">1048468112122012340000100000001107221800</field>
             <field id="127">01581200F230040102B000000000000004000000</field>
            </data>
        </ISOMessage>' "http://localhost:8290/sendiso" -H "Content-Type:application/xml"
Expected Response:

       <ISOMessage>
       <header>MDIxMA==</header>
       <data>
       <field id="0">8000</field>
       <field id="23">000</field>
       </data>
       </ISOMessage>  

What's next

Top