org.jpos.iso.ISOException: org.jpos.iso.IFA_LLNUM: Problem unpacking field 2

3,204 views
Skip to first unread message

Fandi Akhmad

unread,
Feb 14, 2016, 11:27:30 PM2/14/16
to jPOS Users
Hello, i have this rules for my JPOS.
I use JPOS ver. 1.9.8

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE isopackager SYSTEM "genericpackager.dtd">

<!-- ISO 8583:1993 (ASCII) field descriptions for GenericPackager -->

<isopackager>
 
<isofield
     
id="0"
     
length="4"
     
name="Message Type Indicator"
     
class="org.jpos.iso.IFA_NUMERIC"/>
 
<isofield
     
id="1"
     
length="64"
     
name="Bitmap"
     
class="org.jpos.iso.IFA_BITMAP"/>
 
<isofield
     
id="2"
     
length="16"
     
name="Primary Account number"
     
class="org.jpos.iso.IFA_LLNUM"/>
 
<isofield
     
id="3"
     
length="6"
     
name="Processing Code"
     
class="org.jpos.iso.IFA_NUMERIC"/>
 
<isofield
     
id="4"
     
length="12"
     
name="Amount, Transaction"
     
class="org.jpos.iso.IFA_NUMERIC"/>
 
<isofield
     
id="7"
     
length="10"
     
name="Date and time, transmission"
     
class="org.jpos.iso.IFA_NUMERIC"/>
 
<isofield
     
id="11"
     
length="6"
     
name="Systems trace audit number"
     
class="org.jpos.iso.IFA_NUMERIC"/>
 
<isofield
     
id="12"
     
length="6"
     
name="Date and time, Local transaction"
     
class="org.jpos.iso.IFA_NUMERIC"/>
 
<isofield
     
id="13"
     
length="4"
     
name="Date, Effective"
     
class="org.jpos.iso.IFA_NUMERIC"/>
 
<isofield
     
id="15"
     
length="4"
     
name="Date, Settlement"
     
class="org.jpos.iso.IFA_NUMERIC"/>
 
<isofield
     
id="18"
     
length="4"
     
name="Merchant type"
     
class="org.jpos.iso.IFA_NUMERIC"/>
 
<isofield
     
id="32"
     
length="4"
     
name="Acquirer institution identification code"
     
class="org.jpos.iso.IFA_LLNUM"/>
 
<isofield
     
id="37"
     
length="12"
     
name="Retrieval reference number"
     
class="org.jpos.iso.IFA_LLCHAR"/>
 
<isofield
     
id="39"
     
length="2"
     
name="Action code"
     
class="org.jpos.iso.IFA_NUMERIC"/>
 
<isofield
     
id="41"
     
length="15"
     
name="Card acceptor terminal identification"
     
class="org.jpos.iso.IFA_LLCHAR"/>
 
<isofield
     
id="48"
     
length="120"
     
name="Additional data - private"
     
class="org.jpos.iso.IFA_LLLCHAR"/>
 
<isofield
     
id="49"
     
length="3"
     
name="Currency code, Transaction"
     
class="org.jpos.iso.IFA_NUMERIC"/>
 
<isofield
     
id="63"
     
length="3"
     
name="Reserved for private use"
     
class="org.jpos.iso.IFA_LLNUM"/>
</isopackager>


When i try to unpack this message :

723A4001088180001623334444555566663800990000000000000725090909100001090909072507306011040001ab9999999999ab9999999999999016000008389999999936003110

Using this code :

ISOMsg msg = new ISOMsg();
       msg
.setMTI("0200");
        msg
.setPackager(packager);
        msg
.unpack(message.getBytes());
        formattedLogISOMsg
(msg);

I get this following Error :

Exception in thread "main" org.jpos.iso.ISOException: org.jpos.iso.IFA_LLNUM: Problem unpacking field 2 (org.jpos.iso.ISOException: Field length 33 too long. Max: 16) unpacking field=2, consumed=20
    at org
.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:266)
    at org
.jpos.iso.ISOMsg.unpack(ISOMsg.java:454)
    at
App.main(App.java:40)


How to fix that? What i miss?
Please help, thank you very much.

Alejandro Revilla

unread,
Feb 15, 2016, 7:19:46 AM2/15/16
to jPOS Users
A message starting with 723A doesn't seem like a valid ISO-8583 message. 

Please note you don't have to set the MTI on a message you are unpacking, the "0200" should be part of the message. Perhaps that 723A... is the bitmap and you just need to pre-pend the MTI (0200) to your message.



Fandi Akhmad

unread,
Feb 15, 2016, 9:30:54 AM2/15/16
to jPOS Users

Hmm i am not sure where is the correct ISO message format.
But i try again create pack and unpack using this code :


PackISOMessage,java

public class PackISOMessage {
   
public static void main(String[] args) {
       
PackISOMessage iso = new PackISOMessage();
       
try {
           
String message = iso.buildISOMessage();
           
System.out.printf("Message = %s", message);
       
} catch (Exception e) {
            e
.printStackTrace();
       
}
   
}

   
public String buildISOMessage() throws Exception {
       
try {
           
GenericPackager packager = new GenericPackager("packager/iso93ascii.xml");

           
ISOMsg isoMsg = new ISOMsg();
            isoMsg
.setPackager(packager);
            isoMsg
.setMTI("0200");
            isoMsg
.set(1, "723A400108818000");
            isoMsg
.set(2, "2333444455556666");
            isoMsg
.set(3, "380099");
            isoMsg
.set(4, ISOUtil.zeropad(350000, 12));
            isoMsg
.set(7, "0725090909");
            isoMsg
.set(11, "100001");
            isoMsg
.set(12, "090909");
            isoMsg
.set(13, "0725");
            isoMsg
.set(15, "0730");
            isoMsg
.set(18, "6011");
            isoMsg
.set(32, "0001");
            isoMsg
.set(37, "ab999999999999");
//            isoMsg.set(39, "00");
            isoMsg
.set(41, "ab999999999999999");
            isoMsg
.set(41, "ab999999999999999");
            isoMsg
.set(48, "83899999999");
            isoMsg
.set(49, "360");
            isoMsg
.set(63, "110");
            printISOMessage
(isoMsg);

           
byte[] result = isoMsg.pack();
           
return new String(result);
       
} catch (ISOException e) {
           
throw new Exception(e);
       
}
   
}

   
public void printISOMessage(ISOMsg isoMsg) {
       
try {
           
System.out.printf("MTI = %s%n", isoMsg.getMTI());
           
for (int i = 1; i <= isoMsg.getMaxField(); i++) {
               
if (isoMsg.hasField(i)) {
                   
System.out.printf("Field (%s) = %s%n", i, isoMsg.getString(i));
               
}
           
}
       
} catch (ISOException e) {
            e
.printStackTrace();
       
}
   
}
}

