juks / iso-8583-socket-queue

ISO 8583 gateway
MIT License
194 stars 111 forks source link

Make gateway a server rather than client #8

Closed adelosa closed 7 years ago

adelosa commented 7 years ago

Hi there.. first, thanks for creating this project. Its a great tool for testing these types of payment systems. My question is in relation to the upstream host connection. As far as I can tell, the only connection mode supported for the upstream host seems to be with SocketQueue as a client and the host (assuming SmartVista or Openway) running as server. In my environment, our host connects to our system as a client so I would like to run the SocketQueue gateway as a server with the upstream host connecting as a client. Is this possible with the tool and if not, is it a major change to support such an upstream configuration?

juks commented 7 years ago

Hi!

Good challenge :-) Give me a day to figure out if I can implement it well with the current solution. Just curious: what kind of system is this?

adelosa commented 7 years ago

Thanks for responding so quickly.. We run HP NonStop hardware and Connex switch software. Its a pretty common card switch setup. The link setup varies by link generally and can be established by either end depending on the agreement of the parties.. I am looking to use your software to simulate the Connex host and send automated test messages to a downstream system that connects to Connex and uses ISO messages.

juks commented 7 years ago

Thanks for your remark. Seems it will sit on the current code structure, but likely somebody have to contribute into specific 8583 implementation after it is done.

juks commented 7 years ago

Please check "listen" branch: https://github.com/juks/SocketQueue/tree/listen Where you can use just --upstreamListenPort=port parameter without --upstreamHost parameter.

Keep in mind: only one upstream connection at a time for the moment. All concurrent connections will get dropped.

adelosa commented 7 years ago

Will have a play and let you know how I go.. thanks again!

adelosa commented 7 years ago

Hi Igor, I want to test this change in our environment, but at this point I'm having some issues with the message formats. At this point I have 2 challenges which I would be happy to assist with although Node is not a language I work with much..

message headers

Our link ISO messages have a fixed header that is added to each message after the message length. So in receiving a message, you should ignore the header and then process the remaining data as a standard iso8583 message. Responses also have the header attached. This should be a config option.

bitmap format

Process ISO bitmap as HEX characters rather than binary format. This should be a config option. Using the echo message as an example: Instead of a binary bitmap of 8 bytes (\xnn indicating binary values) '0800\x22\x20\x01\x00\x00\xc0\x00\x00000000060716170012345600000123456123567890124567' It would be a hex character bitmap of 16 bytes '08002220010000c00000000000060716170012345600000123456123567890124567'

Anyhow, let me know your thoughts on these enhancements and if its something that you would consider adding to the system as options.. as I said, I would like to help with this if I can.. If you give me some pointers I can have a go at coding it!

juks commented 7 years ago

Hi Anthony!

The static header option is controlled with --useStaticHeader option, e.g. --useStaticHeader=ISO001000017.

As for the bitmap, right now you can do your own 8583 fields syntax configuration, as there probably (or I would say definitely) will be other system specific format differences.

There is an example how it is done that you can find at the fork ,made by guys from Mexico: https://github.com/lentiummmx/SocketQueue/blob/master/lib/iso8583/lib/packager/originalProsaCH.js

'1': { length: 32, name: 'Bitmap', type: 'ban' },

This is quite common issue, so I will think of some proper and clear implementation for this option, like --overrideFormat. This will take some time.

juks commented 7 years ago

Seems to be done. Please pull the same branch.

Now there are overrides configuration option and "fixed-b-hex" type that represents the binary mask the way you have mentioned.

So you may do like this: --overrides=1:fixed-b-hex without the need to do your own format specification. This will tell the service to use fixed-b-hex format for the field 1 (binary mask).

juks commented 7 years ago

Merged into master