private void indicateNewCard() { final String method = "indicateNewCard()"; if (LOG.isInfoEnabled()) { LOG.info(method, "New card"); } TVR tvr = transaction.getTVR(); tvr.getByte2().newCard(); }
private int readATC() throws ProcessingStateException, IOException { final String method = "readATC()"; try { return BinaryNumber.toInt(read(EMVTag.APPLICATION_TRANSACTION_COUNTER)); } catch (ProcessingStateException e) { if (LOG.isInfoEnabled()) { LOG.info(method, "ATC is missing"); } TVR tvr = transaction.getTVR(); tvr.getByte1().iccDataMissing(); throw e; } }
void doVelocityChecking() { final String method = "doVelocityChecking()"; try { int lowerLimit = BinaryNumber.toInt(transaction.getData(EMVTag.LOWER_CONSECUTIVE_OFFLINE_LIMIT)); int upperLimit = BinaryNumber.toInt(transaction.getData(EMVTag.UPPER_CONSECUTIVE_OFFLINE_LIMIT)); int lastOnlineATC = readLastOnlineATC(); if (lastOnlineATC == 0) { indicateNewCard(); } int atc = readATC(); if (LOG.isInfoEnabled()) { LOG.info(method, "ATC: " + atc + ", Last Online ATC: " + lastOnlineATC); } int consecutiveOffline = atc - lastOnlineATC; TVR tvr = transaction.getTVR(); if (consecutiveOffline > lowerLimit) { tvr.getByte4().lowerConsecutiveOfflineLimitExceeded(); } if (consecutiveOffline > upperLimit) { tvr.getByte4().upperConsecutiveOfflineLimitExceeded(); } } catch (IOException e) { if (LOG.isErrorEnabled()) { LOG.error(method, "Error reading data from ICC", e); } } catch (ProcessingStateException e) { if (LOG.isErrorEnabled()) { LOG.error(method, "Error reading data from ICC", e); } TVR tvr = transaction.getTVR(); tvr.getByte4().lowerConsecutiveOfflineLimitExceeded(); tvr.getByte4().upperConsecutiveOfflineLimitExceeded(); } catch (DataNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug(method, "Data not found: " + e.getEMVTag()); } } }
private void selectForOnlineProcessing() { TVR tvr = transaction.getTVR(); tvr.getByte4().transactionSelectedRandomlyForOnlineProcessing(); }