Closed dlbirch closed 9 years ago
The class example I listed above left out the definition of: mti 1421, "Reversal Advice Repeat Acquirer Gateway"
it is in the class ... I just left it off when I copied it to this board.
Ok, I have this working ... I'm creating a message and sending it over a TCP/IP Socket and then re-constructing the message on the server.
@client = TCPSocket.new(host, port) payload_bytes = payload.to_b @client.write(payload_bytes)
payload = connection.read(msg_length[0]) message_received = ISO8583::Ums_Message.parse payload
Happy to hear you managed to sort it out! Only have a tablet to type. On til the weekend :-)
Hello,
I have a question about how to take a message instance, serialize it (via to_b or to_s) and then, read that back into a message via Message.parse.
So, for the following message:
require 'iso8583'
module ISO8583
class Ums_Message < Message mti_format N, :length => 4 mti 1100, "Authorization Request Acquirer Gateway"
end
end
I run this code and it breaks with the error message at the bottom. What am I doing wrong?
mes = ISO8583::Ums_Message.new("Reversal Advice Repeat Acquirer Gateway") mes[2] = 1234567890123456789 mes["Processing Code"] = "123456"
outbound_msg_str = mes.to_s #serialize to a string outbound_msg = ISO8583::Ums_Message.new("Reversal Advice Repeat Acquirer Gateway") #create new message instance outbound_msg = ISO8583::Ums_Message.parse outbound_msg_str #de-serialize into new instance
ISO8583::ISO8583Exception: MTI: 0 not allowed!