Android Question help: reading a credit card using NFC

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
hello,

for a project i'm testing i need to be able to read a credit card using NFC
i need to read tags & track2
i tried to to go through the few articles here but got lost
is there anyone who can help?
i sample code will be highly appreciated
for a complete function or snippet that will save me development time i'm happy to donate

thank you
 

f0raster0

Well-Known Member
Licensed User
Longtime User
I stopped using RFID/NFC+B4A years ago - the last version of the library NFC that worked for me was 1.25

NFC is an internal library now :) then probably can do much more or the team B4X can add new features if needed

What inf do you want to read from that credit card? The public information or so?

If you want to read the tag to work with payments..it could help:


 
Last edited:
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
I stopped using RFID/NFC+B4A years ago - the last version of the library NFC that worked for me was 1.25

NFC is an internal library now :) then probably can do much more or the team B4X can add new features if needed

What inf do you want to read from that credit card? The public information or so?

If you want to read the tag to work with payments..it could help:


basically i would like to be able to read all readable data
in particular the card number (track2) and any tag available
is there any demo or snippet or anything i can see and learn from or ever use ?
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
i was interested in contactless smartcards. i didn't want to spend money for a reader that i'd have to carry around with me all day and plug into my phone:) with your reference to tracks 1 and 2, it sounds like you're looking at the stripe or the chip, for which you'll need a reader.

technically, a certain amount of reading contactless cards is trivial (i've compared what i've been able to do against some apps downloaded from play.) the biggest hurdle is the tons of undocumented proprietary data which you have to purchase from each card issuer at considerable cost.

i just did some tweaking on my "reader" last night. you can try it if you like. i think it runs ok. there's an earlier here somewhere. by the way, contactless cards do give up what's called "track 2 equivalent" data. didn't strike me as adding much to what the cards had already told me. but then i don't know what your plans are for using the data.
 

Attachments

  • vicino.zip
    232.3 KB · Views: 310
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
basically i would like to be able to read all readable data
in particular the card number (track2) and any tag available
is there any demo or snippet or anything i can see and learn from or ever use ?
Yes.. try the links!

You can't read all the data so simple - RFID isn't just read.. you need the key etc.. reading public information is OK see the link above.

I'm almost sure you will need to talk to the bank if you wqnt something about payments.
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
i was interested in contactless smartcards. i didn't want to spend money for a reader that i'd have to carry around with me all day and plug into my phone:) with your reference to tracks 1 and 2, it sounds like you're looking at the stripe or the chip, for which you'll need a reader.

technically, a certain amount of reading contactless cards is trivial (i've compared what i've been able to do against some apps downloaded from play.) the biggest hurdle is the tons of undocumented proprietary data which you have to purchase from each card issuer at considerable cost.

i just did some tweaking on my "reader" last night. you can try it if you like. i think it runs ok. there's an earlier here somewhere. by the way, contactless cards do give up what's called "track 2 equivalent" data. didn't strike me as adding much to what the cards had already told me. but then i don't know what your plans are for using the data.
thanks for your input.
i'm going the other way - checking to read credit card using my nfc on my phone for getting payments
an ready close apk doesn't help me so thanks but i can't use it not even for learning the technique
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
Yes.. try the links!

You can't read all the data so simple - RFID isn't just read.. you need the key etc.. reading public information is OK see the link above.

I'm almost sure you will need to talk to the bank if you wqnt something about payments.
i just need to read. nothing to write
i need track2 from the card and i need the card's tags
i know people did iy on android phone (using other dev tools)
i'm using b4a (and like it very much) so i'd like to stay and use it for my project
no need for any external reader as the phone has a built in NFC reader
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
i was interested in contactless smartcards. i didn't want to spend money for a reader that i'd have to carry around with me all day and plug into my phone:) with your reference to tracks 1 and 2, it sounds like you're looking at the stripe or the chip, for which you'll need a reader.

technically, a certain amount of reading contactless cards is trivial (i've compared what i've been able to do against some apps downloaded from play.) the biggest hurdle is the tons of undocumented proprietary data which you have to purchase from each card issuer at considerable cost.

