EMV事务日志结果不期望

问题描述 投票:1回答:2

我阅读了交易记录,以计算终端风险管理中的底线限制。我成功读取了长度为10行的EMV卡事务日志,但是为什么用TLV解析器对其进行解析后却无法识别该结果的EMV-tags? >

EMV标签:TLV解析器无法识别4092?

1。日志格式

REQ LOG_FORMAT: 80CA9F4F00

RES LOG_FORMAT: 9F4F289F27019F26088A029F02069F03069F1A0295055F2A029A039C019F370482029F36029F10209F6B30 9000

LogFormat is success

2。日志输入

After select AID, I get log entry as follows 0B 0A

3。交易记录

REQ TRANS_LOG: 00B2015C00

RES TRANS_LOG: 4092AFED093EB371AC3030000030000000000000000000036080800480000360190519017B3B91CF7400000D01016100000000516D54FA000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 9000

//More transaction log in here

Transaction Log is success

交易记录代码:

private List<IApdu.IApduResp> readTransactionLog(byte[] logEntry) {
    try {
        if (logEntry.length != 2) {
            return null;
        }
        List<IApdu.IApduResp> apduRespList = new ArrayList<>();
        int sfi = logEntry[0] & 0xFF;  // 11
        int rows = logEntry[1] & 0xFF; // 10 rows
        int successCount = 0;
        for (int row = 1; row <= rows; row++) {
            IApdu.IApduReq req = APDU.createReq((byte) 0x00, (byte) 0xB2, (byte) row, (byte) ((sfi << 3) | 0x04));
            if (req == null) {
                break;
            }
            Log.i(TAG, "REQ TRANS_LOG: " + row + " " + sfi + " : " + bcdToStr(req.pack()));
            byte[] cmd = isoCommand(req.pack());
            if (cmd == null) {
                return null;
            }
            IApdu.IApduResp unpack = APDU.unpack(cmd);
            if (unpack == null) {
                return null;
            }
            Log.i(TAG, "RES TRANS_LOG: " + bcdToStr(unpack.getData()) + " " + unpack.getStatusString());
            if (unpack.getStatusString().equals("9000")) {
                ++successCount;
                apduRespList.add(unpack);
            } else if (unpack.getStatusString().equals("6A83")) {
                break;
            }
        }
        if (successCount > 0) {
            transLogResponse.setApduResponse(apduRespList);
            return apduRespList;
        }
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return null;
}

我阅读了交易日志,以计算终端风险管理中的下限。我成功读取了长度为10行的EMV卡的事务日志,但是为什么该结果的EMV标签不是...

java android payment-processing emv
2个回答
1
投票

RES TRANS_LOG未经过TLV编码。它仅包含值字段。您必须根据在具有TAG和长度的日志格式的较早响应中收到的日志格式进行解析,并将根据此格式解析日志数据。解析后将如下所示:


0
投票

标签0x9F4F 日志格式

© www.soinside.com 2019 - 2024. All rights reserved.