Skip to content

Commit

Permalink
Fix error with unknown transaction tags
Browse files Browse the repository at this point in the history
  • Loading branch information
devnied committed Aug 31, 2014
1 parent 0d3b426 commit e82ce6d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ private Collection<AnnotationData> getAnnotationSet(final List<TagAndLength> pTa
ret = new ArrayList<AnnotationData>(data.size());
for (TagAndLength tal : pTags) {
AnnotationData ann = data.get(tal.getTag());
ann.setSize(tal.getLength() * BitUtils.BYTE_SIZE);
ret.add(ann);
if (ann != null) {
ann.setSize(tal.getLength() * BitUtils.BYTE_SIZE);
ret.add(ann);
}
}
} else {
ret = AnnotationUtils.getInstance().getMapSet().get(getClass().getName());
Expand Down
4 changes: 2 additions & 2 deletions sample/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.devnied.emvnfccard"
android:versionCode="12"
android:versionName="2.0.0" >
android:versionCode="13"
android:versionName="2.0.1" >

<uses-sdk
android:minSdkVersion="15"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,9 @@ public void onBackPressed() {
payment.setAmount((float) 120.0);
payment.setCurrency(CurrencyEnum.USD);
payment.setCyptogramData("40");
payment.setTerminalCountry(CountryCodeEnum.US);
payment.setTerminalCountry(null);
payment.setTransactionDate(new Date());
payment.setTransactionType(TransactionTypeEnum.PURCHASE);
payment.setTransactionType(null);
records.add(payment);

mReadCard.setListTransactions(records);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,13 @@ public View getChildView(final int groupPosition, final int childPosition, final
country.setText(parent.getContext().getString(R.string.transaction_unknown));
}
cryptogram.setText(transaction.getCyptogramData());
type.setText(ViewUtils.getStringRessourceByName(parent.getContext(), "transaction_type_"
+ transaction.getTransactionType().getKey()));
// transaction type
if (transaction.getTransactionType() != null) {
type.setText(ViewUtils.getStringRessourceByName(parent.getContext(), "transaction_type_"
+ transaction.getTransactionType().getKey()));
} else {
type.setText(parent.getContext().getString(R.string.transaction_unknown));
}

return v;
}
Expand Down

0 comments on commit e82ce6d

Please sign in to comment.