Packing subfields with multiple data items - TLV

298 views
Skip to first unread message

Emmanuel Mensah

unread,
Nov 5, 2020, 6:53:50 PM11/5/20
to jPOS Users
Dear jPOS Users,
Im having a hard time writing a custom isofieldpackager for this spec. Please I need assistancepicturemessage_lcs504ha.gjv.png

Alejandro Revilla

unread,
Nov 5, 2020, 6:57:26 PM11/5/20
to jPOS Users
You may want to take a look at org.jpos.tlv.TLVList as a starting point to write your own implementation.

Perhaps you can handle the field as an opaque field, and then instantiate a TLVList (or similar) from your higher level application.

Shin

unread,
Nov 5, 2020, 8:51:19 PM11/5/20
to jPOS Users

Maybe this can give you some idea for TLV. You may also get from this video https://youtu.be/rpAJ8VbtSaA

GenericTagSequence tagValueSequence = new GenericTagSequence();
tagValueSequence.add(new LiteralTagValue("92", "201"));
tagValueSequence.add(new LiteralTagValue("87", "Y"));
tagValueSequence.add(new LiteralTagValue("0012", "19960930000000"));
tagValueSequence.add(new LiteralTagValue("0165", "M"));


ISOMsg field48 = new ISOMsg(48);
tagValueSequence.writeTo(field48);
msg.set(field48);

Emmanuel Mensah

unread,
Nov 6, 2020, 1:36:25 AM11/6/20
to jPOS Users
Hi Nick, I got this exception Caused by: java.lang.ClassNotFoundException: org.jpos.tlv.packager.IFTA_LLLCHAR java.lang.ClassNotFoundException: org.jpos.tlv.packager.TaggedSequencePackager.

Here's what tryna achieve.

A0020100A019134D616E75656C205261756C204D6174616E6B69A0201632343842204E6F727468205061726B2C204D6F6E67750
TAG   LL  data
A002 01  00
A019 13  4D616E75656C205261756C204D6174616E6B69
A020 16  32343842204E6F727468205061726B2C204D6F6E67750

I want to unpack the above message in field 48.
  • Special tag in DE48 set by issuer to include the name and address requested and will be sent by IST to acquirer. Adding tags A019 for name, A020 for address. 
  • The format of A019 will be: 

tags A019 Name 

Length: Variable (up to 65) 

Format: b..65 (ans..65) 

  • The format of A020 will be: 

tags A020 Address 

Length: Variable (up to 200) 

Format: b..200 (ans..200) 

Regards

Shin

unread,
Nov 7, 2020, 8:47:13 AM11/7/20
to jPOS Users
Hi,

According the data you provided, maybe you can use TLVList .

TLVList tlvList = TLVList.TLVListBuilder.createInstance().fixedTagSize(2).build();
tlvList.unpack(ISOUtil.hex2byte(reqMsg.getString(48)));

TLVMsg A002 = tlvList.find(0xA002);
TLVMsg A019 = tlvList.find(0xA019);
TLVMsg A020 = tlvList.find(0xA020);

Reply all
Reply to author
Forward
0 new messages