gpt4 book ai didi

java - 使用 JPOS 的 PISO 8583 子字段

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:40:06 28 4
gpt4 key购买 nike

<isopackager>
........other iso fields....
........

<isofieldpackager
id="57"
length="999"
name="Terminal Line Encrypted Data"
class="org.jpos.iso.IFA_LLLCHAR"
packager="org.jpos.iso.packager.ISO87BPackager">
<isofield
id="0"
length="4"
name="TLE Header Indicator"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="1"
length="2"
name="HSS-E2EE Version"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="2"
length="3"
name="EFT Secure Acquirer ID"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="3"
length="8"
name="Line Encryption Terminal ID"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="4"
length="4"
name="Encryption Method"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="5"
length="10"
name="Line Encryption Key ID"
class="org.jpos.iso.IFB_LLBINARY"/>
<isofield
id="6"
length="2"
name="Protected-Text Length"
class="org.jpos.iso.IFB_LLBINARY"/>
<isofield
id="7"
length="8"
name="Reserved"
class="org.jpos.iso.IFB_LLBINARY"/>
<isofield
id="8"
length="999"
name="999"
class="org.jpos.iso.IFA_LLLBINARY"/>
</isofieldpackager>
</isopackager>

我使用jpos库设置DE57的复合字段/子字段如下:

GenericPackager packager = new GenericPackager("iso87binary.xml");
ISOMsg iso57 = new ISOMsg(57);
iso57.setPackager(packager);
ISOField iso57_0 = new ISOField(0, "HTLE");
ISOField iso57_1 = new ISOField(1, "04");
ISOField iso57_2 = new ISOField(2, "000");
ISOField iso57_3 = new ISOField(3, "M0220001");
ISOField iso57_4 = new ISOField(4, "2190");
ISOField iso57_5 = new ISOField(5, "0000010172D54C600102");
ISOField iso57_6 = new ISOField(6, "64");
ISOField iso57_7 = new ISOField(7, "00000000");
ISOField iso57_8 = new ISOField(8, "95CA5E94F182A9949A7C7BA202143C4E212087E626E5F5C1C63AD173F733D339");
iso57.set(iso57_0);
iso57.set(iso57_1);
iso57.set(iso57_2);
iso57.set(iso57_3);
iso57.set(iso57_4);
iso57.set(iso57_5);
iso57.set(iso57_6);
iso57.set(iso57_7);
iso57.set(iso57_8);
isoMsg.set(iso57);

当我将 DE57 打印为:

isoMsg.getString(57)

我得到空值。但是,当我将其打印为子字段时,我可以看到值(在循环中运行整个 iso 消息 @ i = 57):

                System.out.printf("Field (%s) = %s%n", i+".0", isoMsg.getString(i+".0"));
System.out.printf("Field (%s) = %s%n", i+".1", isoMsg.getString(i+".1"));
System.out.printf("Field (%s) = %s%n", i+".2", isoMsg.getString(i+".2"));
System.out.printf("Field (%s) = %s%n", i+".3", isoMsg.getString(i+".3"));
System.out.printf("Field (%s) = %s%n", i+".4", isoMsg.getString(i+".4"));
System.out.printf("Field (%s) = %s%n", i+".5", isoMsg.getString(i+".5"));
System.out.printf("Field (%s) = %s%n", i+".6", isoMsg.getString(i+".6"));
System.out.printf("Field (%s) = %s%n", i+".7", isoMsg.getString(i+".7"));
System.out.printf("Field (%s) = %s%n", i+".8", isoMsg.getString(i+".8"));

为什么我没有得到之前案例中的值。

最佳答案

您不必创建 iso57 内部消息,您可以:

ISOMsg m = new ISOMsg();
m.set("57.0", "HTLE");
m.set("57.1", "04");
m.set("57.2", "000");
...
...

然后你可以调用:

m.getString("57.0") to get the result "HTLE"
m.getString("57.1") to get "04"

等等。

关于java - 使用 JPOS 的 PISO 8583 子字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34737216/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com