简体   繁体   English

Amex的ISO8583

[英]ISO8583 for Amex

Has anyone implemented the messaging iso8583 for Amex? 有没有人为Amex实现了消息传递iso8583? I have a port and ip, but when I send an echo message (1804) with a socket it does not answer anything ... The Encoding is EBCDIC. 我有一个端口和IP,但是当我发送带有套接字的回显消息(1804)时,它没有回答任何内容......编码是EBCDIC。 Does anyone have an example? 有人有例子吗? The code is in C# 代码在C#中

Console.WriteLine("Send Message Echo...");
ManageConnection.ManageSocket _manage = new ManageConnection.ManageSocket(IpAmex, PortAmex);
TupleList<Encoding, string> _request = new TupleList<Encoding, string>();
_request.Add(Encoding.GetEncoding(500), "1804");
_request.Add(Encoding.UTF8, "2030018000000000");
_request.Add(Encoding.GetEncoding(500), "000000");
_request.Add(Encoding.GetEncoding(500), "112233");
_request.Add(Encoding.GetEncoding(500), "1709141205108318700");
var _response = _manage.SendMessageSocket(_request);
return _response;


 public string SendMessageSocket(TupleList<Encoding, string> _messages) {
        string _return = String.Empty;
        try
        {
            byte[] bytes = new byte[65000];
            IPAddress ipAddress = IPAddress.Parse(IP);
            IPEndPoint remoteEP = new IPEndPoint(ipAddress, Port);
            Socket sender = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            sender.Connect(remoteEP);
            Console.WriteLine("Enviando mensaje....");
            var bytesMessage = GetCompleteMessage(_messages);
            // This function GetCompleteMessage= byte[] bytesMessage = { 241, 248, 240, 244, 32, 48, 1, 128, 0, 0, 0, 0, 240, 240, 240, 240, 241, 241‌​, 241, 242, 242, 243, 243‌​, 241, 247, 240, 249, 241, 244, 241, 242, 240, 245, 241, 240, 248, 243, 241,‌​248, 247, 240, 240 };
            int bytesSent = sender.Send(bytesMessage);
            Console.WriteLine("Esperando respuesta....");
            int bytesRec = sender.Receive(bytes); //Here don't receive nothing
            int len = Array.IndexOf(bytes, byte.MinValue);
            var responseString = Encoding.UTF8.GetString(bytes, byte.MinValue, len);

            sender.Shutdown(SocketShutdown.Both);
            sender.Close();
            return xmlResponseString;
        }
        catch (Exception ex)
        {

            throw;
        }
    }

The message is for the ISO8583 Global Credit Authorization Guide (GCAG), 该消息适用于ISO8583全球信用授权指南(GCAG),

1. ISO8583-like specifications used by American Express. 1.美国运通使用的类似ISO8583的规格。

They used several customized ISO 8583 dialects, for sample: 他们使用了几种定制的ISO 8583方言,用于样本:

  • Global Credit Authorization Guide ( GCAG ), 全球信贷授权指南( GCAG ),
  • Global Electronic Data Capture ( GEDC ) Terminal Message Specification, 全球电子数据采集( GEDC )终端消息规范,
  • Plural Interface Processing ( PIP ) Terminal Interface. 多个接口处理( PIP )终端接口。

Looking to your MTI 1804 I guess it is GCAG and, yes, the message usually EBCDIC encoded. 期待您的MTI 1804,我猜它是GCAG,是的,该消息通常是EBCDIC编码的。

From your request is not clear exactly the message body. 从您的请求中不清楚消息正文。 Please Add the hexadecimal representation of your network message. 请添加网络消息的十六进制表示。 It could show the potential issue with the message body encoding. 它可以显示消息体编码的潜在问题。

We are supporting online services around ISO8583 dialects and financial data. 我们支持围绕ISO8583方言和财务数据的在线服务。 Here is the GCAG ISO 8583 message body parser . 这是GCAG ISO 8583消息体解析器 You can check the outgoing message structure and your EBCDIC encoding. 您可以检查传出消息结构和EBCDIC编码。

2. About American Express hosts. 2.关于美国运通主机。

I could agree that there are many TCP/IP Socket services which may forward and exchange message data with Amex or process message themselves, but in fact Amex uses Global Web Services (GWS) IP Payments Gateway in most cases, which is HTTPS connection with specific HTTP Headers. 我同意有许多TCP / IP套接字服务可以转发和交换消息数据与Amex或处理消息本身,但实际上Amex在大多数情况下使用全球Web服务(GWS)IP支付网关,这是具有特定的HTTPS连接HTTP标头。

