public void TestISO8583Message() { string MTI = "0200"; BIM_ISO8583.NET.ISO8583 iso8583 = new BIM_ISO8583.NET.ISO8583(); string[] DE = new string[130]; DE[22] = "021"; //DE[32] = "437586002"; string NewISOmsg = iso8583.Build(DE, MTI); string test = "0200323a448128e21881013000000000"; test += "00200001090438520005961538520109"; test += "01095811002141080043758637518868"; test += "0100002858d15122015301010540000f"; test += "35303039313533383035393653393231"; test += "38313633343337353836303030202020"; test += "202020383030204c414e47444f4e2053"; test += "542c202020202020202020204d414449"; test += "534f4e20202020202041553032385443"; test += "4330315c45464330303030303030305c"; test += "434349305c46424b565cab702f27a85e"; test += "87130000000000000001000000000000"; test += "cf74bdce00000000"; string[] decode = iso8583.Parse(test); }
private static void TestGetMiniStatement() { Socket clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); clientSocket.Connect("127.0.0.1", 4128); BIM_ISO8583.NET.ISO8583 Parseiso8583 = new BIM_ISO8583.NET.ISO8583(); string HexISOMessage = GetISO8583MiniStatementMessageToSend(); Console.WriteLine("ISO 8583 Request:" + HexISOMessage); byte[] outStream = Encoding.UTF8.GetBytes(HexISOMessage); clientSocket.Send(outStream); byte[] inStream = new byte[100025]; int result = clientSocket.Receive(inStream); string returndata = Encoding.UTF8.GetString(inStream, 0, result); Console.WriteLine("Response:" + returndata); string[] DE = new string[130]; DE = Parseiso8583.Parse(returndata); string[] lines = DE[125].Split('|'); string statusCode = DE[39]; string StatusDesc = DE[47]; string PegPayId = DE[48]; Console.Read(); }
public string ProcessRequest(string content) { string response = ""; try { //4. <<< Use "Parse" method of object iso8583. >>> BIM_ISO8583.NET.ISO8583 Parseiso8583 = new BIM_ISO8583.NET.ISO8583(); string[] DE = Parseiso8583.Parse(content); PrintIsoMessage(DE); string MTI = DE[129]; switch (MTI) { case "0200": response = DoTransactOperation(DE); break; case "0400": response = DoReversalOperation(DE); break; case "0800": response = DoEchoOperation(DE); break; case "0100": response = DoAccountInquiryOperation(DE); break; case "0500": response = DoGetMiniStatementOperation(DE); break; default: response = ReturnOperationNotSupportedError(DE); break; } } catch (Exception ex) { response = InvalidISOformatErrorMessage(); } return(response); }