EMV API en
EMV API en
EMV
Interface Description
1
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
版本修订历史记录:
版本号 作者 参与者 发布日期 Remarks
V1.0 罗成 2018-4-13 初始版本
2
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
目录
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
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
4
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
2.EMV Class
Stuct
Remarks
Output
5
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
Return
Stuct
Remarks
Example
Stuct
Remarks
Example
Stuct
Remarks
Example
6
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
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
Stuct
Remarks
7
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
Output
Return
Stuct
Remarks
2.10.Append an Capk
8
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
Stuct
Remarks
Example
2.11.Append an Capk
Output
Return
Stuct
Remarks
Example
9
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
value value
Output
Return The value of the EmvResult object
Stuct
Remarks
Example
Output
Return TLV format data
=null, get error
Stuct
Remarks
Example
10
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
value value
Return
Stuct
Remarks
Example
Stuct
Remarks
Example
11
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
Output
Tag value,
Return
=null, not found or parsed error
Stuct
Remarks
Example
Output
Return
Stuct
Remarks
Output
Return The value of the EmvResult object
Stuct
Remarks
Example
12
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
Stuct
Remarks
Example
2.21.Balance inquiry
Stuct
Remarks
Example
Stuct
Remarks
Example
14
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
Stuct
Remarks
Example
15
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
= (byte)0x80;
//ONLINE PIN
public static final
byte RD_CVM_SIG
= 0x40;
//SIGNATURE
Stuct
Remarks
Example
16
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
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
Example
17
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
Output
Return The APDU data of the response,
Return null if communication error or
no response or response timeout
Stuct
Remarks
Output
Return Public static final int EMV_OK = 0;
18
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
//OK
Public static final int
EMV_USER_CANCEL = -7;
//transaction cancellation
Public static final int
EMV_TIME_OUT = -8; //user
operation timed out
Stuct
Remarks
Output
Return Public static final int EMV_OK = 0;
//OK
Public static final int
EMV_USER_CANCEL = -7;
//transaction cancellation
Public static final int
EMV_TIME_OUT = -8; //user
operation timed out
Stuct
Remarks
19
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
Need to adjust the input online PIN, call setPinBlock () method to set the PIN
BLOCK to the kernel;
If it is contactless transaction, if you want to enter a PIN, you need to call
getTrack2AndPAN() to get PAN;
If it is a contactless transaction, you need to call getCvmType() to get the
cardholder authentication type as online PIN (EmvData.
RD_CVM_ONLINE_PIN) to execute the input online PIN. If you want to force the
online PIN, you do not need to judge this.
Input pinType PIN type:
The following values for the EmvData
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
following values for the EmvResult
object:
Public static final int EMV_OK = 0;
//OK
Public static final int
EMV_USER_CANCEL = -7;
//transaction cancellation
Public static final int
EMV_TIME_OUT = -8; //user
operation timed out
Public static final int
EMV_NO_PASSWORD = -32; //No
password or no password
Stuct
Remarks
20
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
Output
Return The following values for the
EmvResult object:
Public static final int EMV_OK = 0;
//OK
Public static final int
EMV_USER_CANCEL = -7;
//transaction cancellation
Public static final int
EMV_TIME_OUT = -8; //user
operation timed out
Stuct
Remarks
21
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
If the connection is successful, the issuing bank authorization response code [8A]
returns the rejection, please return to EMV_ONLINE_RESP_AAC;
Input
Output
Return The following values for the
EmvResult object:
Public static final int EMV_OK
= 0; //OK
Public static final int
EMV_ONLINE_FAILED = -20;
//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
Public static final int
EMV_ONLINE_RESP_AAC = -40;
//Online success, online
authorization response code
returns rejection
Stuct
Remarks
22
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
4.Annex
package com.zcs.sdk.emv;
25
Shenzhen ZCS Technology Co., Ltd EMV Interface Description
26