0

I am using the mastercard interface specification to pack field 61 like so:

<isofieldpackager
    id="61"
    length="40"
    name="Point-of-Service (POS) Data"
    class="org.jpos.iso.IFB_LLBINARY"
    emitBitmap="false"
    packager="org.jpos.iso.packager.GenericSubFieldPackager">
    <isofield
        id="1"
        length="1"
        name="POS Terminal Attendance"
        class="org.jpos.iso.IF_CHAR"/>
    <isofield
        id="3"
        length="1"
        name="POS Terminal Location"
        class="org.jpos.iso.IF_CHAR"/>
    <isofield
        id="4"
        length="1"
        name="POS Cardholder Presence"
        class="org.jpos.iso.IF_CHAR"/>
    <isofield
        id="5"
        length="1"
        name="POS Card Presence"
        class="org.jpos.iso.IF_CHAR"/>
    <isofield
        id="6"
        length="1"
        name="POS Card Capture Capabilities"
        class="org.jpos.iso.IF_CHAR"/>
    <isofield
        id="7"
        length="1"
        name="POS Transaction Status"
        class="org.jpos.iso.IF_CHAR"/>
    <isofield
        id="8"
        length="1"
        name="POS Transaction Security"
        class="org.jpos.iso.IF_CHAR"/>
    <isofield
        id="10"
        length="1"
        name="Cardholder-Activated Terminal Level"
        class="org.jpos.iso.IF_CHAR"/>
    <isofield
        id="11"
        length="1"
        name="POS Card Data Terminal Input Capability Indicator"
        class="org.jpos.iso.IF_CHAR"/>
    <isofield
        id="12"
        length="2"
        name="POS Card Data Terminal Input Capability Indicator"
        class="org.jpos.iso.IF_CHAR"/>
    <isofield
        id="13"
        length="3"
        name="POS Country Code"
        class="org.jpos.iso.IF_CHAR"/>
</isofieldpackager>

And then I am calling the packager like so:

ISOMsg message = new ISOMsg();
message.set("61.1", "1");       //Unattended terminal
    message.set("61.3", "2");       //Off premises of card acceptor facility
    message.set("61.4", "5");       //Electronic order (home PC, Internet, mobile phone, PDA)
    message.set("61.5", "1");       //Card not present
    message.set("61.6", "0");       //Terminal/operator has no card capture capability
    message.set("61.7", "0");       //Normal request (original presentment)
    message.set("61.8", "0");       //No security concern
    message.set("61.10", "6");      //Authorized Level 6 CAT: Electronic commerce
    message.set("61.11", "6");      //Key entry only
    message.set("61.12", "00");
    message.set("61.13", "716");    //country code Zimbabwe

But then I am getting an excetion which looks like this:

    <log realm="channel/127.0.0.1:1234" at="2018-02-20T13:02:14.775" lifespan="31ms">
  <connect>
Exception in thread "main" org.jpos.iso.ISOException: error packing field 61 (org.jpos.iso.ISOException: java.lang.NullPointerException (java.lang.NullPointerException))
    at org.jpos.iso.ISOBasePackager.pack(ISOBasePackager.java:184)
    at org.jpos.iso.ISOMsg.pack(ISOMsg.java:456)
    at com.jpos.test.Test.main(Test.java:51)
Nested:org.jpos.iso.ISOException: java.lang.NullPointerException (java.lang.NullPointerException)
    at org.jpos.iso.packager.GenericSubFieldPackager.pack(GenericSubFieldPackager.java:167)
    at org.jpos.iso.ISOMsgFieldPackager.pack(ISOMsgFieldPackager.java:60)
    at org.jpos.iso.ISOBasePackager.pack(ISOBasePackager.java:175)
    at org.jpos.iso.ISOMsg.pack(ISOMsg.java:456)
    at com.jpos.test.Test.main(Test.java:51)
Nested:java.lang.NullPointerException
    at org.jpos.iso.packager.GenericSubFieldPackager.pack(GenericSubFieldPackager.java:136)
    at org.jpos.iso.ISOMsgFieldPackager.pack(ISOMsgFieldPackager.java:60)
    at org.jpos.iso.ISOBasePackager.pack(ISOBasePackager.java:175)
    at org.jpos.iso.ISOMsg.pack(ISOMsg.java:456)
    at com.jpos.test.Test.main(Test.java:51)
/home/terrence/.cache/netbeans/8.2/executor-snippets/run.xml:53: Java returned: 1
BUILD FAILED (total time: 1 second)

Can you please help me understand why I am getting this error, I have tried changing the data classes on the packager, and changing the generic sub-field packager to use the europay subfield packager and the respective data classes but i still get the same exeption

  • It seems you missed the 9th field in the subpackage definition. Can you add it? It doesn't matter if you don't use it, the packager expects all consecutive field definition present, you can use IF_NOP if you don't need it, but it's better if you set the one fo the specs. Let me tell you if that works for you. – Andrés Alcarraz Feb 20 '18 at 14:44
  • Thanks. I added the missing fields and also added a bitmap field 0. So between your suggestion and the bitmap field, there was the solution, Its working now! – Terrence Munyunguma Feb 24 '18 at 10:10

1 Answers1

0

This is a bitmap-less field. Problem could be lack of definition for field 2. Also, beware that this field is (I believe) IFB_LLLBINARY not IFB_LLBINARY.

apr
  • 1,288
  • 7
  • 8