And the packed result is :
0200F23A400108818002162333444455556666380099000000350000072509090910000109090907250007306011040001ab999999999999ab9999999999999990118389999999936003110

I decide to unpack that message using this code :

UnpackISOMessage.java

public class UnpackISOMessage {
   
public static void main(String[] args) {
       
UnpackISOMessage iso = new UnpackISOMessage();
       
try {
           
ISOMsg isoMsg = iso.parseISOMessage();
            iso
.printISOMessage(isoMsg);
       
} catch (Exception e) {
            e
.printStackTrace();
       
}
   
}

   
public ISOMsg parseISOMessage() throws Exception {
       
String message = "0200F23A400108818002162333444455556666380099000000350000072509090910000109090907250007306011040001ab999999999999ab9999999999999990118389999999936003110";
       
System.out.printf("Message = %s%n", message);
       
try {
           
GenericPackager packager = new GenericPackager("packager/iso93ascii.xml");
           
ISOMsg isoMsg = new ISOMsg();
            isoMsg
.setPackager(packager);
            isoMsg
.unpack(message.getBytes());
           
return isoMsg;
       
} catch (ISOException e) {
           
throw new Exception(e);
       
}
   
}

   
public void printISOMessage(ISOMsg isoMsg) {
       
try {
           
System.out.printf("MTI = %s%n", isoMsg.getMTI());
           
for (int i = 1; i <= isoMsg.getMaxField(); i++) {
               
if (isoMsg.hasField(i)) {
                   
System.out.printf("Field (%s) = %s%n", i, isoMsg.getString(i));
               
}
           
}
       
} catch (ISOException e) {
            e
.printStackTrace();
       
}
   
}
}

I still get this following error :
java.lang.Exception: org.jpos.iso.ISOException: org.jpos.iso.IFA_LLNUM: Problem unpacking field 2 (org.jpos.iso.ISOException: Field length 66 too long. Max: 16) unpacking field=2, consumed=36
    at com
.fanjavaid.UnpackISOMessage.parseISOMessage(UnpackISOMessage.java:35)
    at com
.fanjavaid.UnpackISOMessage.main(UnpackISOMessage.java:18)
Caused by: org.jpos.iso.ISOException: org.jpos.iso.IFA_LLNUM: Problem unpacking field 2 (org.jpos.iso.ISOException: Field length 66 too long. Max: 16) unpacking field=2, consumed=36
    at org
.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:268)
    at org
.jpos.iso.ISOMsg.unpack(ISOMsg.java:454)
    at com
.fanjavaid.UnpackISOMessage.parseISOMessage(UnpackISOMessage.java:32)
   
... 1 more


What's wrong?

Mark Salter

unread,
Feb 15, 2016, 10:06:01 AM2/15/16
to jpos-...@googlegroups.com
On 15/02/16 14:30, Fandi Akhmad wrote:
>
> Hmm i am not sure where is the correct ISO message format.
> But i try again create pack and unpack using this code :
>

> ISOMsgisoMsg =newISOMsg();
> isoMsg.setPackager(packager);
> isoMsg.setMTI("0200");
> isoMsg.set(1,"723A400108818000");

Don't set/touch the bitmap - there is no need and I think it might be
breaking the bitmap handling because you don;t need to touch the bitmap
- jpos sorts that out for you.



> *And the packed result is :
> |
> 0200F23A400108818002162333444455556666380099000000350000072509090910000109090907250007306011040001ab999999999999ab9999999999999990118389999999936003110

Here you can see that the bitmap is only eight bytes (F23A400108818002 -
followed by your 'PAN'), but the first bit is on indicating that it
should be 16, this likely pushes the alignment out and breaks the
conversion.

> java.lang.Exception:org.jpos.iso.ISOException:org.jpos.iso.IFA_LLNUM:Problemunpacking
> field 2(org.jpos.iso.ISOException:Fieldlength 66too
> long.Max:16)unpacking field=2,consumed=36
> at
> com.fanjavaid.UnpackISOMessage.parseISOMessage(UnpackISOMessage.java:35)
> at com.fanjavaid.UnpackISOMessage.main(UnpackISOMessage.java:18)
> Causedby:org.jpos.iso.ISOException:org.jpos.iso.IFA_LLNUM:Problemunpacking
> field 2(org.jpos.iso.ISOException:Fieldlength 66too
> long.Max:16)unpacking field=2,consumed=36
> at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:268)
> at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:454)
> at
> com.fanjavaid.UnpackISOMessage.parseISOMessage(UnpackISOMessage.java:32)
> ...1more
>
This bitmap issue is confirmed by the length of the PAN being found as
'66' - but this is within the PAN at the end of where the bitmap should
really end.

Adding a Logger to Packager will confirm completely what data is going
where.


> What's wrong?

Try not setting the bitmap manually first; also add a Logger to the
Packager to see the data splitting out.

Search the mailing list for the bitmap handling - it is described
multiple times, but first please stop manually setting the bitmap - that
is bad :-)

--
Mark




Alejandro Revilla

