用于美国运通的ISO8583 [英] ISO8583 for Amex

查看:138
本文介绍了用于美国运通的ISO8583的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人为Amex实现消息传递iso8583?我有一个端口和ip,但是当我使用套接字发送一个回显消息(1804)时,它什么也没应答...编码为EBCDIC.有没有人有榜样?代码在C#中

Has anyone implemented the messaging iso8583 for Amex? 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. Does anyone have an example? The code is in 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;
        }
    }

该消息是针对ISO8583全球信用授权指南(GCAG)的,

The message is for the ISO8583 Global Credit Authorization Guide (GCAG),

推荐答案

1.美国运通使用的类似于ISO8583的规范.

他们使用了几种自定义的ISO 8583方言作为示例:

They used several customized ISO 8583 dialects, for sample:

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

查看您的MTI 1804,我想它是GCAG,是的,消息通常是EBCDIC编码的.

Looking to your MTI 1804 I guess it is GCAG and, yes, the message usually EBCDIC encoded.

无法从您的请求中确切清除邮件正文.请添加您的网络消息的十六进制表示形式.它可能显示邮件正文编码的潜在问题.

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.

我们正在支持围绕ISO8583方言和财务数据的在线服务. 这是 GCAG ISO 8583消息正文解析器. 您可以检查传出邮件的结构和EBCDIC编码.

We are supporting online services around ISO8583 dialects and financial data. Here is the GCAG ISO 8583 message body parser. You can check the outgoing message structure and your EBCDIC encoding.

2.关于美国运通主机.

我可以同意,有许多TCP/IP套接字服务可以与Amex进行转发和交换消息数据,也可以自行处理消息,但实际上,在大多数情况下,Amex使用全球Web服务(GWS)IP支付网关,即HTTPS.与特定的HTTP标头连接.

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.

由于HTTP/HTTPS数据通过GWS传输,因此消息(甚至是EBCDIC编码的消息)都被处理为ASCII十六进制字符串.

Because of HTTP/HTTPS data transferring thru GWS the message, even EBCDIC encoded, processed as ASCII hexadecimal string.

TCP/IP套接字连接可能具有其他消息头,长度字节,开始和结束数据包数据.确保TCP/IP主机的连接要求.

TCP/IP Socket connections may have additional message headers, length bytes, starting and ending packet data. Ensure connection requirements for your TCP/IP host.

作为具有测试卡授权的Amex ISO 8583消息处理的工作示例,您可以尝试 GCAG主机模拟器直接通过表单或启动HTTPS主机模拟器服务发布您的请求消息.

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.

3.奖励示例

以下是您的1804消息,该消息已通过Amex GCAG主机模拟器处理了主要位图.以YAML表示的邮件结构.

Here is your 1804 message corrected with primary bitmap processed thru Amex GCAG host simulator. Messages structure represented in 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.

这篇关于用于美国运通的ISO8583的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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