i recently started learning android programming at my university and as a final project i started developing nfc-hce payment app like Android Pay and/or Apple pay. I live in a small country where non of the nfc payment apps work so i cannot see in real life how it actually works. I was searching and i found about SwipeYours app and it's source code on GitHub and i am using it now to understand the basics of EMV application in mobile payment app. What i have now is commands for APDU select, from known AID card select, GPO command and READ_REC command.
Using my MasterCard PayPass card everyday i found out that the chip is holding my 10 last transactions and my question is now, how does the card gets all the information about transaction. I would like to implement that in my code.
And i know that only banks and card issuers can make such an applications fully functional because of the key for generating a cryptogram but i am starting an internship next month in one of the major banks as a student developer in my country and i like to have something to show and maybe continue to develop it with their help.
Have a look into EMV Book 3 -- Annex D Transaction Log Information.
Citing page 170:
To read the transaction log information, the special device uses the following steps:
• Perform Application Selection and retrieve the Log Entry data element located in the FCI Issuer Discretionary Data. If the Log Entry data element is not present, the application does
not support the Transaction Log function.• Issue a GET DATA command to retrieve the Log Format data element.
• Issue READ RECORD commands to read the Transaction Log records.
You might find some parts of the javeemvreader project interesting (classes LogFormat, TransactionLog and method EMVSession.checkForTransactionLogRecords() where they are used).
Good luck!