PAX CLSS L2 API Programming Guide For Paywave Library
PAX CLSS L2 API Programming Guide For Paywave Library
Programming Guide
All rights reserved. No part of the contents of this document may be reproduced or
transmitted in any form or by any means without the written permission of PAX
Computer Technology (Shenzhen) Co., Ltd.
The information contained in this document is subject to change without notice.
Although PAX Computer Technology (Shenzhen) Co., Ltd. has attempted to ensure
the accuracy of the contents of this document, this document may contain errors or
omissions. The examples and sample programs are for illustration only and may not
be suitable for your purpose. You should verify the applicability of any example or
sample program before placing the software into productive use.
I
Revision History
Versio
Date Note Author
n
2010-12-30 V1.0.0 Initial yingl
2015-05-04 V1.1.4 1. Modify the description about DRL in 7.1 Jessie Zhou
II
CLSS_API_ORDER_ERR for below API,
Clss_SetReaderParam_Wave
Clss_SetTLVData_Wave
Clss_GetTLVData_Wave
Clss_SetFinalSelectData_Wave
III
parameters in Clss_SetExtendFunc_Wave
with nflag value 2.
IV
Clss_GetSchemeInfo_Wave
Clss_nGetTrack1MapData_Wave
Clss_nGetTrack2MapData_Wave and
Clss_GetMSDType_Wave functions as expired
functions.
3. Updated the parameter description of the
Clss_SetExtendFunc_Wave and
Clss_GetExtendFunc_Wave functions.
4. Added the instructions for VCTKS in section
3.
5. Deleted MSD related in the flowchart.
V
Contents
1 Introduction ......................................................................................................................... 1
1.1 Abbreviation ............................................................................................................. 1
1.2 Document Conventions ............................................................................................ 1
2 Kernel Comparison of CLSS and EMV ........................................................................... 3
3 Example of Application Programming for payWave .......................................................... 4
4 Parameters and Data Management ................................................................................... 9
4.1 Clss_CoreInit_Wave ................................................................................................. 9
4.2 Clss_ReadVerInfo_Wave ......................................................................................... 9
4.3 Clss_GetTLVData_Wave ....................................................................................... 10
4.4 Clss_SetTLVData_Wave ........................................................................................ 10
4.5 Clss_GetReaderParam_Wave ................................................................................. 11
4.6 Clss_SetReaderParam_Wave ................................................................................. 11
4.7 Clss_SetRdSchemeInfo_Wave ............................................................................... 12
4.8 Clss_GetSchemeInfo_Wave ................................................................................... 12
4.9 Clss_SetVisaAidParam_Wave ............................................................................... 13
4.10 Clss_SetDRLParam_Wave ................................................................................. 13
4.11 Clss_SetDRLParam_II_Wave ............................................................................. 14
4.12 Clss_SetExtendFunc_Wave ................................................................................ 14
4.13 Clss_GetExtendFunc_Wave................................................................................ 15
5 Certification Authority (CA) Public Key Management .................................................... 17
5.1 Clss_AddCAPK_Wave........................................................................................... 17
5.2 Clss_DelCAPK_Wave ............................................................................................ 18
5.3 Clss_GetCAPK_Wave ............................................................................................ 18
5.4 Clss_DelAllCAPK_Wave....................................................................................... 18
6 Terminal Issuer Public Key Certification Revocation List Management .......................... 20
6.1 Clss_AddRevocList_Wave ..................................................................................... 20
6.2 Clss_DelRevocList_Wave ...................................................................................... 21
6.3 Clss_DelAllRevocList_Wave ................................................................................. 21
VI
7 Transaction Processing Functions ..................................................................................... 22
7.1 Clss_SetFinalSelectData_Wave ............................................................................. 22
7.2 Clss_SetTransData_Wave ...................................................................................... 23
7.3 Clss_Proctrans_Wave ............................................................................................. 24
7.4 Clss_GetMSDType_Wave ..................................................................................... 25
7.5 Clss_CardAuth_Wave ............................................................................................ 26
7.6 Clss_GetCvmType_Wave ...................................................................................... 26
7.7 Clss_nGetTrack1MapData_Wave .......................................................................... 27
7.8 Clss_nGetTrack2MapData_Wave .......................................................................... 27
7.9 Clss_ProcRestric_Wave ......................................................................................... 28
7.10 Clss_IssuerAuth_Wave ....................................................................................... 28
7.11 Clss_IssScriptProc_Wave ................................................................................... 29
7.12 Clss_SetDDAOmitFlag_Wave............................................................................ 29
8 Debug Function ................................................................................................................. 31
8.1 Clss_GetDebugInfo_Wave ..................................................................................... 31
VII
Table List
VIII
PAX CLSS L2 API Programming Guide
1 Introduction
1.1 Abbreviation
【List out the definitions of the nomenclatures and abbreviations used in this document.】
Table 1 Abbreviation
Abbreviation Description
CLSS Contactless
【Used for reminding the audience some place may have to pay
attention to, which may lead to exceptions or errors.】
www.paxtechnology.com. 1
PAX CLSS L2 API Programming Guide
www.paxtechnology.com. 2
PAX CLSS L2 API Programming Guide
2 Kernel Comparison of
CLSS and EMV
1. In the CLSS kernel, the parameters including AID list, CA Public Keys, terminal type
and so on. These parameters imported from the application program will not be saved
after power off.
2. Notice that the AID operator functions (Add, Delete) in the CLSS kernel are different
from which in the EMV kernel.
3. The CLSS kernel can set 1 CA Public Key at a time, and this key cannot be saved after
power off. Therefore, the application program must save the CA Public Keys itself, and
set one or a group of corresponding Public Keys according to the CA Public Key index or
RID for each transaction.
www.paxtechnology.com. 3
PAX CLSS L2 API Programming Guide
3 Example of Application
Programming for payWave
www.paxtechnology.com. 4
PAX CLSS L2 API Programming Guide
Kernel Initialization
Clss_CoreInit_Wave
Set Parameters
Clss_SetReaderParam_Wave
EntryPoint processing
(Transaction Preprocessing,
Application Selection)
Y
KernelType ==payWave? N Other transaction
Transaction
ACType is AAC? Y
completion
N
Clss_ProcRestric_Wave
www.paxtechnology.com. 5
PAX CLSS L2 API Programming Guide
Online processing
Prompt cardholder to
represent card
Prompt cardholder to
remove card
Transaction
completion
www.paxtechnology.com. 6
PAX CLSS L2 API Programming Guide
www.paxtechnology.com. 7
PAX CLSS L2 API Programming Guide
www.paxtechnology.com. 8
PAX CLSS L2 API Programming Guide
4.1 Clss_CoreInit_Wave
4.2 Clss_ReadVerInfo_Wave
4.3 Clss_GetTLVData_Wave
EMV_OK Successful.
The order of the API called is error. The
CLSS_API_ORDER_
Return detailed error code can be obtained with
ERR
Clss_GetDebugInfo_Wave
EMV_NO_DATA Cannot find the tag or no data.
1. The CLSS library can store all the EMV standard data elements;
it also can store up to 64 data elements which are defined by the
issuer. After reading the application data, the application
developer can call this function to get the data element specified
Instruction by the tag.
2. This function should be called after
Clss_SetFinalSelectData_Wave. Or the data retrieved may not
be the final data used in the transaction.
4.4 Clss_SetTLVData_Wave
www.paxtechnology.com. 10
PAX CLSS L2 API Programming Guide
EMV_OK Successful.
The order of the API called is error. The
CLSS_API_ORDER_
Return detailed error code can be obtained with
ERR
Clss_GetDebugInfo_Wave
EMV_DATA_ERR nDtLen error.
1. The value of the standard or priority data element can be modified
or set by the application program. In this way, the application can
satisfy the requirement in some special conditions. Normally, it’s
Instruction not necessary to call this function.
2. This function should be called after
Clss_SetFinalSelectData_Wave, or the data set will be
initialized.
4.5 Clss_GetReaderParam_Wave
EMV_OK Successful.
Return
CLSS_PARAM_ERR Parameter error.(Null pointer)
Instruction None
4.6 Clss_SetReaderParam_Wave
www.paxtechnology.com. 11
PAX CLSS L2 API Programming Guide
Clss_ReaderParam.
EMV_OK Successful.
The order of the API called is error. The
CLSS_API_ORDER_
Return detailed error code can be obtained with
ERR
Clss_GetDebugInfo_Wave
CLSS_PARAM_ERR Parameter error.(Null pointer)
This function must be called between Clss_CoreInit_Wave and
Clss_SetFinalSelectData_Wave to set the reader’s relative
Instruction parameters.
The TLV data of the parameters related to Clss_ReaderParam can
only be obtained after Clss_SetFinalSelectData_Wave.
4.7 Clss_SetRdSchemeInfo_Wave
Return None
Instruction This function is not used, it is reserved for compatibility only.
4.8 Clss_GetSchemeInfo_Wave
Return None
www.paxtechnology.com. 12
PAX CLSS L2 API Programming Guide
4.9 Clss_SetVisaAidParam_Wave
EMV_OK Successful.
Return
CLSS_PARAM_ERR Parameter error.(Null pointer)
Instruction This function shall be called before Clss_Proctrans_Wave.
4.10 Clss_SetDRLParam_Wave
www.paxtechnology.com. 13
PAX CLSS L2 API Programming Guide
4.11 Clss_SetDRLParam_II_Wave
4.12 Clss_SetExtendFunc_Wave
www.paxtechnology.com. 14
PAX CLSS L2 API Programming Guide
EMV_OK Successful.
Return
CLSS_PARAM_ERR Parameter error.(Null pointer)
If necessary, this function shall be called between Clss_CoreInit_Wave
Instruction
and Clss_Proctrans_Wave .
4.13 Clss_GetExtendFunc_Wave
www.paxtechnology.com. 15
PAX CLSS L2 API Programming Guide
indicator.
nExDataOutLen(input
Expected length of the output data.
)
EMV_OK Successful.
paucExDataOut or nExDataOutLen is not
Return EMV_OVERFLOW
long enough.
CLSS_PARAM_ERR Parameter error.
For transit transaction, the application may be required to send some
results of the transaction to the acquirer, which includes,
Online Required by Reader Indicator,
Instruction Decline Required by Reader Indicator,
Application expired.
Please call this function to obtain the results if required.
www.paxtechnology.com. 16
PAX CLSS L2 API Programming Guide
5.1 Clss_AddCAPK_Wave
EMV_OK Successful.
EMV_SUM_ERR Check sum error.
Return Memory overflows
EMV_OVERFLOW (The maximum number of CAPK supported
is CLSS_MAX_KEY_NUM).
1. It is suggested to delete all CA Public Keys in the kernel at the
beginning of each transaction, and set the CA Public Key
according to the current application’s requirements. In this way,
Instruction the application only needs to set one CA Public Key each time.
2. If the public key is already exists, the new key will replace the
old one.
www.paxtechnology.com. 17
PAX CLSS L2 API Programming Guide
5.2 Clss_DelCAPK_Wave
EMV_OK Successful.
Return
EMV_NOT_FOUND The specified key is not found.
Instruction None
5.3 Clss_GetCAPK_Wave
EMV_OK Successful.
Return
EMV_NOT_FOUND The specified key is not found.
Instruction None
5.4 Clss_DelAllCAPK_Wave
Parameters None
Return None
Instruction It is suggested to call this function to delete all CA Public Keys in the
www.paxtechnology.com. 18
PAX CLSS L2 API Programming Guide
www.paxtechnology.com. 19
PAX CLSS L2 API Programming Guide
6.1 Clss_AddRevocList_Wave
EMV_OK Successful.
EMV_DATA_ERR Input data error (the pointer is null).
Return Memory overflows
EMV_OVERFLOW (The maximum number of revoked issuer
public key certificates supported is
www.paxtechnology.com. 20
PAX CLSS L2 API Programming Guide
MAX_REVOCLIST_NUM )
If the revoked issuer public key certificate already exists, this
Instruction function directly returns success.
6.2 Clss_DelRevocList_Wave
EMV_OK Successful.
Return EMV_DATA_ERR Input data error (the pointer is null).
EMV_NOT_FOUND The specified certificate is not found.
Instruction None
6.3 Clss_DelAllRevocList_Wave
Parameters None
Return None
Instruction None
www.paxtechnology.com. 21
PAX CLSS L2 API Programming Guide
7 Transaction Processing
Functions
7.1 Clss_SetFinalSelectData_Wave
EMV_OK Successful.
CLSS_PARAM_ERR Parameter error.
www.paxtechnology.com. 22
PAX CLSS L2 API Programming Guide
processing.
(Both full matches and partial match are allowed for the program ID
comparison, for example: the program ID saved in the terminal is 01
02, it can be matched by the value 01 02 or 01 02 03 of the program
ID (9F5A), while it cannot be matched by the value 01 of the
program ID (9F5A))
1. Kernel execute DRL processing:(new method) Set the DRL
parameter into the kernel with Clss_SetDRLParam_Wave. The
kernel will execute the DRL processing.
2. Applicaiton execute DRL processing:(old method)
a. Delete all pre-processing parameters with
Clss_DelAllPreProcInfo.
b. Add the DRL parameter to the Entry kernel with
Clss_SetPreProcInfo_Entry.
c. Call Clss_PreTransProc_Entry to redo the
pre-processing. The return code of
Clss_PreTransProc_Entry shall be ignored.
Please note that It is necessary to set the pre-processing
parameters of all AIDs into the entry kernel again before
calling Clss_PreTransProc_Entry for the first time for the
next transaction.
7.2 Clss_SetTransData_Wave
www.paxtechnology.com. 23
PAX CLSS L2 API Programming Guide
7.3 Clss_Proctrans_Wave
AC type
Parameters (It is effective only when EMV_OK is
returned):
pucACType(output)
AC_ AAC: Decline
AC_ TC: Offline Approve
AC_ ARQC: Online Request
EMV_OK Successful.
CLSS_PARAM_ERR Parameter error.
Contactless transaction limit is exceeded
or GPO response code is 6985.
CLSS_RESELECT_APP Delete the current application from the
candidate list, and then execute final
Return selection again to select the next
application.
Terminate the CLSS transaction and use
CLSS_USE_CONTACT the contact interface to process the
transaction instead.
www.paxtechnology.com. 24
PAX CLSS L2 API Programming Guide
7.4 Clss_GetMSDType_Wave
CLSS_VISA_MSD_CVN17:CVN 17
Parameters ucMSDType (output)
CLSS_VISA_MSD_LEGACY: CVN
Legacy
www.paxtechnology.com. 25
PAX CLSS L2 API Programming Guide
7.5 Clss_CardAuth_Wave
EMV_OK Successful.
CLSS_USE_CONTACT Use other transaction interface.
EMV_DATA_ERR Data Error.
Return
Please refer to the document “PAX CLSS
L2 API Programming Guide For
Other
Common Definition” for the macro
definition of the return code.
1. After this function is successfully performed, the application shall
continue with the subsequence process according to the AC type
Instruction returned in pucACType. (Such as offline approval, offline
decline, or online authorization).
2. If pucACType is AC_ AAC, decline the transaction immediately.
7.6 Clss_GetCvmType_Wave
www.paxtechnology.com. 26
PAX CLSS L2 API Programming Guide
CVM Type
RD_CVM_NO: No CVM.
RD_CVM_ONLINE_PIN: Online PIN
RD_CVM_SIG: Signature
RD_CVM_CONSUMER_DEVICE: See
Parameters pucType(output)
your phone (Look at the mobile device to
obtain further instructions).
Please refer to document “PAX CLSS L2
API Programming Guide For Common
Definition” for the macro definition of
the CVM method.
EMV_OK Successful.
CLSS_DECLINE Decline the transaction.
Return Please refer to the document “PAX CLSS
L2 API Programming Guide For
Other
Common Definition” for the macro
definition of the return code.
Instruction For online PIN, the application should perform online processing.
7.7 Clss_nGetTrack1MapData_Wave
7.8 Clss_nGetTrack2MapData_Wave
www.paxtechnology.com. 27
PAX CLSS L2 API Programming Guide
7.9 Clss_ProcRestric_Wave
Parameters None
EMV_OK Successful.
Please refer to the document “PAX CLSS
Return L2 API Programming Guide For
Other
Common Definition” for the macro
definition of the return code.
1. The exception files checking is implemented by the application.
When the card returns TC, the application should first check the
exception file. If the PAN is in the exception file, the application
Instruction should decline the transaction immediately, otherwise, call this
function.
2. This function shall be called after Clss_Proctrans_Wave
7.10 Clss_IssuerAuth_Wave
EMV_OK Successful.
7.11 Clss_IssScriptProc_Wave
EMV_OK Successful.
Please refer to the document “PAX CLSS
Return L2 API Programming Guide For
Other
Common Definition” for the macro
definition of the return code.
1. If an issuer script is received, please call this function to process
the script.
2. The application should send the SELECT command first to select
the Final AID(tag “4F”) of the current transaction by using
Instruction DEVICE_IccCommand. Please refer to the transaction flow in
section 3.1. If it has been done before the issuer authentication
processing, there is no need to send the SELECT command again.
3. The Issuer Script Result can be obtained by calling
Clss_GetTLVData_Wave to get the value of tag 9F5B.
7.12 Clss_SetDDAOmitFlag_Wave
www.paxtechnology.com. 29
PAX CLSS L2 API Programming Guide
www.paxtechnology.com. 30
PAX CLSS L2 API Programming Guide
8 Debug Function
8.1 Clss_GetDebugInfo_Wave
Parameters paucAssistInfo
RFU (NULL can be used)
(output)
EMV_OK Successful
Return
EMV_PARAM_ERR The parameters are error.
1. This function is only used to obtain the debug information when
a transaction is failed.
Instruction 2. So far, it only can be used to obtain the error code of offline data
authorization and CLSS_API_ORDER_ERR.
www.paxtechnology.com. 31
PAX CLSS L2 API Programming Guide
1 Authority Public Key Index does not exist. Check the card data
2 Issuer Public Key Certificate does not exist. Check the card data
3 Issuer Public key Exponent does not exist. Check the card data
4 The CAPK indicated by Authority Public Key Check if the CAPK indicated
Index does not exist in the kernel. by the Authority Public Key
Index has been added in the
kernel by
Clss_AddCAPK_Wave
Issuer Public Key Certificate has a length Check CAPK data and the card
5
different from the length of the Certification data
Authority Public Key Modulus
Recovered Data Header is not equal to '6A', Check the card data
6
Recovered Data Trailer is not equal to 'BC' Check the card data
8
9 The Length of the Issuer Public Key recovered is Check the card data
not equal to the actual length
10 The hash result calculated is not equal to the hash Check CAPK data and the card
result recovered. data
Issuer Identifier does not match the left 3-8 PAN Check the card data
11
digits
The issuer public key certificate has expired Check the card data
12
13 Hash Algorithm Indicator or Issuer Public Key Check the card data
Algorithm Indicator is not recognized
21 ICC Public Key Certificate does not exist. Check the card data
22 ICC Public Key Exponent does not exist. Check the card data
23 ICC Public Key Certificate has a length different Check the card data
from the length of the Issuer Public Key Modulus
www.paxtechnology.com. 32
PAX CLSS L2 API Programming Guide
24 Recovered Data Header is not equal to '6A', Check the card data
26 Recovered Data Trailer is not equal to 'BC' Check the card data
27 The Length of the ICC Public Key recovered is Check the card data
not equal to the actual length
28 Static Data Authentication Tag List exists and Check the card data
contains tags other than '82'
29 The hash result calculated is not equal to the hash Check the card data
result recovered.
30 Recovered PAN is not the same as the Application Check the card data
PAN read from the ICC.
31 The ICC public key certificate has expired Check the card data
32 ICC Public Key Algorithm Indicator is not Check the card data
recognized
41 Signed Static Application Data does not exist. Check the card data
42 Signed Static Application Data has a length Check the card data
different from the length of the Issuer Public Key
Modulus
43 Recovered Data Header is not equal to '6A'. Check the card data
44 Signed Data Format is not equal to '03' Check the card data
45 Recovered Data Trailer is not equal to 'BC' Check the card data
www.paxtechnology.com. 33
PAX CLSS L2 API Programming Guide
90 The response data is ‘77’, and the TLV format is Check the card data
error
91 The Signed Dynamic Application Data has a Check the card data
length different from the length of the ICC Public
Key Modulus
92 Recovered Data Header is not equal to '6A'. Check the card data
93 Signed Data Format is not equal to '05' Check the card data
94 Recovered Data Trailer is not equal to 'BC' Check the card data
fDDA Fail
108 The Length Of Signed Dynamic Application Check the card data
Data(9F4B) Is Not Equal To The Length Of
Card’s Public Key
109 Recovered Data Header is not equal to '6A'. Check the card data
www.paxtechnology.com. 34
PAX CLSS L2 API Programming Guide
111 Recovered Data Trailer is not equal to 'BC' Check the card data
113 The ICC Dynamic Data Length recovered is Check the card data
greater than 8
301 Clss_CoreInit_Wave has not been called. This function must be called after
Clss_CoreInit_Wave.
302 Clss_SetFinalSelectData_Wave has not been This function must be called after
called. Clss_SetFinalSelectData_Wave.
www.paxtechnology.com. 35
PAX CLSS L2 API Programming Guide