unread,
Feb 15, 2016, 8:15:38 PM2/15/16
to jPOS Users
In addition to Mark's suggestion, please note that you have some errors in the field lengths you're building, in particular field 37 has a max value of 12 (you're trying to set 14 bytes), same goes for field 41, it's 8 bytes max.

If you correct those, you should see something like this:

"0200723A40010881800216233344445555666638009900000035000007250909091000010000000909090725000730601104000199999999999900      01183899999999360003110"

that of course unpacks cleanly.







--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage.  Please support jPOS, contact: sa...@jpos.org

Join us in IRC at http://webchat.freenode.net/?channels=jpos

You received this message because you are subscribed to the  "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/56C1E955.2030302%40talktalk.net.
For more options, visit https://groups.google.com/d/optout.

Fandi Akhmad

unread,
Feb 15, 2016, 11:25:05 PM2/15/16
to jPOS Users
Hello , thank you very much.
It's now working. :D

regards,


On Monday, February 15, 2016 at 11:27:30 AM UTC+7, Fandi Akhmad wrote:

eyajuda 13HEB8

unread,
Jul 26, 2018, 9:26:52 AM7/26/18
to jPOS Users
Hi Fadi,

Please am having the same error, right now, can you help with how you fix yours?
See error:  unable to unpack field2
 org.jpos.iso.IFA_LLNUM: Problem unpacking field 2 (org.jpos.iso.ISOException: Field length 61 too long. Max: 19) unpacking field=2, consumed=20
Any help will be appreciated.
eyajuda

chhil

unread,
Jul 26, 2018, 10:54:58 AM7/26/18
to jpos-...@googlegroups.com
Usually this error occurs becuse the user has not implemented the packager correctly.

  1. Make sure you have accounted for the header (length and any other) if any.
  2. Make sure your bitmap packager is set appropriately.
  3. Make sure you field 2 packager is correct.
The first 2 will cause the byte reading to get offset causing mayhem.

-chhil

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.

eyajuda 13HEB8

unread,
Jul 26, 2018, 11:28:28 AM7/26/18
to jpos-...@googlegroups.com
Chhil,
Am so grateful will follow up.
Regards



For more options, visit https://groups.google.com/d/optout.


--
Life is all about the decisions we take, so take the right ones..

dheeraj gupta

unread,
May 15, 2019, 3:23:09 PM5/15/19
to jPOS Users

Hello,I Am building ISO 8583 message with JPOS 2.1.2.
Below are the jpos rules.



<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE isopackager SYSTEM "genericpackager.dtd">
<isopackager>
    <isofield id="0" length="4" name="MESSAGE TYPE INDICATOR" class="org.jpos.iso.IFA_NUMERIC"/>
    <isofield id="1" length="16" name="BIT MAP" class="org.jpos.iso.IFA_BITMAP"/>
    <isofield id="2" length="19" name="SECRET ID" class="org.jpos.iso.IFA_LLNUM"/>
    <isofield id="3" length="6" name="PROCESSING CODE" class="org.jpos.iso.IFA_NUMERIC"/>
    <isofield id="4" length="12" name="AMOUNT, TRANSACTION" class="org.jpos.iso.IFA_NUMERIC"/>
    <isofield id="5" length="12" name="AMOUNT, SETTLEMENT" class="org.jpos.iso.IFA_NUMERIC"/>
    <isofield id="6" length="12" name="AMOUNT, CARDHOLDER BILLING" class="org.jpos.iso.IFA_NUMERIC"/>
    <isofield id="7" length="10" name="TRANSMISSION DATE AND TIME" class="org.jpos.iso.IFA_NUMERIC"/>
    <isofield id="8" length="8" name="AMOUNT, CARDHOLDER BILLING FEE" class="org.jpos.iso.IFA_NUMERIC"/>
    <isofield id="9" length="8" name="CONVERSION RATE, SETTLEMENT" class="org.jpos.iso.IFA_NUMERIC"/>
    <isofield id="10" length="8" name="CONVERSION RATE, CARDHOLDER BILLING" class="org.jpos.iso.IFA_NUMERIC"/>
    <isofield id="11" length="6" name="SYSTEM TRACE AUDIT NUMBER" class="org.jpos.iso.IFA_NUMERIC"/>
    <isofield id="12" length="6" name="TIME, LOCAL TRANSACTION" class="org.jpos.iso.IFA_NUMERIC"/>
   
</isopackager>


When i try to unpack this message :

010072300000000000001642896976489287520200000000000050000515155540123456155540

Using this code :

GenericPackager packager = new GenericPackager("src/main/resources/basic.xml");

        // Setting packager

        ISOMsg isoMsg = new ISOMsg();
        isoMsg.setPackager(packager);
        isoMsg.set(0, "0100");
        // Setting MTI
        // Setting processing code
        isoMsg.set(2, "4289697648928752");
        isoMsg.set(3, "020000");
        // Setting transaction amount
        isoMsg.set(4, "5000");
        // Setting transmission date and time
        isoMsg.set(7, new SimpleDateFormat("MMddHHmmss").format(new Date()));
        // Setting system trace audit number
        isoMsg.set(11, "123456");
        String time = ISODate.getTime(new Date());
        System.out.println("Time ::" + time);
        isoMsg.set(12,"155540");

I getting invalid length Error while validating it on online utility URL:: http://www.chileoffshore.com/en/iso8583/dump-iso-message
Error:
 Invalid length at position: 155540

dheeraj gupta

unread,
May 15, 2019, 3:23:20 PM5/15/19
to jPOS Users

ccav tech

unread,
May 16, 2019, 4:44:14 PM5/16/19
to jPOS Users
Please help us to resolve this issue.

chhil

unread,
May 20, 2019, 8:07:50 AM5/20/19
to jpos-...@googlegroups.com
Your packager and the one you use online are not aligned i.e. you have not defined the fields as expected by the online site.

You should go field by field and make sure you have defined them as expected by the online url you are trying with.


When I use the packager you have and unpack the message it works so there is no issue from a jpos perspective. This was packed using jpos so the pack and unpack work fine.

import java.io.IOException;
import java.net.MalformedURLException;

import org.jdom.JDOMException;
import org.jpos.iso.ISOException;
import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISOUtil;
import org.jpos.iso.packager.GenericPackager;
import org.jpos.util.Logger;
import org.jpos.util.SimpleLogListener;

public class Test {

    public static void main(String[] args) throws ISOException, MalformedURLException, JDOMException, IOException {

        GenericPackager packager = new GenericPackager("cfg\\packager.xml");
        Logger l = new Logger();
        l.addListener(new SimpleLogListener());
        packager.setLogger(l, "jsagfj");

        ISOMsg m = new ISOMsg();
        m.setPackager(packager);

        try {
            m.unpack("010072300000000000001642896976489287520200000000000050000515155540123456155540".getBytes(ISOUtil.CHARSET));
            m.dump(System.out, "");
        }
        catch (Exception e) {
            e.printStackTrace();
            m.dump(System.out, "");
        }

    }

}

Output
<log realm="jsagfj" at="2019-05-20T17:30:01.903" lifespan="32ms">
  <unpack>
    303130303732333030303030303030303030303031363432383936393736343839323837353230323030303030303030303030303530303030353135313535353430313233343536313535353430
    <bitmap>{2, 3, 4, 7, 11, 12}</bitmap>
    <unpack fld="2" packager="org.jpos.iso.IFA_LLNUM">
      <value>4289697648928752</value>
    </unpack>
    <unpack fld="3" packager="org.jpos.iso.IFA_NUMERIC">
      <value>020000</value>
    </unpack>
    <unpack fld="4" packager="org.jpos.iso.IFA_NUMERIC">
      <value>000000005000</value>
    </unpack>
    <unpack fld="7" packager="org.jpos.iso.IFA_NUMERIC">
      <value>0515155540</value>
    </unpack>
    <unpack fld="11" packager="org.jpos.iso.IFA_NUMERIC">
      <value>123456</value>
    </unpack>
    <unpack fld="12" packager="org.jpos.iso.IFA_NUMERIC">
      <value>155540</value>
    </unpack>
  </unpack>
</log>
<isomsg direction="none">
  <!-- org.jpos.iso.packager.GenericPackager[cfg\packager.xml] -->
  <field id="0" value="0100"/>
  <field id="2" value="4289697648928752"/>
  <field id="3" value="020000"/>
  <field id="4" value="000000005000"/>
  <field id="7" value="0515155540"/>
  <field id="11" value="123456"/>
  <field id="12" value="155540"/>
</isomsg>

-chhil

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.

ccav tech

unread,
May 22, 2019, 7:57:37 AM5/22/19
to jpos-...@googlegroups.com
Hi Chhil,

Thanks for the clarification,actually I am new to this JPOS world.

Now I am getting  below error while unpacking the binary ISO message.

A bitmap message (postilion.realtime.postbridge.Iso8583PB) could not be unpacked, because of an error while unpacking field number 2 (LLVAR  n    ..19) at offset 12. When the error occurred, the bitmap looked like this:

0100:


ISO 8583 (Binary Format) Message:


0000  30 31 30 30 F2 3C 44 81  08 E0 80 00 00 00 00 00  0100.<D.........
0010  00 00 00 22 31 36 34 32  38 39 36 39 37 36 34 38  ..."164289697648
0020  39 32 38 37 35 32 30 30  30 30 30 30 30 30 30 30  9287520000000000
0030  30 30 30 32 30 30 30 30  30 35 32 32 31 37 31 35  0002000005221715
0040  30 30 31 30 35 37 39 30  31 37 31 35 30 30 30 33  0010579017150003
0050  32 36 32 34 30 37 35 36  39 31 30 31 32 30 38 30  2624075691012080
0060  36 34 35 34 38 39 39 39  30 38 35 30 37 31 30 35  6454899908507105
0070  37 39 30 30 30 30 35 30  30 34 31 30 32 37 31 37  7900005004102717
0080  34 20 20 20 20 20 20 20  20 20 43 4F 4D 4D 45 52  4         COMMER
0090  43 49 41 4C 38 33 36 30  44 75 62 61 69 41 45 41  CIAL8360DubaiAEA
00a0  45 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  E              
00b0  20 20 37 38 34 30 31 35  31 30 30 30 33 30 31 30    78401510003010
00c0  34 30 30 30 30 30 30 30  30 30 30 31 31 00 40 00  4000000000011.@.
00d0  00 00 00 00 00 32 32 32                           .....222


I have used below code to pack the ISO Message.


GenericPackager packager = new GenericPackager("src/main/resources/basic.xml");
       

        ISOMsg isoMsg = new ISOMsg();
        isoMsg.setPackager(packager);
        isoMsg.set(0, "0100");

        isoMsg.set(2, "4289697648928752");
        isoMsg.set(4, "000000020000");
        isoMsg.set(3, "000000");


        isoMsg.set(7, new SimpleDateFormat("MMddHHmmss").format(new Date()));

        isoMsg.set(11, "105790");
        isoMsg.set(12, new SimpleDateFormat("HHmmss").format(new Date()));
        isoMsg.set(13, "0326");
        isoMsg.set(14, "2407");
        isoMsg.set(18, "5691");
        isoMsg.set(22, "012");
        isoMsg.set(25, "08");
        isoMsg.set(32, "454899");
        isoMsg.set(37, "908507105790");
        isoMsg.set(41, "00050041");
        isoMsg.set(42, "027174         ");
        isoMsg.set(43, "COMMERCIAL8360DubaiAEAE");
        isoMsg.set(49, "784");
        isoMsg.set(123,"100030104000000");
        isoMsg.set("127.010", "222");

        byte[] bIsoMsg = isoMsg.pack();
        System.out.println(ISOUtil.hexdump(bIsoMsg));


Below is the rules defined for my JPOS.


JPOS 2.1.2 Rules:



<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<!DOCTYPE isopackager PUBLIC
        "-//jPOS/jPOS Generic Packager DTD 1.0//EN"
        "http://jpos.org/dtd/generic-packager-1.0.dtd">


<isopackager>
  <isofield
      id="0"
      length="4"
      name="MESSAGE TYPE INDICATOR"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="1"
      length="16"
      name="BIT MAP"

      class="org.jpos.iso.IFB_BITMAP"/>


  <isofield
      id="2"
      length="19"

      name="PAN - PRIMARY ACCOUNT NUMBER"


      class="org.jpos.iso.IFA_LLNUM"/>
  <isofield
      id="3"
      length="6"
      name="PROCESSING CODE"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="4"
      length="12"
      name="AMOUNT, TRANSACTION"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield

      id="7"
      length="10"
      name="TRANSMISSION DATE AND TIME"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield

      id="11"
      length="6"
      name="SYSTEM TRACE AUDIT NUMBER"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="12"
      length="6"
      name="TIME, LOCAL TRANSACTION"
      class="org.jpos.iso.IFA_NUMERIC"/>

  <isofield
      id="13"
      length="4"

      name="DATE, LOCAL TRANSACTION"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="14"
      length="4"
      name="DATE, EXPIRATION"
      class="org.jpos.iso.IFA_NUMERIC"/>
 
  <isofield
      id="18"
      length="4"
      name="MERCHANTS TYPE"
      class="org.jpos.iso.IFA_NUMERIC"/>
 
  <isofield
      id="22"
      length="3"
      name="POINT OF SERVICE ENTRY MODE"
      class="org.jpos.iso.IFA_NUMERIC"/>
 
  <isofield
      id="25"
      length="2"
      name="POINT OF SERVICE CONDITION CODE"
      class="org.jpos.iso.IFA_NUMERIC"/>
 
  <isofield
      id="32"
      length="11"
      name="ACQUIRING INSTITUTION IDENT CODE"
      class="org.jpos.iso.IFA_LLNUM"/>
 
  <isofield
      id="37"
      length="12"
      name="RETRIEVAL REFERENCE NUMBER"
      class="org.jpos.iso.IF_CHAR"/>
 
  <isofield
      id="41"
      length="8"
      name="CARD ACCEPTOR TERMINAL IDENTIFICACION"
      class="org.jpos.iso.IF_CHAR"/>
  <isofield
      id="42"
      length="15"
      name="CARD ACCEPTOR IDENTIFICATION CODE"
      class="org.jpos.iso.IF_CHAR"/>
  <isofield
      id="43"
      length="40"
      name="CARD ACCEPTOR NAME/LOCATION"
      class="org.jpos.iso.IF_CHAR"/>


 
  <isofield
      id="49"
      length="3"

      name="CURRENCY CODE, TRANSACTION"
      class="org.jpos.iso.IFA_NUMERIC"/>
 
  <isofield
      id="123"
      length="999"
      name="RESERVED PRIVATE USE"
      class="org.jpos.iso.IFA_LLLCHAR"/>
 
  <isofieldpackager
      id="127"  
      length="999999"
      name="RESERVED PRIVATE USE"
      class="org.jpos.iso.IFA_LLLLLLBINARY"
      packager="org.jpos.iso.packager.GenericSubFieldPackager">
      <isofield
          id="0"
          length="0"
          name="PLACEHOLDER"
          class="org.jpos.iso.IF_CHAR"/>
      <isofield
          id="1"
          length="8"
          name="BITMAP"
          class="org.jpos.iso.IFB_BITMAP"/>
      <isofield
          id="2"
          length="32"
          name="SWITCH KEY"
          class="org.jpos.iso.IFA_LLCHAR"/>
      <isofield
          id="3"
          length="48"
          name="ROUTING INFORMATION"
          class="org.jpos.iso.IF_CHAR"/>
      <isofield
          id="4"
          length="22"
          name="POS DATA"
          class="org.jpos.iso.IF_CHAR"/>
      <isofield
          id="5"
          length="73"
          name="SERVICE STATION DATA"
          class="org.jpos.iso.IF_CHAR"/>
      <isofield
          id="6"
          length="2"
          name="AUTHORIZATION PROFILE"


          class="org.jpos.iso.IFA_NUMERIC"/>
      <isofield
          id="7"

          length="50"
          name="CHECK DATA"
          class="org.jpos.iso.IFA_LLCHAR"/>
      <isofield
          id="8"
          length="128"
          name="RETENTION DATA"
          class="org.jpos.iso.IFA_LLLCHAR"/>
      <isofield
          id="9"
          length="255"
          name="ADDITIONAL NODE DATA"
          class="org.jpos.iso.IFA_LLLCHAR"/>
      <isofield
          id="10"
          length="3"
          name="CVV2"
          class="org.jpos.iso.IFA_NUMERIC"/>
     
  </isofieldpackager>

  </isopackager>

It will be very helpful if you could help me out in the above issue,because I am not able to rectify the issue every thing looks correctly defined.

Please help. thanks. 



chhil

unread,
May 22, 2019, 2:51:57 PM5/22/19
to jpos-...@googlegroups.com
Use the postpack.xml that works with postilion. Use the postchannel or the nacchannel for the channel.
Search the group for postilion packager and that should help you solve your problem.

-chhil

ccav tech

unread,
Jun 19, 2019, 3:08:12 AM6/19/19
to jPOS Users
Hi Chhil,

30 31 31 30 f2 3e 44 95 0a e0 84 00 00 00 00 00

00 00 00 22 31 36 34 32 38 39 36 39 37 36 34 38

39 32 38 37 35 32 30 30 30 30 30 30 30 30 30 30

30 30 30 30 30 30 30 30 30 36 31 37 31 36 30 33

35 31 31 30 35 37 39 30 31 36 30 33 35 31 30 33

32 36 32 34 30 37 30 34 31 39 35 36 39 31 30 31

32 30 38 43 30 30 30 30 30 30 30 30 43 30 30 30

30 30 30 30 30 30 36 34 35 34 38 39 39 39 30 38

35 30 37 31 30 35 37 39 30 39 34 30 30 30 35 30

30 34 31 30 32 37 31 37 34 20 20 20 20 20 20 20

20 20 43 4f 4d 4d 45 52 43 49 41 4c 38 33 36 30

44 75 62 61 69 41 45 41 45 20 20 20 20 20 20 20

20 20 20 20 20 20 20 20 20 20 37 38 34 30 32 30

30 30 35 33 37 38 34 43 30 30 30 30 30 30 30 30

30 30 30 30 30 31 35 31 30 30 30 33 30 31 30 34

30 30 30 30 30 30 30 30 30 30 36 38 24 00 10 00

02 00 00 00 41 44 59 45 4e 53 52 43 20 20 20 20

4d 42 43 53 4e 4b 20 20 20 20 20 20 31 30 35 37

39 30 31 30 35 37 39 30 4d 42 43 52 55 41 45 54

47 20 20 20 33 30 32 30 31 39 30 36 31 37 39 31


Is there any utility to parse the hex dump response??



chhil

unread,
Jun 19, 2019, 4:13:02 AM6/19/19
to jpos-...@googlegroups.com
Your ISOMsg.unpack(..) takes a byte array.
Take the hex, remove the spaces and use ISOUtil.hex2byte(String...) to get a byte array and pass it into your ISOMsg's unpack method.


-chhil

ccav tech

unread,
Jun 19, 2019, 4:52:12 AM6/19/19
to jPOS Users
thanks chhil its working now.

One thing I am still confused of ,while creating hexdump message I am getting some  additional information so how can I get the exact hexdump of the ISO message.

Below is the generated hexdump message :

0000  30 31 31 30 F2 3E 44 95  0A E0 84 00 00 00 00 00  0110.>D.........

0010  00 00 00 22 31 36 34 32  38 39 36 39 37 36 34 38  ..."164289697648
0020  39 32 38 37 35 32 30 30  30 30 30 30 30 30 30 30  9287520000000000
0030  30 30 30 30 30 30 30 30  30 36 31 37 31 36 30 33  0000000006171603
0040  35 31 31 30 35 37 39 30  31 36 30 33 35 31 30 33  5110579016035103
0050  32 36 32 34 30 37 30 34  31 39 35 36 39 31 30 31  2624070419569101
0060  32 30 38 43 30 30 30 30  30 30 30 30 43 30 30 30  208C00000000C000
0070  30 30 30 30 30 30 36 34  35 34 38 39 39 39 30 38  0000006454899908
0080  35 30 37 31 30 35 37 39  30 39 34 30 30 30 35 30  5071057909400050
0090  30 34 31 30 32 37 31 37  34 20 20 20 20 20 20 20  041027174      
00a0  20 20 43 4F 4D 4D 45 52  43 49 41 4C 38 33 36 30    COMMERCIAL8360
00b0  44 75 62 61 69 41 45 41  45 20 20 20 20 20 20 20  DubaiAEAE      
00c0  20 20 20 20 20 20 20 20  20 20 37 38 34 30 32 30            784020
00d0  30 30 35 33 37 38 34 43  30 30 30 30 30 30 30 30  0053784C00000000
00e0  30 30 30 30 30 31 35 31  30 30 30 33 30 31 30 34  0000015100030104
00f0  30 30 30 30 30 30 30 30  30 30 32 38 30 30 30 30  0000000000280000
0100  30 30 30 30 30 34 30 30  30 30 30 30 31 30 35 37  0000040000001057
0110  39 30 31 30 35 37 39 30                           90105790

I want the below output:

30 31 31 30 F2 3E 44 95  0A E0 84 00 00 00 00 00
00 00 00 22 31 36 34 32  38 39 36 39 37 36 34 38
 39 32 38 37 35 32 30 30  30 30 30 30 30 30 30 30
30 30 30 30 30 30 30 30  30 36 31 37 31 36 30 33
35 31 31 30 35 37 39 30  31 36 30 33 35 31 30 33
32 36 32 34 30 37 30 34  31 39 35 36 39 31 30 31
32 30 38 43 30 30 30 30  30 30 30 30 43 30 30 30
 30 30 30 30 30 30 36 34  35 34 38 39 39 39 30 38
35 30 37 31 30 35 37 39  30 39 34 30 30 30 35 30
30 34 31 30 32 37 31 37  34 20 20 20 20 20 20 20
 20 20 43 4F 4D 4D 45 52  43 49 41 4C 38 33 36 30
44 75 62 61 69 41 45 41  45 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20  20 20 37 38 34 30 32 30
30 30 35 33 37 38 34 43  30 30 30 30 30 30 30 30
30 30 30 30 30 31 35 31  30 30 30 33 30 31 30 34
30 30 30 30 30 30 30 30  30 30 32 38 30 30 30 30
30 30 30 30 30 34 30 30  30 30 30 30 31 30 35 37
39 30 31 30 35 37 39 30

Please Help.



chhil

unread,
Jun 19, 2019, 6:05:28 AM6/19/19
to jpos-...@googlegroups.com
Write your own hexdump method that removes the standard very helpful byte offset column in the left and the helpful displayable data on the right. 

Or write a method that can parse the jpos hexdump to your liking to extract data. 

-chhil


Victor Salaman

unread,
Jun 19, 2019, 6:13:31 AM6/19/19
to 'Ruchira Biyani' via jPOS Users

For the lazy in you, here’s a gift:


    
public static void main(String[] args)

    {
        String s="0000  30 31 31 30 F2 3E 44 95  0A E0 84 00 00 00 00 00  0110.>D.........\n" +
                 "0010  00 00 00 22 31 36 34 32  38 39 36 39 37 36 34 38  ...\"164289697648\n" +
                 "0020  39 32 38 37 35 32 30 30  30 30 30 30 30 30 30 30  9287520000000000\n" +
                 "0030  30 30 30 30 30 30 30 30  30 36 31 37 31 36 30 33  0000000006171603\n" +
                 "0040  35 31 31 30 35 37 39 30  31 36 30 33 35 31 30 33  5110579016035103\n" +
                 "0050  32 36 32 34 30 37 30 34  31 39 35 36 39 31 30 31  2624070419569101\n" +
                 "0060  32 30 38 43 30 30 30 30  30 30 30 30 43 30 30 30  208C00000000C000\n" +
                 "0070  30 30 30 30 30 30 36 34  35 34 38 39 39 39 30 38  0000006454899908\n" +
                 "0080  35 30 37 31 30 35 37 39  30 39 34 30 30 30 35 30  5071057909400050\n" +
                 "0090  30 34 31 30 32 37 31 37  34 20 20 20 20 20 20 20  041027174      \n" +
                 "00a0  20 20 43 4F 4D 4D 45 52  43 49 41 4C 38 33 36 30    COMMERCIAL8360\n" +
                 "00b0  44 75 62 61 69 41 45 41  45 20 20 20 20 20 20 20  DubaiAEAE      \n" +
                 "00c0  20 20 20 20 20 20 20 20  20 20 37 38 34 30 32 30            784020\n" +
                 "00d0  30 30 35 33 37 38 34 43  30 30 30 30 30 30 30 30  0053784C00000000\n" +
                 "00e0  30 30 30 30 30 31 35 31  30 30 30 33 30 31 30 34  0000015100030104\n" +
                 "00f0  30 30 30 30 30 30 30 30  30 30 32 38 30 30 30 30  0000000000280000\n" +
                 "0100  30 30 30 30 30 34 30 30  30 30 30 30 31 30 35 37  0000040000001057\n" +
                 "0110  39 30 31 30 35 37 39 30                           90105790";

        byte[] bytes = decodeHexDump(s);
        System.out.println("bytes = " + bytes.length);
    }

    public static byte[] decodeHexDump(String s)
    {
        StringBuffer sb=new StringBuffer();
        Arrays.stream(s.split("\n"))
            .forEach(x->{
                x=x.replaceAll("^.{4}  ", "");
                x=x.replaceAll("\\s\\s", " ");
                x=x.replaceAll("(([0-9A-F][0-9A-F]\\s){1,16}).*$","$1");
                x=x.replaceAll("\\s","");
                sb.append(x);
            });
        return ISOUtil.hex2byte(sb.toString());
    }

chhil

unread,
Jun 19, 2019, 6:38:31 AM6/19/19
to jpos-...@googlegroups.com
Victor,

But mine has a \r\n what to do? :D

-chhil

Victor Salaman

unread,
Jun 19, 2019, 6:40:18 AM6/19/19
to 'Ruchira Biyani' via jPOS Users

Alejandro Revilla

unread,
Jun 19, 2019, 6:16:00 PM6/19/19
to jPOS Users
Lovely decodeHexDump, I'll file a PR to use StringBuilder.

Jokes aside, can I trade a jPOS Sticker for that method to be added to ISOUtil? 

jPOS-Sticker.png


Andrés Alcarraz

unread,
Jun 19, 2019, 8:43:09 PM6/19/19
to jpos-...@googlegroups.com

no need for StringBUilder if using Collectors.joining()

public static byte[] decodeHexDump(String s)
{
    return ISOUtil.hex2byte(
            Arrays.stream(s.split("\n"))
                    .map(x->
                            x.replaceAll("^.{4}  ", "")
                                    .replaceAll("\\s\\s", " ")
                                    .replaceAll("(([0-9A-F][0-9A-F]\\s){1,16}).*$","$1")
                                    .replaceAll("\\s","")
                    ).collect(Collectors.joining())

    );
}

Lambda duel.

Andrés Alcarraz
Transactility, Inc.

Alejandro Revilla

unread,
Jun 19, 2019, 9:38:38 PM6/19/19
to jPOS Users
Awesome, we just need to use `System.getProperty ("line.separator");` instead of `\n` or figure out how to handle both and we'd be all set.


Victor Salaman

unread,
Jun 19, 2019, 10:20:38 PM6/19/19
to 'Ruchira Biyani' via jPOS Users
Now I feel ashamed for not polishing the little method I whipped in 3 minutes :(

/V


--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.

Victor Salaman

unread,
Jun 19, 2019, 11:07:28 PM6/19/19
to 'Ruchira Biyani' via jPOS Users

Revised method:

    public static byte[] decodeHexDump(String s)
    {
        return
 ISOUtil.hex2byte(
            Arrays.stream(s.split("\\r\\n|[\\r\\n]"))
                .map(x ->
                         x.replaceAll("^.{4}  ", "").
                             replaceAll("\\s\\s", " ").
                             replaceAll("(([0-9A-F][0-9A-F]\\s){1,16}).*$", "$1").
                             replaceAll("\\s", "")
                ).collect(Collectors.joining()));
    }

On Wed, Jun 19, 2019 at 9:38 PM Alejandro Revilla <a...@jpos.org> wrote:
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.

ccav tech

unread,
Jun 20, 2019, 2:57:03 AM6/20/19
to jPOS Users
Hello Jpos Team,

While unpacking the response by using "isoMsg.unpack(connection.getInputStream());" I am getting below exception

Exception in thread "main" org.jpos.iso.ISOException: field packager '8' is null
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:410)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:474)
at com.isov2.TestISO.App.sendISOMsg(App.java:129)
at com.isov2.TestISO.App.main(App.java:101)