Because of HTTP/HTTPS data transferring thru GWS the message, even EBCDIC encoded, processed as ASCII hexadecimal string. 由于通过GWS传输的HTTP / HTTPS数据,甚至是EBCDIC编码的消息,处理为ASCII十六进制字符串。

TCP/IP Socket connections may have additional message headers, length bytes, starting and ending packet data. TCP / IP套接字连接可能具有其他消息头,长度字节,开始和结束分组数据。 Ensure connection requirements for your TCP/IP host. 确保TCP / IP主机的连接要求。

As an working example of Amex ISO 8583 message processing with test cards authorizations you can try GCAG host simulator posting your request messages directly thru the form or starting HTTPS host simulator service. 作为使用测试卡授权的Amex ISO 8583消息处理的工作示例,您可以尝试GCAG主机模拟器直接通过表单或启动HTTPS主机模拟器服务发布您的请求消息。

3. Example as a bonus 3.作为奖金的例子

Here is your 1804 message corrected with primary bitmap processed thru Amex GCAG host simulator. 这是您通过Amex GCAG主机模拟器处理的主位图更正的1804消息。 Messages structure represented in YAML. 消息结构以YAML表示。

---
# Cheef's parser.
# Copyright (C) 2008-2017 Alexander Shevelev. https://iso8583.info/
# lib   : "/lib/AMEX/GCAG/" - Global Credit Authorization Guide
# tool  : "host"
# stat  : 28 nodes, 14 lookup tables, 92.86% passed (13/14)

host: # AMEX GCAG host simulator
- rq:#"F1F8F0F42030018000000000F0F0F0F0F0F0F1F1F2F2F3F3F1F7F0F9F1F4..F0F0" # AMEX GCAG message
  - MTI: "1804" # Message Type ID. // network management request
  - DE000: "2030018000000000" # Primary bitmap // 3.11.12.24.25.
  - BM0:#"F0F0F0F0F0F0F1F1F2F2F3F3F1F7F0F9F1F4F1F2F0F5F1F0F8F3F1F8F7F0F0" # Fields at Primary Bitmap
    - DE003:#"000000" # PC // System Audit Control/Echo Message
      - S01: "00" # Transaction Code. // Goods and service
      - S02: "00" # Account, from. // unspecified
      - S03: "00" # Account, to. // unspecified
    - DE011: "112233" # STAN.
    - DE012:#"170914120510" # Date and time, local transaction
      - date: "170914" # Date, local transaction. // 2017.09.14
      - time: "120510" # Time, local transaction. // 12:05:10
    - DE024: "831" # Function code. // echo test.
    - DE025: "8700" # Message reason code (MRC).
- rs:#"F1F8F1F42030010002000000F0F0F0F0F0F0F1F1F2F2F3F3F1F7F0F9F1F4..F0F0" # AMEX GCAG message
  - MTI: "1814" # Message Type ID. // network management request response
  - DE000: "2030010002000000" # Primary bitmap // 3.11.12.24.39.
  - BM0:#"F0F0F0F0F0F0F1F1F2F2F3F3F1F7F0F9F1F4F1F2F0F5F1F0F8F3F1F0F0F0" # Fields at Primary Bitmap
    - DE003:#"000000" # PC // System Audit Control/Echo Message
      - S01: "00" # Transaction Code. // Goods and service
      - S02: "00" # Account, from. // unspecified
      - S03: "00" # Account, to. // unspecified
    - DE011: "112233" # STAN.
    - DE012:#"170914120510" # Date and time, local transaction
      - date: "170914" # Date, local transaction. // 2017.09.14
      - time: "120510" # Time, local transaction. // 12:05:10
    - DE024: "831" # Function code. // echo test.
    - DE039: "000" # Action Code // approved.

I don't understand C#, but I implemented AMEX in JAVA. 我不懂C#,但我在JAVA中实现了AMEX。 I guess you shouldn't encode bitmap in EBCDIC, but instead only unhex its content. 我想你不应该在EBCDIC中编码位图,而只是取消它的内容。 As the bitmap, I mean ' 2030018000000000 '. 作为位图,我的意思是' 2030018000000000 '。

I hope this will help. 我希望这将有所帮助。

Message needs to contain the two-bytes describing the length of the message content. 消息需要包含描述消息内容长度的两个字节。 The said two bytes were missing from the message. 消息中缺少上述两个字节。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM