0

I am trying to understand iso8583 and how to send it to our payment provider. I see that the first piece of the message structure is the Message Type Identifier. I used 0100 for authorization, which seems to be correct. However it also seems that I am not sending it in the right format. I simply sent the binary representation, meaning I sent and then the rest of the message. Do I need to convert 0100 into bytes before sending it? I am using node.js. Any help is appreciated, as this is a very complex topic.

user8408326
  • 83
  • 1
  • 2
  • 7

2 Answers2

0

You have to use ascii format. In your case you have to send authorization using 4 bytes 0100 ascii the representation in hex is 0x30 0x31 0x30 0x30

  • Thanks. Do I have to convert binary (0100) to ascii? – user8408326 Aug 09 '17 at 13:28
  • if you are considering the MTI, then it is not a binary value, it is the literal 0100 for authorization request and 0110 for the response. same field might contain values like 0200 or 0430, don't be confused by the 0's and 1s – A.Rashad Aug 25 '17 at 21:19
  • I am still confused. Sorry about that. Say I have 0100, what exactly would I send here? Is there an online converter that can help me? Thanks so far. – user8408326 Aug 29 '17 at 02:32
0

What Panagiotis was saying is the MTI (and the rest of the message) need to be convert from ASCII to Hexadecimal. Something like this would do it:

    let message = "0100..."
    let msgArr = message.split( "" )
    let convertedMessage = ""
    for ( let index in msgArr )
    {
        convertedMessage += String.fromCharCode( msgArr[ index ]).toString( 16 )
    }
    // use convertedMessage to send your request