Below are the JPOS rules:

          <isofield id="9" length="8" name="CONVERSION RATE, SETTLEMENT" class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="11"
      length="6"
      name="SYSTEM TRACE AUDIT NUMBER"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="12"
      length="6"
      name="TIME, LOCAL TRANSACTION"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="13"
      length="4"
      name="DATE, LOCAL TRANSACTION"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="14"
      length="4"
      name="DATE, EXPIRATION"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield id="15" length="4" name="DATE, SETTLEMENT" class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield

      id="18"
      length="4"
      name="MERCHANTS TYPE"
      class="org.jpos.iso.IFA_NUMERIC"/>
 
  <isofield
      id="22"
      length="3"
      name="POINT OF SERVICE ENTRY MODE"
      class="org.jpos.iso.IFA_NUMERIC"/>
 
  <isofield
      id="25"
      length="2"
      name="POINT OF SERVICE CONDITION CODE"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield id="28" length="9" name="AMOUNT, TRANSACTION FEE" class="org.jpos.iso.IFA_AMOUNT"/>
  <isofield id="30" length="9" name="AMOUNT, TRANSACTION PROCESSING FEE" class="org.jpos.iso.IFA_AMOUNT"/>

  <isofield
      id="32"
      length="11"
      name="ACQUIRING INSTITUTION IDENT CODE"
      class="org.jpos.iso.IFA_LLNUM"/>
 
  <isofield
      id="37"
      length="12"
      name="RETRIEVAL REFERENCE NUMBER"
      class="org.jpos.iso.IF_CHAR"/>
  <isofield id="39" length="2" name="RESPONSE CODE" class="org.jpos.iso.IF_CHAR"/>

  <isofield
      id="41"
      length="8"
      name="CARD ACCEPTOR TERMINAL IDENTIFICACION"
      class="org.jpos.iso.IF_CHAR"/>
     
  <isofield
      id="42"
      length="15"
      name="CARD ACCEPTOR IDENTIFICATION CODE"
      class="org.jpos.iso.IF_CHAR"/>
  <isofield
      id="43"
      length="40"
      name="CARD ACCEPTOR NAME/LOCATION"
      class="org.jpos.iso.IF_CHAR"/>
 
  <isofield
      id="49"
      length="3"
      name="CURRENCY CODE, TRANSACTION"
      class="org.jpos.iso.IFA_NUMERIC"/>
   <isofield id="54" length="120" name="ADDITIONAL AMOUNTS" class="org.jpos.iso.IFA_LLLCHAR"/>
  <isofield

      id="123"
      length="999"
      name="RESERVED PRIVATE USE"
      class="org.jpos.iso.IFA_LLLCHAR"/>
 
  <isofieldpackager
      id="127"  
      length="999999"
      name="RESERVED PRIVATE USE"
      class="org.jpos.iso.IFA_LLLLLLBINARY"
      packager="org.jpos.iso.packager.GenericSubFieldPackager">
     <isofield
    id="0"
    length="0"
    name="Placeholder"
    class="org.jpos.iso.IF_NOP" />

