iso-8583-socket-queue
iso-8583-socket-queue copied to clipboard
subfield data element management
Hi Igor, It's possible to manage subfields as tag for some data element? For exemple, field 55 contain many subfields with specific length and format.
FLD | LENTGH | VALUE
FLD (055) : (101) : .
> TAG (82 ) ....: [3C00] .
> TAG (9F33) ....: [E0F8C8] .
> TAG (95 ) ....: [0080008000]
Kindly assist
Hi! What do you mean by "managing"? A callback function?
Hi, Something like way to define each subfields as you implemented for ISO fields fields before packing the iso message . Cause according to somes host specifications for VISA or others there as some subfields by each fields like fields 48, fields 55 etc...
Well, made an improvement.
Two new methods to mind:
- Before the whole packet is packed: https://github.com/juks/iso-8583-socket-queue/blob/0ceaa81efcce51536f41a1b4cf12702f21e3a345/lib/iso8583/lib/packager/smartVista.js#L440
- Before each field is packed: https://github.com/juks/iso-8583-socket-queue/blob/0ceaa81efcce51536f41a1b4cf12702f21e3a345/lib/iso8583/lib/packager/smartVista.js#L114
Hi igor. thanks for your feedback. I'm afraid to not understand your implementation. Kindly provide an use case for exploitation. I mean an example for field 55
You should do like so for the field definition:
'55': {
length: 255,
name: 'EMV Data',
type: 'll-bin-char',
alias: '',
beforePack: function(fieldValue) {
// Work with tags (TLV) values here
return fieldValue;
}
},
If your message has no field 55 and you want to add it explicitly, you may use the following code inbeforeBack method:
beforePack: function(data) {
data['55'] = Buffer.from('9f2608571f1e10d4fa4aac9f2701809f100706010a03a4b8029f37045bb074729f3602000c950500800010009a031508189c01009f02060000000010005f2a02064382023c009f1a0206439f03060000000000009f3303e0f0c89f34034403029f3501229f1e0835313230323831358407a00000000310109f41030000565f340101', 'hex');
return data;
}
Thank for your revert. Something like this i it correct?
'55': {
length: 255,
name: 'EMV Data',
type: 'll-bin-char',
alias: '',
beforePack: function(fieldValue) {
'9F26': {
length: 8,
name: 'Application cryptogram',
type: 'fixed-b',
alias: ''
}
return fieldValue;
}
},
Unfortunatelly, there is no tag layer abstraction inside the beforePack right now. So what you get there is entire field 55 value, that you need to break into parts and process on your own.
Ok i see So what do you mean by
// Work with tags (TLV) values here
Some example
I mean you have fieldValue variable there, representing the field 55 value. So to alter the EMV tags you need to implement it in this method.
@scalpovich you could implement this: https://www.npmjs.com/package/node-tlv
@cavebring thanks for the information. I will take a look quickly