Here is another question.
My requirement for Track 2 (bit 35) is:
Z (Numeric + X 'D' (BCD, ½ byte representation of D [1101] as a field separator between Primary Account Number and Expiration Date), BCD — When an odd number of digits, pack right-most half byte to '0'. Size: Variable to 37, preceded by a one-byte, BCD length indicator
The default template definition has bit 35 as a 2 byte length Ascii field so I am sure that is not it. I changed it to BcdVar(1, 37, Formatters.Bcd).
Taking a dummy track2 example of:
12345678901234567=9999999999999999999
I replace the '=' separator with the 0x0D integer value which translates to "13" (1101). We now have:
12345678901234567139999999999999999999
Does this make sense? I don't think this is the correct way of doing it.
You've run into a "feature" of OpenIso8583.Net. When you work with the field values using
msg[3] = "123456"
, you must always work with the unpacked values.For this track2 data, you need to build up the track 2 as
12345678901234567D9999999999999999999
. Note the 'D' in the middle of the data as a separator.Now in your
Template
set field 35 to have a BCD formatter, essentially.