How To Parse TLV Message ISO8583 (EMV data) Using JPOS 2.x

Usually if you work with smart card, you will need to find data of some EMV tags. Since EMV has TLV message type, we need to parse the message to get the actual data. Here is one method that you can use.

public void printData(ISOMsg isoMsg){
	//EMV data on DE55
	if (iSOMsg.hasField(55)) {
		TLVList tlvData = new TLVList();
		tlvData.unpack(iSOMsg.getBytes(55));
		for (TLVMsg tLVMsg : tlvData.getTags()) {
			System.out.println("EMVtag : " + Integer.toHexString(tLVMsg.getTag()));
			System.out.println("Value on String Type : " + ISOUtil.hexString(tLVMsg.getValue()));
		}
	}
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s