<isofield
    id="1"
    length="16"
    name="Bit Map"
    class="org.jpos.iso.IFA_BITMAP" />
     <isofield
          id="38"
          length="99"
          name="Additional POS Data Code"
          class="org.jpos.iso.IFA_LLCHAR"/>    
     
  </isofieldpackager>

  </isopackager>

Please help😊

ccav tech

unread,
Jun 20, 2019, 5:35:18 AM6/20/19
to jPOS Users
we rectified the issue plz ignore the same.😊

Alejandro Revilla

unread,
Jun 20, 2019, 12:04:28 PM6/20/19
to jPOS Users
Can we add it to ISOUtil?

(I promise I'd keep those weird braces of yours)



Alejandro Revilla

unread,
Jun 20, 2019, 12:49:14 PM6/20/19
to jPOS Users
Just merged the PR - great! - good reason to use the latest and greatest 2.1.4-SNAPSHOT



ccav tech

unread,
Jul 3, 2019, 6:55:17 AM7/3/19
to jPOS Users
Hi Chhil,

I am having some issue while unpacking the ISO message response.

Below is the exception which I am getting.

Exception in thread "main" org.jpos.iso.ISOException: org.jpos.iso.IFA_LLNUM: Problem unpacking field 2 (java.lang.NegativeArraySizeException) unpacking field=2, consumed=20
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:340)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:468)
at com.isov2.TestISO.TestRespnse.main(TestRespnse.java:89)

