Unpacking DE 48 - Mastercard IPM File

1,467 views
Skip to first unread message

Chris

unread,
Jun 8, 2009, 1:08:26 PM6/8/09
to jPOS Users
Trying to read the PDS Elements for DE 48 using the following
definition ......

<isofieldpackager
id="48"
length="999"
name="Additional data - private"
class="org.jpos.iso.IFA_LLLBINARY"
packager="org.jpos.iso.packager.ISO93APackager" >

<isofield id="0" length="4" name="READ PDS NUMBER 148"
class="org.jpos.iso.IFA_NUMERIC" />
<isofield id="1" length="999" name="FIELD 48 - PDS 148"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield id="2" length="4" name="READ PDS NUMBER 149"
class="org.jpos.iso.IFA_NUMERIC" />
<isofield id="3" length="999" name="FIELD 48 - PDS 149"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield id="4" length="4" name="READ PDS NUMBER 165"
class="org.jpos.iso.IFA_NUMERIC" />
<isofield id="5" length="999" name="FIELD 48 - PDS 165"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield id="6" length="4" name="READ PDS NUMBER 249"
class="org.jpos.iso.IFA_NUMERIC" />
<isofield id="7" length="999" name="FIELD 48 - PDS 249"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield id="8" length="4" name="READ PDS NUMBER 250"
class="org.jpos.iso.IFA_NUMERIC" />
<isofield id="9" length="999" name="FIELD 48 - PDS 250"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield id="10" length="4" name="READ PDS NUMBER 252"
class="org.jpos.iso.IFA_NUMERIC" />
<isofield id="11" length="999" name="FIELD 48 - PDS 252"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield id="12" length="4" name="READ PDS NUMBER 262"
class="org.jpos.iso.IFA_NUMERIC" />
<isofield id="13" length="999" name="FIELD 48 - PDS 262"
class="org.jpos.iso.IFA_LLLCHAR"/>

</isofieldpackager>

Gives the following result...

<isomsg id="48">
<field id="0" value="0148"/>
<field id="1" value="84028402"/>
<field id="2" value="0149"/>
<field id="3" value="840000"/>
<field id="4" value="0165"/>
<field id="5" value="M"/>
<field id="6" value="0249"/>
<field id="7" value="91777258"/>
<field id="8" value="0250"/>
<field id="9" value="00602310060707"/>
<field id="10" value="0252"/>
<field id="11" value="000182bf0000000021529736C:\XXXXXX\incoming
\RMW0091777258.TIF"/>
<field id="12" value="0262"/>
<field id="13" value="1"/>
</isomsg>

As you can see in the definition file i am first reading the first 4
bytes to get the PDS number... then read the data part ... for each
pds sub element. If i recieve more data elements in a different file
then the above wont work since it's a "static" solution..

How can i modify the isofieldpackager definition to work dynamically
without reading the pds number manually etc...? I am sure there is a
better way i'm not seeing.

Andy Orrock

unread,
Jun 8, 2009, 1:25:17 PM6/8/09
to jpos-...@googlegroups.com
Solution #1 is to Go Opaque on the field and handle the parsing it yourself
in a piece of code you write. We do that on some squirrely fields.

Solution #2 is come up with a derivative of the EuroSubFieldPackager. It
looks like yours, except its sub-element IDs are 2 bytes (PDS 01 - 99), not
four like yours (and you don't need a TCC placeholder).

Note classes used here are IFMC_LLCHAR:

<isofieldpackager
id="48"
length="999"
name="EUROPAY FIELD 48"
class="org.jpos.iso.IFA_LLLBINARY"
packager="org.jpos.iso.packager.EuroSubFieldPackager">
<isofield
id="0"
length="1"
name="PLACEHOLDER"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="1"
length="18"
name="Field 48 - PDS01"
class="org.jpos.iso.IFMC_LLCHAR"/>
<isofield
id="2"
length="4"
name="Field 48 - PDS02"
class="org.jpos.iso.IFMC_LLCHAR"/>
[snip]

Andy
Reply all
Reply to author
Forward
0 new messages