juks / iso-8583-socket-queue

ISO 8583 gateway
MIT License
195 stars 111 forks source link

Incorrect Bitmap (Field 1) when using HTTP JSON Service #14

Closed shoaibjdev closed 7 years ago

shoaibjdev commented 7 years ago

Hi,

When trying to use HTTP JSON service (curl) to post to SocketQueue bitmap is being set as 8 bit hex always causing issue in decomposition of the message at upstream server.

Although I have fields after 64 HTTP JSON is not appending secondary bitmap. Even if i try to send Primary + Secondary bitmap in the JSON request at the field 1 it's still not picking the same for formulating ISO message.

juks commented 7 years ago

Hi!

Could you please provide your case in the same form as used in project manual:

curl -H "Content-Type: application/json" -X POST -d '{ "0": "800", "3": "0", "7": "0607161700", "11":   "123456", "24": "0", "41": "00123456", "42": "123567890124567" }' http://localhost:8080
shoaibjdev commented 7 years ago

curl -H "Content-Type: application/json" -X POST -d '{ "0":"1200", "2":"254789364018", "3":"210000", "4":"700000", "7":"0801082622", "11":"000651", "12":"082622", "13":"801", "30":"D00000000", "32":"0", "41":"NOT DEFI", "43":"BANK TO ZAP", "48":"LIMITED MOCARAN", "49":404, "102":"254786981556", "103":"254789364018" }' http://localhost:9090

=================================================================== Message Type Indicator [0].......................1200 Bitmap [1].......................................7238000500a18000 Primary Account Number [2].......................254790999957 Processing Code [3]..............................210000 Amount, Transaction [4]..........................700000 Transmission Date and Time (MMDDhhmmss) [7]......0801082622 System Trace Audit Number [11]...................000651 Time, Local Transaction (hhmmss) [12]............082622 Date, Local Transaction (MMDD) [13]..............801 Commission [30]..................................D00000000 Acquiring Institution Ident Code [32]............0 Card Acceptor Terminal Identification [41].......NOT DEFI Card acceptor name/location [43].................BANK TO BANK Additional Data [48].............................TEST AUD Currency code, transaction [49]..................404 Account identification 1 [102]...................254790999957 Account identification 2 [103]...................254790999957

===================================================================

juks commented 7 years ago

Need some time

shoaibjdev commented 7 years ago

Thank you for responding Igor. No hurry, take your time.

juks commented 7 years ago

Working in a rush. Might be some misunderstanding, sorry. Do you need to change the bitmap format into character representation? If so, there is a overrides option:

--overrides=1:fixed-b-hex:8

Where 1 stands for field number, fixed-b-hex is the packager name and 8 is length.

Also, you can use the --dangerous parameter to dump the actual message sent to the upstream. Then you can tweak it using a hex editor and tell the difference.

shoaibjdev commented 7 years ago

Hi again, Actually, I don't want to tweek the request as it's working perfectly fine if I post through ISO8583 channel. I'm trying to use HTTP Json channel and the same request is failing and when i look at the dump I realize in case of HTTP Json, bitmap is not getting generated correctly. Secondary Bitmap is missing resulting in error.

If you look at the Bitmap from above it's 7238000500a18000, which doesn't have secondary bitmap indicator and bitmap itself. It's just producing Primary bitmap which is creating the issue.

juks commented 7 years ago

Got it. Yes, secondary bitmap is not supported right now as it was not considered by the configuration communication i started with.

By the way, just to refresh, what is the sign for the second bitmap to present within the message?

ashish-kakkar commented 7 years ago

Primary bit map first bit should be set to indicate presence of secondary bitmap. In the sample provided by@shoaibjdev, the value should be f238000500a18000.

Please fix this as it will be really helpful. Thanks

juks commented 7 years ago

I will. Thanks!

juks commented 7 years ago

Done!