i just did some tweaking on my "reader" last night. you can try it if you like. i think it runs ok. there's an earlier here somewhere. by the way, contactless cards do give up what's called "track 2 equivalent" data. didn't strike me as adding much to what the cards had already told me. but then i don't know what your plans are for using the data.
hi
i did try your app
it did read the card
there is a text presented
some i see is data from the card (presented in HEX)
can you explain what data you got from the card?
did you manage to get TRACK2?

now, i hope i'm not too rude - will it be possible to get the code so i can learn from it?
thanks
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
i just need to read. nothing to write
i need track2 from the card and i need the card's tags
i know people did iy on android phone (using other dev tools)
i'm using b4a (and like it very much) so i'd like to stay and use it for my project
no need for any external reader as the phone has a built in NFC reader
to read for payments system you need the key - it's not just read. You need to "talk" to the card. NFC in phone are there for over 7+ years

The public data will be simple to read. Just run the example
 
Last edited:
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
hi @Zeev Goldstein

You can start with the example attached, it is based in Erel and udg examples.
I tested the demo, and I can read my ViSA and show the number. EDIT: with the demo attached I can read the card's ID
 

Attachments

  • NFCAdvanced_Tested_ReadMyVisa.zip
    9.4 KB · Views: 275
Last edited:
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
hi @Zeev Goldstein

You can start with the example attached, it is based in Erel and udg examples.
I tested the demo, and I can read my ViSA and show the number. EDIT: with the demo attached I can read the card's ID
hi,
firstly - once again thank you for your good will and assistance
i did try to see and run your code - it works
however i think either i am missing something or it does not read the data right
when i read a card i get a HEX code like EFA110B7
from that i can't see the track2 or any other element from the card
what i need is track2 and the tags on the cards

since i really got lost here, maybe you can create a working sample to read that data (i am happy to donate for your time & effort)
so i can then use it in my test project?

it can be either a code for a function to call that will return the required data
or a library so no code but still i can get the data i need

does that sound like something doable?

thanks
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
when i read a card i get a HEX code like EFA110B7
yes, that is an example. Using that example you will read the ID like EFA110B7
download the "App Tag Info" from NXP then you can check if that "EFA110B7" is correct.

After done that test you can move to try to read your "track2"
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
yes, that is an example. Using that example you will read the ID like EFA110B7
download the "App Tag Info" from NXP then you can check if that "EFA110B7" is correct.

After done that test you can move to try to read your "track2"
thank you.
what is NXP? what's the url?
i don't have that info on the card so i can't check if it is correct
since it is credit card the best test is checking the card's data

how can i read Track2?
how can i read the Tags on the card?

is there a way you can help me with that?
as said i'm happy to pay/donate for this help as i need it urgently

the odd thing is that i searched all community and there is no one asking that other than me
there were a few questions but very long time ago and no answers
or maybe i missed this too...

once again thanks
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
thank you.
what is NXP? what's the url?
NXP: https://en.wikipedia.org/wiki/NXP_Semiconductors

using their App "Tag Info" (check on googleplay) you can check if the app demo b4a is reading the correct ID :)

how can i read Track2?
how can i read the Tags on the card?
if you are reading some data - then your reading the TAG.
I used B4A years many years ago to read tags.. for "smart lockers" :) but when the NCF lib1.5 was updated I moved my project to use just a microcontroller then not sure if I can help looking for that Track2 that i don't see anywhere..
 
Last edited:
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
NXP: https://en.wikipedia.org/wiki/NXP_Semiconductors

using their App "Tag Info" (check on googleplay) you can check if the app demo b4a is reading the correct ID :)


if you are reading some data - then your reading the TAG.
I used B4A years many years ago to read tags.. for "smart lockers" :) but when the NCF lib1.5 was updated I moved my project to use just a microcontroller then not sure if I can help looking for that Track2 that i don't see anywhere..
first of all thanks for even trying
as i am quite a rookie here and this is somehow killing me as i can't even move one step ahead i feel bad...
i must find a solution
and it seems this had not really been discussed here like no one is interested
as i even published i would even pay for it and no one responded - like this is a problem no one managed to overcome
strange...
 
Upvote 0
Top