rachmatg / iso8583py

Automatically exported from code.google.com/p/iso8583py
GNU General Public License v3.0
0 stars 0 forks source link

modified header between length and MTI #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There are acquirers out there who have modified the ISO8583 from the spec. 
(redefineBit works great), however, some acquirers also insert a header of 
their own design between the initial length indicator and the MTI.

For example, the original....

    [LL] [MTI] [bitmap1]...

where the vendor wants to see:

    [LL] [HEADER] [MTI] [bitmap1]...

Since I'm already overriding __init__() in order to redefine some of the BITs, 
I could also override this function... Wouldn't it be better to provide the 
header in a param as part of the init? or maybe as part of the getter/setter?

Original issue reported on code.google.com by rich...@flafreeit.com on 9 Aug 2011 at 2:16

GoogleCodeExporter commented 8 years ago
This is a generic ISO8583 library. 

So we cannot adapt to each vendor that "change" the spec.

To help users that have problems like that, we can generate the ISO8583 easy, 
and before send throw the socket the "official ISO8583" we get the ASCII 
package, add the header and the size, example:

HEADER = 'WHIT'

iso = ISO8583()
iso.setMTI('0800')
(...)

isoASCII = iso.getRawIso()

vendorIso = HEADER + isoASCII 

# Example: big-endian
netIso = struct.pack('!h',len(vendorIso)) 

netIso += vendorIso

# Now can send netIso to the vendor ...

Please refer PyDocPage's manual to understand getNetworkISO.

Original comment by igo...@gmail.com on 9 Aug 2011 at 5:17