Пример #1
0
 public void readCardInfo() {
   try {
     openApp();
     selectFileAccount();
     this.cardInfo = readAccount();
     getNfcRecordCallback().get().onNfcCardReceived(cardInfo);
   } catch (AccessCardException ex) {
     getNfcRecordCallback().get().onNfcCardError(ex.getMessage());
   }
   ;
 }
Пример #2
0
 public void doDebit(BigDecimal amount) {
   try {
     CardTransaction cardTransaction =
         new CardTransaction(
             Calendar.getInstance().getTimeInMillis(),
             cardInfo.getBalance(),
             amount,
             cardInfo.getCurrency(),
             Constant.OPERATION_DEBIT);
     cardInfo.setBalance(cardInfo.getBalance().subtract(amount));
     updateBalance(MessageUtil.formatBalanceToStore(cardInfo.getBalance()));
     storeTransaction(cardTransaction);
   } catch (AccessCardException ex) {
     getNfcRecordCallback().get().onNfcCardError(ex.getMessage());
   }
   ;
 }