Below are the JPos rules defined for my project;

      <isofield id="8" length="8" name="AMOUNT, CARDHOLDER BILLING FEE" class="org.jpos.iso.IFA_NUMERIC"/>
          <isofield id="9" length="8" name="CONVERSION RATE, SETTLEMENT" class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="11"
      length="6"
      name="SYSTEM TRACE AUDIT NUMBER"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="12"
      length="6"
      name="TIME, LOCAL TRANSACTION"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="13"
      length="4"
      name="DATE, LOCAL TRANSACTION"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="14"
      length="4"
      name="DATE, EXPIRATION"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield id="15" length="4" name="DATE, SETTLEMENT" class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield id="17" length="4" name="DATE, CAPTURE" class="org.jpos.iso.IFA_NUMERIC"/>

  <isofield
      id="18"
      length="4"
      name="MERCHANTS TYPE"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield id="19" length="3" name="ACQUIRING INSTITUTION COUNTRY CODE" class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield id="20" length="3" name="PAN EXTENDED COUNTRY CODE" class="org.jpos.iso.IFA_NUMERIC"/>
 
  <isofield id="21" length="3" name="FORWARDING INSTITUTION COUNTRY CODE" class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield

      id="22"
      length="3"
      name="POINT OF SERVICE ENTRY MODE"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield id="23" length="3" name="CARD SEQUENCE NUMBER" class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield id="24" length="3" name="NETWORK INTERNATIONAL IDENTIFIEER" class="org.jpos.iso.IFA_NUMERIC"/>

  <isofield
      id="25"
      length="2"
      name="POINT OF SERVICE CONDITION CODE"
      class="org.jpos.iso.IFA_NUMERIC"/>
      <isofield id="27" length="1" name="AUTHORIZATION IDENTIFICATION RESP LEN" class="org.jpos.iso.IFA_NUMERIC"/>

  <isofield id="28" length="9" name="AMOUNT, TRANSACTION FEE" class="org.jpos.iso.IFA_AMOUNT"/>
  <isofield id="29" length="9" name="AMOUNT, SETTLEMENT FEE" class="org.jpos.iso.IFA_AMOUNT"/>

  <isofield id="30" length="9" name="AMOUNT, TRANSACTION PROCESSING FEE" class="org.jpos.iso.IFA_AMOUNT"/>
   <isofield id="31" length="9" name="AMOUNT, SETTLEMENT PROCESSING FEE" class="org.jpos.iso.IFA_AMOUNT"/>

  <isofield
      id="32"
      length="11"
      name="ACQUIRING INSTITUTION IDENT CODE"
      class="org.jpos.iso.IFA_LLNUM"/>
  <isofield id="33" length="11" name="FORWARDING INSTITUTION IDENT CODE" class="org.jpos.iso.IFA_LLNUM"/>
  <isofield id="34" length="28" name="PAN EXTENDED" class="org.jpos.iso.IFA_LLCHAR"/>
  <isofield id="35" length="37" name="TRACK 2 DATA" class="org.jpos.iso.IFA_LLNUM"/>
  <isofield id="36" length="104" name="TRACK 3 DATA" class="org.jpos.iso.IFA_LLLCHAR"/>
  <isofield

      id="37"
      length="12"
      name="RETRIEVAL REFERENCE NUMBER"
      class="org.jpos.iso.IF_CHAR"/>
      <isofield id="38" length="6" name="AUTHORIZATION IDENTIFICATION RESPONSE" class="org.jpos.iso.IF_CHAR"/>
  <isofield id="39" length="2" name="RESPONSE CODE" class="org.jpos.iso.IF_CHAR"/>

  <isofield
      id="41"
      length="8"
      name="CARD ACCEPTOR TERMINAL IDENTIFICACION"
      class="org.jpos.iso.IF_CHAR"/>
     
  <isofield
      id="42"
      length="15"
      name="CARD ACCEPTOR IDENTIFICATION CODE"
      class="org.jpos.iso.IF_CHAR"/>
  <isofield
      id="43"
      length="40"
      name="CARD ACCEPTOR NAME/LOCATION"
      class="org.jpos.iso.IF_CHAR"/>
   <isofield id="44" length="25" name="ADITIONAL RESPONSE DATA" class="org.jpos.iso.IFA_LLCHAR"/>
  <isofield

      id="49"
      length="3"
      name="CURRENCY CODE, TRANSACTION"
      class="org.jpos.iso.IFA_NUMERIC"/>
   <isofield id="54" length="120" name="ADDITIONAL AMOUNTS" class="org.jpos.iso.IFA_LLLCHAR"/>
  <isofield

      id="123"
      length="999"
      name="RESERVED PRIVATE USE"
      class="org.jpos.iso.IFA_LLLCHAR"/>
 
  <isofieldpackager
      id="127"  
      length="999999"
      name="RESERVED PRIVATE USE"
      class="org.jpos.iso.IFA_LLLLLLBINARY"
      packager="org.jpos.iso.packager.GenericSubFieldPackager">
     <isofield
    id="0"
    length="0"
    name="Placeholder"
    class="org.jpos.iso.IF_NOP" />

