Reputation: 171
I am trying to read the credit card data from the VISA card but could not able to make a success.As in the internet resources I have found that for the MASTER card we can select the PSE directory using 1PAY.SYS.DDF01 file and then read the records. But for VISA its not mandatory and when I use the following file using SELECT command for getting the PSE directory I get the response as '6A82'.Which means its is not supported by the file system. I looked for the Error in the EMV 4.2 Book 1(EMV specification) and it says that we have to use a "List of AIDs". It says "The terminal issues another SELECT command using the next AID in its list". I am unable to understand this and proceed further.
Any help on how to get the PSE for the VISA card or the AID to get the credit card details?
Thanks, Shekhar
Upvotes: 15
Views: 12962
Reputation: 1
When You are using this 1PAY.SYS.DDF01 first command the card will responce with 2 AID list inside first there is some error so that you give this 6A82 Error with return code RETRY.You have to use a ENRTY Libs inside there is some delete command and than set app select command again so it will automatically get second AID and than your visa card get success.
Upvotes: 0
Reputation: 293
You can use an AID List like this one. However some cards respond with "wrong" data when iterating through the list. i.e., I had the case where a V-Pay VISA card was read as Maestro. If you have to iterate through a big AID List to "open" the card info, I would recommend you to add a flag to get the actual AIDs from the card, then go back to the main method to read the card with the main AID provided.
Something like:
As the AID usually comes in the first records from the card, this loop ensures the process is correct at a minimum time cost.
Upvotes: 0
Reputation: 2006
First of all PPSE applet is nothing specific for VISA nor for MasterCard. It is defined by EMV, and it is used as you correctly noticed for listing the AIDs of the available payment applications on the card. But if it is not there the terminals try all the supported AIDs to build the candidate list.
If you want to select the VISA applet, but you do not know the complete AID you can use partial selection. Since all the VISA AIDs begin with the VISA's RID: A0 00 00 00 03. You can try to send this command:
This will return the first instance:
00 A4 04 00 05 A0 00 00 00 03 00
and this will give you more if you have on your card:
00 A4 04 02 05 A0 00 00 00 03 00
Upvotes: 6
Reputation: 302
It is kind of weird for me... My research indicates that for VISA that application will always be available, but for Mastercard it is not mandatory...
Anyway, Here is the command I send to my cardreader inorder to select that application:
// OP CL P1 P2 LN DATA------------------------------------- EL
//select command 00 A4 04 00 0E 31 50 41 59 2E 53 59 53 2E 44 44 46 30 31 00
NSString* str= @"1PAY.SYS.DDF01";
NSData* data=[str dataUsingEncoding:NSUTF8StringEncoding];
int datalength = data.length;
NSMutableData *selectPSECommand = [[NSMutableData alloc] init];
[selectPSECommand appendBytes:"\x00" length:1]; //command class
[selectPSECommand appendBytes:"\xA4" length:1]; //APDU_INSTRUCTION_SELECT_FILE
[selectPSECommand appendBytes:"\x04" length:1]; //select file by name
[selectPSECommand appendBytes:"\x00" length:1]; //First or only occurrence of file
[selectPSECommand appendBytes:&datalength length:1]; //data length
[selectPSECommand appendData:data]; //the data we are sending
[selectPSECommand appendBytes:"\x00" length:1]; //expected response length. here it is 0. We are only selecting a file.
The code sample is for Objective C.
Compare the data you send with the data I'm sending and see if it corresponds. In the meantime, I'll be looking into running through the AID list.
Hope it helps. Ezfrag
Upvotes: 1
Reputation: 642
So the problem is you don't know AID of your application on the card? There's no method to get them (except PSE), you have to know first what applications on card you support. So the "List of AIDs" is list of AIDs you support, which was told you by your acquirer. You can try to create this list yourself basing on some standard AIDs which you have listed here: http://en.wikipedia.org/wiki/EMV#Application_selection
Upvotes: 3