Académique Documents
Professionnel Documents
Culture Documents
Interface Description
1
版本修订历史记录:
2
目录
1. EMV transaction flow chart ...................................................................................................... 4
2. EMV Class ................................................................................................................................ 5
2.1. Get the EMV kernel version number ........................................................................ 5
2.2. Delete all AIDs .......................................................................................................... 5
2.3. Delete all CAPKs ...................................................................................................... 5
2.4. Get the total number of AIDs .................................................................................... 6
2.5. Get the total number of Capks................................................................................... 6
2.6. Get an AID based on the index number .................................................................... 7
2.7. Get an Capk based on the index number ......................................................... 7
2.8. Append an AID ......................................................................................................... 7
2.9. Append an AID ......................................................................................................... 8
2.10. Append an Capk ........................................................................................................ 8
2.11. Append an Capk ........................................................................................................ 9
2.12. Get the value of the tag from the kernel ................................................. 10
2.13. Set the value of the tag to the kernel ..................................................... 10
2.14. Get the value of the tag from the kernel and package the data in TLV format. ....... 11
2.15. Packing data in TLV format according to tag and value ......................................... 11
2.16. Pack TLV list data ................................................................................................... 12
2.17. Find the value of the specified TAG based on the TLV list data ............................. 12
2.18. EMV kernel initialization ........................................................................................ 13
2.19. Contactless transaction preprocessing ..................................................................... 13
2.20. Perform EMV transactions (including contactless transactions)............................. 13
2.21. Balance inquiry ....................................................................................................... 14
2.22. Read transaction log ................................................................................................ 15
2.23. Get track 2 equivalent data and Application primary account number(PAN) ......... 16
2.24. Get CVM type (contactless) .................................................................................... 17
2.25. Setting PIN BLOCK to the kernel........................................................................... 17
2.26. Parsing online response data ................................................................................... 18
3. OnEmvListener Callback class ............................................................................................... 20
3.1. Sending and receiving APDU callback ................................................................... 20
3.2. Select application callback ...................................................................................... 20
3.3. Confirm PAN callback ............................................................................................ 21
3.4. Enter PIN callback .................................................................................................. 22
3.5. Cardholder ID verification callback ........................................................................ 23
3.6. Online processing callback ..................................................................................... 24
4. Annex ...................................................................................................................................... 26
4.1. Terminal parameter class ......................................................................................... 26
4.1. Transaction parameter class .................................................................................... 27
4.2. AID parameter class ................................................................................................ 27
4.3. CAPK parameter class ............................................................................................ 28
4.4. Transaction log class ............................................................................................... 28
4.5. EMV Result Class ................................................................................................... 29
3
1. EMV transaction flow chart
Start
初始设置
End
4
2. EMV Class
Get the object of the EMV class:
EmvHandler emvHandler = EmvHandler.getInstance();
Output
Return EMV kernel version number
Stuct
Remarks
Output
Return
Stuct
Remarks
Example
5
Description Delete all CAPKs
Input
Output
Return
Stuct
Remarks
Example
Stuct
Remarks
Example
Stuct
Remarks
6
Example
Output
Return A string of AID data in TLV format
=null, get error
Stuct
Remarks
Output
Return A string of Capk data in TLV format
=null, get error
Stuct
Example
7
4000000009F1B0400000000DF15040
0000000DF160199DF170199DF14039
F3704DF180101DF200600099999999
9"));
Output
Return
Stuct
Remarks
Output
Return
Stuct
Remarks
hexStringToBytes
("9F0605A0000000659F220109DF05
083230303931323331DF060101DF07
8
0101DF028180B72A8FEF5B27F2B55
0398FDCC256F714BAD497FF56094
B7408328CB626AA6F0E6A9DF8388
EB9887BC930170BCC1213E90FC07
0D52C8DCD0FF9E10FAD36801FE93
FC998A721705091F18BC7C98241C
ADC15A2B9DA7FB963142C0AB640
D5D0135E77EBAE95AF1B4FEFAD
CF9C012366BDDA0455C1564A6881
0D7127676D493890BDDF040103DF
03144410C6D51C2F83ADFD92528F
A6E38A32DF048D0A")
Output
Return
Stuct
Remarks
Example
Output
Return
Stuct
9
Remarks
Example
0x95 TVR
0x9B TSI
0x5A PAN
Output
Return Get the value of the tag
Stuct
Remarks
Example
10
value value
Output
Return The value of the EmvResult object
Stuct
Remarks
Example
Description Get the value of the tag from the kernel and package the data in TLV format.
Input tag tag
Output
Stuct
Remarks
Example
value value
Return
11
Stuct
Remarks
Example
Description Pack TLV list data, such as 55 domain data, according to the tag array
Input tags Tag array
Output
Return TLV list data, such as 55 domain data
Stuct
Remarks
Example
Description Find the value of the specified TAG based on the TLV list data
TLV list data, such as 55 domain return
tlvList
Input data
findTag tag
Output
Tag value,
Return
=null, not found or parsed error
Stuct
Remarks
Example
12
2.18. EMV kernel initialization
Output
Return
Stuct
Remarks
Output
Return The value of the EmvResult object
Stuct
Remarks
Example
13
emvListener EMV callback class
When isEcTrans[0]=0x01, it is an
electronic cash transaction (including
contact and contactless)
isEcTrans
When isEcTrans[0]=0x00, it is an Emv
transaction (including contact and
contactless)
Balance, BCD code, 6 bytes, when
Stuct
Remarks
Example
object:
KERNAL_EMV_PBOC = 0; //Contact
EMV&PBOC
14
Public static final byte
KERNAL_CONTACTLESS_ENTRY_
entry
obtained
Stuct
Remarks
Example
object:
KERNAL_EMV_PBOC = 0; //Contact
EMV&PBOC
KERNAL_CONTACTLESS_ENTRY_
entry
when defined.
Stuct
Remarks
Example
Description Get track 2 equivalent data and Application primary account number(PAN)
EMV/PBOC transactions are obtained (confirmed PAN and later process)
Input
Output track2 Track 2 data, the data is returned in
track2[0]
Stuct
Remarks
Example
16
2.24. Get CVM type (contactless)
Description Get the CVM type for the contactless transaction result to be online, get the
execution type of CVM
Input
Output
Return the following values for the EmvData
object:
Example
Output
17
Return
Stuct
Remarks
Example
Output
The following values for the
EmvResult object:
Public static final int EMV_OK = 0;
//OK
Public static final int
EMV_ONLINE_FAILED = -20;
Return //Unsuccessful online connection failed
Public static final int
EMV_ONLINE_NORESP_MAC_OR
_RECV_ERR = -38; // Online
unsuccessful, no response online or
return MAC error or receive data error,
correct
Stuct
Remarks
18
Example
19
3. OnEmvListener Callback class
Get the object of the OnEmvListener class:
OnEmvListener onEmvListener = new OnEmvListener() {
//……
}
Output
Return The APDU data of the response,
Stuct
Remarks
applications;
20
Contactlss do not execute this callback
Output
//OK
EMV_USER_CANCEL = -7;
//transaction cancellation
Stuct
Remarks
Output
//OK
EMV_USER_CANCEL = -7;
//transaction cancellation
Stuct
Remarks
RD_CVM_ONLINE_PIN) to execute the input online PIN. If you want to force the
object:
public static final byte
ONLINE_ENCIPHERED_PIN =
0x00;
public static final byte
OFFLINE_PLAINTEXT_PIN =
0x01;
public static final byte
OFFLINE_ENCIPHERED_PIN =
0x02;
Output
Return The following values for the The
22
following values for the EmvResult
object:
//OK
EMV_USER_CANCEL = -7;
//transaction cancellation
password or no password
Stuct
Remarks
be executed;
following values
0x00: ID card
0x02: Passport
23
0x05: Other
Output
EmvResult object:
//OK
EMV_USER_CANCEL = -7;
//transaction cancellation
Stuct
Remarks
If the connection is successful, the issuing bank authorization response code [8A]
Input
Output
EmvResult object:
0; //OK
24
Public static final int
EMV_ONLINE_FAILED = -20;
//Unsuccessful online
connection failed
EMV_ONLINE_NORESP_MAC_OR_RECV_
unsuccessful, no response
EMV_ONLINE_RESP_AAC = -40;
returns rejection
Stuct
Remarks
25
4. Annex
27
private String version; //9F09 HEX string
private String clTransLimit; //DF20 HEX string(6byte)
private String clOfflineLimit;//DF19 HEX string(6byte)
private String clCVMLimit; //DF21 HEX string(6byte)
private String ecTTLVal; //9F7B HEX string(6byte)
}
28
4.5. EMV Result Class
package com.zcs.sdk.emv;
29
public static final int EMV_NOT_SUPPORT = -36;
public static final int ICC_RSP_6986 = -37;
public static final int EMV_ONLINE_NORESP_MAC_OR_RECV_ERR = -38;
public static final int EMV_NO_ONLINE = -39;
public static final int EMV_ONLINE_RESP_AAC = -40;
public static final int EMV_PARSING_ERROR = -73;
}
30