maxmvaas
maxmvaas

Reputation: 1

Get Card Number and Expire Data of Visa card through APDU commands (ISO 7816)

Trying to get cardNumber and expire data of my visa card, but always get 6700 response.

// 80 A8 00 00 12 83 10 F6 20 C0 00 00 00 00 00 00 01 76 20 60 B9 06 43 00
val step3 = sendCommand("80A80000128310F620C000000000000001762060B9064300")
val targetInfo = getTagValue(step3!!, "57")
val targetInfoTokens = targetInfo!!.split("D").toTypedArray()
val cardNumber = targetInfoTokens[0]
val expireDate = targetInfoTokens[1].substring(0, 4)
return BankCardInfo(cardNumber, expireDate, type)

For example, with MIR cards reading is ok.

// 80 A8 00 00 11 83 0F 00 06 43 00 00 00 00 00 01 22 8E 00 B0 50 05 00
val step3 = sendCommand("80A8000011830F000643000000000001228E00B0500500")
// 00 B2 01 14 00
val step4 = sendCommand("00B2011400")!!
val cardNumber = getTagValue(step4, "5A")!!
val expireDate = getTagValue(step4, "24")!!
return BankCardInfo(cardNumber, expireDate, type)

I tried other commands, I tried to figure out this topic, but nothing worked.

I would like a list of commands, how can I get the data I need.

Upvotes: 0

Views: 681

Answers (1)

mysaes_jgo
mysaes_jgo

Reputation: 9

You should at least first select the application like this 00A40400 07A000000003101000 for visa. Then send procession options and read all the records you got on tag APPLICATION_FILE_LOCATOR. Credit card information will not always be on the same record. You cannot hardcode the record you read.

Upvotes: 0

Related Questions