juks / iso-8583-socket-queue

ISO 8583 gateway
MIT License
194 stars 111 forks source link

Iso8583 packet is expired. Won't queue! #75

Closed phannsokha closed 5 months ago

phannsokha commented 5 months ago

Dear, I try to curl -H "Content-Type: application/json" -X POST -d '{ "0": "0200", "3": "0", "4": 1000, "7": "0818160933", "11": 618160, "12": "150820130600", "22": "056", "24": "200", "25": "00", "35": "4850781234567891=19082012232800000037", "41": 992468, "42": 124642124643, "49": "810", "55": "9f2608571f1e10d4fa4aac9f2701809f100706010a03a4b8029f37045bb074729f3602000c950500800010009a031508189c01009f02060000000010005f2a02064382023c009f1a0206439f03060000000000009f3303e0f0c89f34034403029f3501229f1e0835313230323831358407a00000000310109f41030000565f340101" }' http://localhost:8080

I always got error below :

2024-01-22 10:56:28 - : Client http:::1:37760 event
2024-01-22 10:56:44 - : New HTTP socket
2024-01-22 10:56:44 - : Client http:::1:37764 connected
2024-01-22 10:56:44 - : Client http:::1:37764 sent data
2024-01-22 10:56:44 - : http:::1:37764: Warning! Iso8583 packet is expired. Won't queue!

 [Purchase Request <expired>]

 Message Type Indicator [0].......................0200
 Bitmap [1].......................................3230058020c08200
 Processing Code [3]..............................0
 Amount, Transaction [4]..........................1000
 Transmission Date and Time [7]...................0119120626
 System Trace Audit Number [11]...................999160
 Time, Local Transaction [12].....................150820130600
 Pos Entry Mode [22]..............................056 (Card Data Input Mode: <Integrated circuit card read; CVV data reliable>; Cardholder Auth Method: <Signature Based>)
 Function Code [24]...............................200
 Pos Condition Code [25]..........................00
 Track 2 Data [35]................................485078******7893=19082012232800000037
 Card Acceptor Terminal Identification [41].......00992468
 Merchant Id [42].................................000124642124643
 Currency code, transaction [49]..................840
 EMV Data [55]....................................9f2608571f1e10d4fa4aac9f2701809f100706010a03a4b8029f37045bb074729f3602000c950500800010009a031508189c01009f02060000000010005f2a02064382023c009f1a0206439f03060000000000009f3303e0f0c89f34034403029f3501229f1e0835313230323831358407a00000000310109f41030000565f340101

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


2024-01-22 10:56:44 - : Client http:::1:37764 event

Can we resovle that issue?

juks commented 5 months ago

Hi!

Yes we can. The reason is this curl command has an outdated value for field 7 (Transmission Date and Time).

The format is descibed here: https://github.com/juks/iso-8583-socket-queue/blob/master/lib/iso8583/lib/packager/smartVista.js#L323