Click here to Skip to main content
15,881,380 members
Articles / Programming Languages / C#

BIM-ISO8583

Rate me:
Please Sign up or sign in to vote.
4.79/5 (12 votes)
25 Mar 2013BSD 123.9K   21   15  
Implementation of ISO8583 in .NET
//Copyright © 2012, Eusebio "BIM" Garcia
//All rights reserved.

//Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

//     1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
//     2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
//     3. All advertising materials mentioning features or use of this software must display the following acknowledgement:
//        This product includes software developed by Eusebio "BIM" Garcia.
//     4. Neither the name of the Nova Stirlin Software Solutions(Phils) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

//THIS SOFTWARE IS PROVIDED BY Eusebio Garcia ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Eusebio Garcia BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


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


namespace Sample_ISO8583_Message_Builder
{
    class Program
    {
        static void Main(string[] args)
        {



            /// <summary>
            /// Developed by     : Bim Garcia
            /// Email address    : bimbo_garcia@yahoo.ie
            /// Telephone        : +639154132083
            /// Remarks:         : For help and suggestions, please feel free to call or email me from 09:00-15:00, GMT.
            /// </summary>
      
            
            
            //Set Data
            string MTI = "0200";                  //Message Type Identifier (Financial Message Request)
            string PAN ="60197105032103634";      //Primary Account No or Card No. [DE #2]
            string ProCode= "001000";            //Processing Code.[DE #3] (Purchase Transaction, Savings)
            string Amount ="15075";              //Transaction Amount.[DE #4] (X100) (ex: $150.75 = 15075 or 000000015075)  or simply remove the decimal.
            string DateTime ="0429104720";       //Transmission Date and Time.[DE #7] (format: MMDDhhmmss)
            string STAN ="456";             //System Trace Audit No.[DE #11] (456 or 000456)
            string TID="44449999";               //Terminal ID. [DE #41]    
            string POSEM = "02";                 //Point of Service Entry Mode. [DE #22] (02 - Magnetic Stripe)
           

            BIM_ISO8583.NET.ISO8583 iso8583 = new BIM_ISO8583.NET.ISO8583();

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


            string NewISOmsg= iso8583.Build(DE, MTI);
            Console.WriteLine("Build ISO8583 Message");
            Console.WriteLine("Output:");
            Console.WriteLine( NewISOmsg);
            Console.ReadLine();
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Software Developer (Senior)
Philippines Philippines
Bim has over 20 years of software development experience, with 15 years spent in the eBanking and payments space.

He has extensive experience developing banking and payment solutions, co-engineered a military-grade Secure Cryptographic Device, and authored BIMISO8583.NET and .JAVA libraries.

He is also a co-founder in three alpha-stage blockchain startups, including the Philippines first offline Bitcoin Wallet.

Currently, he is working with one of the most innovative Supply Chain and Logistic technology Providers (SCLTP).

Comments and Discussions