Iso8583消息编码和解码 [英] Iso8583 message encoding and decoding

查看:476
本文介绍了Iso8583消息编码和解码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是基于ISO8583交易信息标准。
我的问题陈述是开发一个应用程序,它将解码以HEX格式提供的ISO8583消息。



例如:我的输入= 0200B2200000001000000000000000800000201234000000010000011072218012345606A5DFGR021ABCDEFGHIJ 1234567890



使用jPOS库我解析这个十六进制代码,如下所示:
MTI:0200
场地-3:201234
场地-4:000000010000
场地-7:0110722180
场地11:123456
字段-44:A5DFGR
字段-105:ABCDEFGHIJ 1234567890

现在解析输出,我想解码,即我想将其转换为字符串格式。我想知道它究竟传达了什么,比如它是一个余额查询还是一个交易请求等。

所以,我的问题是,是否有任何工具可以理解iso8583消息的十六进制代码?

解决方案

根据1987年,1993年和2003年的ISO 8583规范,有大量方言。修改后的协议在字段中使用ASCII,Binary,BCD和EBCDIC数据。

您的消息示例与OmniPay Host to Host实现类似,未经本规范使用。



没有额外的修改,它被在线工具在 https://iso8583.info/lib/OmniPay/H2H/msg



使用您的消息binary表示:

  0000:30 32 30 30 42 32 32 30│30 30 30 30 30 30 31 30 0200B22000000010 
0010 :30 30 30 30 30 30 30 30│30 30 30 30 30 30 38 30 0000000000000080
0020:30 30 30 30 32 30 31 32│33 34 30 30 30 30 30 30 0000201234000000
0030:30 31 30 30 30 30 30 31│31 30 37 32 32 31 38 30 0100000110722180
0040:31 32 33 34 35 36 30 36│41 35 44 46 47 52 30 32 12345606A5DFGR02
0050:31 41 42 43 44 45 46 47│48 49 4A 20 31 32 33 34 1ABCDEFGHIJ 1234
0060:35 36 37 38 39 30│567890

原始信息中有些垃圾,但这不是解析器的错。 ))

  ---#Cheef的解析器(限制版本 - 仅限5级)
- msg:#OmniPay H2H消息
MTI:0200#消息类型ID。
DE000:B220000000100000#主位图// 1.3.4.7.11.44。
- BM0:#在主位图上的字段
DE001:0000000000800000#辅助位图// 105.
- DE003:#PC
S01:20#事务代码。 //退款
S02:12#账户,来自。
S03:34#帐号,至。
DE004:000000010000#金额,交易。 // 10000
- DE007:#日期和时间,传输
日期:0110#日期,本地传输。 // 2015.01.10
时间:722180#时间,本地传输。 // 00:22:20
DE011:123456#STAN。
- DE044:#附加响应数据
len:06
- val:
RFU:A5DFGR

为几种方言定义的在线解析器,因此您可以使用消息数据并分析结果。


My question is based on ISO8583 Transaction message standard. My problem statement is to develop an app which will decode the ISO8583 message which is provided as a input in HEX format.

for ex : my input = 0200B2200000001000000000000000800000201234000000010000011072218012345606A5DFGR021ABCDEFGHIJ 1234567890

Using jPOS library i am parsing this hex code and output is as follows : MTI : 0200 Field-3 : 201234 Field-4 : 000000010000 Field-7 : 0110722180 Field-11 : 123456 Field-44 : A5DFGR Field-105 : ABCDEFGHIJ 1234567890

Now this parsed output i want to decode i.e i want to convert it into the string format. I want to know what exactly it conveys, like if it is a balance inquiry or a transaction request etc.

so , my question is , is there any tool available to understand the hex code of iso8583 message?

解决方案

There are big list of dialects based on ISO 8583 specifications from 1987, 1993 and 2003 years. Modified protocols use the mix of ASCII, Binary, BCD, EBCDIC data in the fields.

Your message sample looks similar to OmniPay Host to Host implementation, except Field 105 which is not used by this specification.

Without additional modifications it was parsed by the online tool at https://iso8583.info/lib/OmniPay/H2H/msg

Use your message "binary" representation:

0000: 30 32 30 30 42 32 32 30 │ 30 30 30 30 30 30 31 30  0200B22000000010
0010: 30 30 30 30 30 30 30 30 │ 30 30 30 30 30 30 38 30  0000000000000080
0020: 30 30 30 30 32 30 31 32 │ 33 34 30 30 30 30 30 30  0000201234000000
0030: 30 31 30 30 30 30 30 31 │ 31 30 37 32 32 31 38 30  0100000110722180
0040: 31 32 33 34 35 36 30 36 │ 41 35 44 46 47 52 30 32  12345606A5DFGR02
0050: 31 41 42 43 44 45 46 47 │ 48 49 4A 20 31 32 33 34  1ABCDEFGHIJ 1234
0060: 35 36 37 38 39 30       │                          567890

Here are some garbage in the original message, but it is not the fault of parsers. ))

--- # Cheef's parser (Limited version - 5 levels deep only)
- msg:  # OmniPay H2H message
   MTI: "0200" # Message Type ID.
   DE000: "B220000000100000" # Primary bitmap  // 1.3.4.7.11.44.
 - BM0:  # Fields at Primary Bitmap
    DE001: "0000000000800000" # Secondary bitmap  // 105.
  - DE003:  # PC
     S01: "20" # Transaction Code.  // Refund
     S02: "12" # Account, from.
     S03: "34" # Account, to.
    DE004: "000000010000" # Amount, transaction.  // 10000
  - DE007:  # Date and time, transmission
     date: "0110" # Date, local transmission.  // 2015.01.10
     time: "722180" # Time, local transmission.  // 00:22:20
    DE011: "123456" # STAN.
  - DE044:  # Additional response data
     len: "06"
   - val: 
      RFU: "A5DFGR"

The online parsers defined for several dialects, so you can play with your messages data and analyze results.

这篇关于Iso8583消息编码和解码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