<isofield
    id="1"
    length="16"
    name="Bit Map"
    class="org.jpos.iso.IFA_BITMAP" />
     <isofield

          id="38"
          length="99"
          name="Additional POS Data Code"
          class="org.jpos.iso.IFA_LLCHAR"/>    
     
  </isofieldpackager>

  </isopackager>

Java Code for unpacking the response:

String isoMsg="30313130EFBFBD3E44EFBFBD0AEFBFBDEFBFBD00000000000000002231363432383936393736343839323837353930303030303330303030303030303030303030373033313631333234313035373932313631333234303332313234303730343139353639313031323038433030303030303030433030303030303030303634353438393939303835303731303537393031343030303530303431303237313734202020202020202020434F4D4D45524349414C38333630447562616941454145202020202020202020202020202020202037383430323030303533373834433030303030303030303030303031353130303033303130343030303030303030303036372400100400000000414459454E535243202020204D4243534E4B2020202020203130353739323130353739324D42435255414554472020203131323031393037303320"
byte[] bytes = ISOUtil.hex2byte(isoMsg);
respMsg.unpack(bytes);

printISOMessage(respMsg);

public static void printISOMessage(ISOMsg isoMsg) {
try {
for (int i = 1; i <= isoMsg.getMaxField(); i++) {
if (isoMsg.hasField(i)) {
System.out.printf("Field (%s) = %s%n", i, isoMsg.getString(i));

}
}
}
}



chhil

unread,
Jul 3, 2019, 8:33:38 AM7/3/19
to jpos-...@googlegroups.com
Chhil saw this old thread and passed away. 

RIP thread. 
RIP Chhil. 

Reply all
Reply to author
Forward
0 new messages