Click here to Skip to main content
Click here to Skip to main content

BIM-ISO8583

By , 25 Mar 2013
 

Introduction  

BIM-ISO8583.NET is a .NET library that allows developers to parse and create ISO8583 messages.

This library was released to help financial system developers to fully comply with ISO 8583 protocol's standard and make development fast and easy.

Background 

The program method and technique used in this library were developed by Bim Garcia. He aims to establish a significant contribution for the enhancement and advancement of the present technology specifically in the financial industry. 

Using the Library

Here's how to use the library:  

  1. Download full source code of library (click here to download)
  2. Use the codes below.

Create an ISO8583 message:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BIM_ISO8583;


namespace Sample_ISO8583_Message_Builder
{
    class Program
    {
        static void Main(string[] args)
        {
            //1. Set/Define Data
            //Message Type Identifier (Financial Message Request)
            string MTI = "0200";
            //Primary Account No or Card No. [DE #2]
            string PAN ="60197105032103634";
            //Processing Code.[DE #3] (Purchase Transaction, Savings)
            string ProCode= "001000";
            //Transaction Amount.[DE #4] (X100) (ex: $150.75 = 15075 or
            // 000000015075)  or simply remove the decimal.
            string Amount ="15075";    
            //Transmission Date and Time.[DE #7] (format: MMDDhhmmss)
            string DateTime ="0429104720";
            //System Trace Audit No.[DE #11] (456 or 000456)
            string STAN ="456";
            //Terminal ID. [DE #41]    
            string TID="44449999";
            //Point of Service Entry Mode. [DE #22] (02 - Magnetic Stripe)
            string POSEM = "02";
           

            //2.Create an object BIM-ISO8583.ISO8583
            BIM_ISO8583.NET.ISO8583 iso8583 = new BIM_ISO8583.NET.ISO8583();

            //3. Create Arrays
            string[] DE = new string[130];

            //4. Assign corresponding data to each array
            //   Ex: ISO8583 Data Element No.2 (PAN) shall assign to newly created array, DE[2];

            DE[2] = PAN;
            DE[3] = ProCode;
            DE[4] = Amount;
            DE[7] = DateTime;
            DE[11] = STAN;
            DE[22] = POSEM;
            DE[41] = TID;
            

            //5.Use "Build" method of object iso8583 to create a new  message.
            string NewISOmsg= iso8583.Build(DE, MTI);
            
            Console.WriteLine("Build ISO8583 Message");
            Console.WriteLine("Output:");
            Console.WriteLine( NewISOmsg);
            Console.ReadLine();
        }
    }
}

Parse an ISO8583 message:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BIM_ISO8583;

namespace Parser
{
    class Program
    {
        static void Main(string[] args)
        {
            //<<< 1. Create an object of iso8583 >>>>
            BIM_ISO8583.NET.ISO8583 iso8583 = new BIM_ISO8583.NET.ISO8583();

            //2.<<< Prepare ISO8583 message to be parsed >>>
            string ISO8583Message = "0200722004000080000016601971" + 
              "0503210346001000000000015075042910472000045600244449999";                                        
          
            //3. <<< Declare String Arrays >>>
            string[] DE;

            //4. <<< Use "Parse" method of object iso8583. >>>
            DE = iso8583.Parse(ISO8583Message);

            //That was it!!!

            //If there is no error occurred then you have successfully parsed a valid ISO8583 message

            //Here's how to use the newly parsed ISO8583 Data Elements
            string PrimaryBitMap = DE[0];
            string SecondaryBitMap = DE[1];
            string PAN = DE[2];
            string ProcessingCode = DE[3];
            string Amount = DE[4];
            string TransmissionTime = DE[7];
            string SystemTraceNo = DE[11];
            string TerminalID = DE[41];
            string MerchantID = DE[42];
            string AdditionalData = DE[48];
            string MTI = DE[129];               

            //Displaying  Data Elements
            Console.WriteLine();
            Console.WriteLine("Please Press 'ENTER' to continue...");
            Console.ReadLine();
            
            Console.WriteLine(" PrimaryBitMap = DE[0]" + " = {0}", DE[0]);
            Console.WriteLine(" SecondaryBitMap = DE[1]" + "= {0}", DE[1]);
            Console.WriteLine(" PAN = DE[2]" + "= {0}", DE[2]);
            Console.WriteLine(" ProcessingCode = DE[3]" + "= {0}", DE[3]);
            Console.WriteLine(" Amount = DE[4]" + "= {0}", DE[4]);
            Console.WriteLine(" TransmissionTime = DE[7]" + "= {0}", DE[7]);
            Console.WriteLine(" SystemTraceNo = DE[11]" + "= {0}", DE[11]);
            Console.WriteLine(" TerminalID = DE[41]" + "= {0}", DE[41]);
            Console.WriteLine(" MerchantID = DE[42]" + "= {0}", DE[42]);
            Console.WriteLine(" AdditionalData = DE[48]" + "= {0}", DE[48]);
            Console.Read();
        }
    }
}

License

This article, along with any associated source code and files, is licensed under The BSD License

About the Author

Bim Garcia
Software Developer
Philippines Philippines
Member
I am a Software Engineer based in Manila. my corporate career started when I enhanced the world's first Interbank Mobile Banking System known as Globe Mobile Banking System (Globe MBS).
 
Currently, I am working with a payment gateway company and some banking institutions to develop another payment technology. Perhaps, another world's first mobile commerce technology.
 
I am also an Information Security Researcher.
 
Recently, I have developed some military grade security boxes, which will make payment ecosystem more secured.
 
Summary:
Developed world class mobile payment applications. 15+ years of experience in enterprise application design, development and management.
 
I'm a visionary, innovative and passionate about making the visions work and become a reality!

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionField 123 and 127memberProgramm3r22 Apr '13 - 21:52 
QuestionDoubts on ISO8583 standardmemberAmajaya12321 Feb '13 - 19:40 
AnswerRe: Doubts on ISO8583 standard [modified]memberBim Garcia10 Apr '13 - 18:18 
QuestionEBCDICmemberMember 390018714 Dec '12 - 20:49 
AnswerRe: EBCDICmemberBim Garcia15 Jan '13 - 20:46 
QuestionHellomemberthomy198420 Sep '12 - 22:19 
AnswerRe: HellomemberBim Garcia20 Sep '12 - 22:41 
GeneralMy vote of 4memberNuren Geodakov22 Aug '12 - 3:16 
GeneralRe: My vote of 4memberBim Garcia18 Sep '12 - 18:31 
GeneralHimemberGopa Panda20 Jun '12 - 19:44 
GeneralRe: HimemberBim Garcia18 Sep '12 - 18:33 
QuestionPadRight [modified]memberjfriedman5 May '12 - 9:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 25 Mar 2013
Article Copyright 2012 by Bim Garcia
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid