Verix Verix V EMV Module Reference Manual
Verix Verix V EMV Module Reference Manual
Reference Manual
PINpad Verifone, the Verifone logo, Omni, VeriCentre, Verix, Verix V and ZonTalk are registered trademarks of Verifone. Other brand
names or trademarks associated with Verifone’s products and services are trademarks of Verifone Systems.
All other brand names and trademarks appearing in this manual are the property of their respective holders.
Comments? Please e-mail all comments on this document to your local Verifone Support Team.
Verifone Inc.
1-800-Verifone
www.verifone.com
Verifone Part Number 23271, Revision T
CONTENTS
PREFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Target Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Document Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Conventions, Acronyms and Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
CHAPTER 1
EMV Module EMV Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Architecture Advantages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Multi-Config Certification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
CHAPTER 2
Verix/Verix V EMV Data Table Structures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Module Data EST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Tables MVT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Sample Configuration Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Editing the EST/MVT Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Building EST Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Building MVT Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
CHAPTER 3
Verix/Verix V EMV Higher Level Function Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Module Function inVXEMVAPSCInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Calls inVXEMVAPTransInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
inVXEMVAPCardPresent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
inVXEMVAPCardInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
inVXEMVAPCheckFallback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
inVXEMVAPSelectApplication() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
inVXEMVAPPerformGPO() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
inVXEMVAPProcessAFL() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
inVXEMVAPDataAuthentication() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
inVXEMVAPProcRisk() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
inVXEMVAPVerifyCardholder() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
inVXEMVAPFirstGenerateAC() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
inVXEMVAPUseHostData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
inVXEMVAPGetCardConfig() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
inVXEMVAPRemoveCard() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
inVXEMVAPKeyRevocation() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
inVXEMVAPSetFunctionality() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
inVXEMVAPSetDisplayPINPrompt() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
inVXEMVAPInitCardslot() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
inVXEMVAPCloseCardslot() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
inVXEMVAPKeyRollOver() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Lower Level Function Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
inVXEMVAPProcRestrictions() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
inVXEMVAPTermRisk() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
inVXEMVAPGetCAPK() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
inVXEMVAPSecondGenerateAC() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
inVXEMVAPProcessScript() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
inVXEMVAPAuthIssuer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
inVXEMVAPAPDU() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
inVXEMVAPSetDefDDOL() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
inVXEMVAPSetDefTDOL() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
inVXEMVAPSetTACs() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
inVXEMVAPSetROSParams() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
usVXEMVAPGetVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
vdSetCAPKExpiryCheck() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
vdSetConfigOption() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Data Object Collection Access Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
usEMVGetTxnStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
usEMVSetTxnStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
usEMVAddTLVToCollxn() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
usEMVGetTLVFromColxn() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
usEMVUpdateTLVInCollxn() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
usEMVRetrieveTLVFromColxn() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
CHAPTER 4
EMV Library getLastTxnAmt() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Callback Function getTerminalParam() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Calls getCapkExp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
getUsrPin() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
getXUsrPin() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
usEMVDisplayErrorPrompt() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
usEMVPerformSignature() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
usEMVPerformOnlinePIN() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
usEMVIssAcqCVM(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
displayPINPrompt() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
bIsMultipleOccurencesAllowed() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
usGetBypassDecsn() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
usGetTermAVN() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
usGetExtAuthDecision() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
usGetPOSDecsn() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
vdSelPreferredLang() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
usPinInfo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
CHAPTER 5
EMV Module bIsCardBlackListed() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Callback Function bIsCSNValid(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Calls inGetPTermID() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
inMenuFunc() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
usAmtEntryFunc(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
usCandListModify(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
vdPromptManager() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
CHAPTER 6
Building an EMV Setting the Transaction Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Application TVR/TSI Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Proprietary Data Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
CHAPTER 7
Implementation Transaction Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Online Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Notes on Online General Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
APPENDIX A
File Formats for . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Storing CAPKs
APPENDIX B
File Formats for . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Revoked Issuer PK
CSNs
APPENDIX C
Function Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
of the Callback
Function
APPENDIX D
Second . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Application
Version Number in
EST
APPENDIX E
Generic Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Returned by the
Library
APPENDIX F
Sample Files EST and MVT Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
ADK Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
XML Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
APPENDIX G
Relevant EMV Data Application Interchange Profile (AIP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Objects Application Usage Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Terminal Verification Results (TVR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Transaction Status Information (TSI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Terminal Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Additional Terminal Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Terminal Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Cardholder Verification Rule Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
VERIX/VERIX V EMV MODULE REFERENCE MANUAL 5
C ONTENTS
APPENDIX H
Terminal Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Code
APPENDIX I
EMV Configuration inVXEMVAPConvertConfigData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Data Update inVxEMVAPUpdateConfigData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
usModifyESTXML() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
usModifyMVTXML() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
usModifyKEYSXML() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
inVXEMVAPGetLastErrCode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
ICCKey File Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
ICCData File Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Backward Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
APPENDIX J
Sample Format Config File as Text Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Files ICCKeys.key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
ICCData File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Config File as XML Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
EST.XML File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Keys.XML File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
MVT.XML File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Config File as ADK File Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
EMV_ApplicationsXML File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
EMV_Keys XML File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
EMV_Terminal XML File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
APPENDIX K
Configurable CDA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Mode for Online
Transactions
APPENDIX L
PIN Bypass and . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
PIN Cancel
Initiated from POS/
External Device
APPENDIX M
Double PIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Bypass Support
This is the Module Reference Manual for Vx EMV Module 8.0.0. EMV Module is a
suite that comprises of EMV Module, EMV Library and CardSlot Libraries. EMV
Module acts as an interface between the application and EMV Library. The
application developers can develop EMV based solutions using the EMV Module.
The Test Harness application is packaged along with the suite where application
developers can use it as a reference to create their own applications.
EMV Module supports EMV ICC card functionality on all Verix and Verix V-based
terminals. The function calls are platform independent, and are easily portable to
any Verix and Verix V-based terminals where the EMV Library is available.
The EMV Module supports entire EMV functionality.
Target This document is intended to the application developers who can develop the
Audience EMV based solutions.
Conventions, The following conventions assist the reader to distinguish between different kinds
Acronyms and of information.
Terminology • The courier typeface is used for code entries, filenames, and anything that
might require typing at the DOS prompt or from the terminal keypad.
• The italic typeface indicates book title or emphasis.
• Text in blue indicates terms that are cross-referenced. When the pointer is
placed over these references the pointer changes to the finger pointer,
indicating a link. Click on the link to view the topic.
NOTE
Note points out interesting and useful information.
CAUTION
Caution points out potential programming problems.
EMV Module
• Defines and mandates EMV transaction flow.
• Defines table-driven approach for maintaining configurable parameters.
Refer to the Verix/Verix V EMV Module Data Tables chapter for more
details.
• Defines the function calls for performing an EMV transaction.
• Implements few library callback functions. Refer to the EMV Library
Callback Function Calls chapter for more details.
• Defines callback APIs that have to be implemented by the application.
Refer to the EMV Module Callback Function Calls chapter for more details.
• Interacts with the application to obtain required data (for example, risk
management data).
• Interacts with the EMV Library for various steps such as, application
selection, data authentication, etc.
• Defines default implementation that can be overridden by the application
for certain features (for example, blacklisted card support, split sales or
fallback processing).
EMV Library
• Implements the EMV 4.3 specification.
• Defines standard function calls to develop EMV-based applications.
• Defines the callback functions that should be implemented by the
application. For example, to obtain the PIN from the user, the library calls
getUsrPin() API. This API should be implemented by the application to
handle the UI. Some EMV Library callback APIs are implemented by the
EMV Module.
• Maintains the data such as, TVR/TSI and DOLs by the EMV Library.
• Interacts with the CardSlot Library to communicate with smartcards.
NOTE EMV Library uses the following data files, DUP.dat, LT.dat, MAN.dat,
SAT.dat, TAG.dat, TEMT.dat during the transaction flow for parsing and
validating the card responses. It is mandated that these data files should be
downloaded to the terminal along with the libraries and kernel application binaries
to complete the transaction successfully. These data files are present under the
location C:\VerixAps\VXEMVAP\Resources folder.
CardSlot Library
• Provides a standard way to communicate with synchronous and
asynchronous cards.
• Defines the standard function calls for application to communicate with
smartcard reader and smartcards.
• Masks device-level functionality from the higher layers.
• Implements ISO and EMV standards to communicate with smartcards,
using the device-level drivers.
Advantages • The generic EMV Module need not be changed to implement issuer-specific
or acquirer-specific implementations.
• Applications can customize bank-specific and issuer-specific operations that
do not affect the EMV transaction flow.
Multi-Config EMVCo allows application providers to define, submit and test application kernels
Certification for multiple pre-defined configurations with the same test submission. While an
initial baseline configuration will be fully tested, all subsequent pre-defined
configurations will be subjected to limited incremental and regression testing.
EMVCo requires a checksum (4-20 characters) to be generated and associated
with each kernel configuration. The method or algorithm used to generate the
checksum is left to the discretion of the vendor, provided that, it results in a unique
value per kernel configuration. For example, the checksum could be derived from
only the configuration settings or the entire kernel. This value should be easily
retrievable in the application kernel for comparison. (A supported algorithm
example might be SHA-1.) This requirement is applicable to both static and
configurable kernels.
Following are the identified additional pre-requisites for an application provider to
obtain an approval for a multiple configuration kernel:
• The kernel should have configurable options.
• Changing the options should not require any re-compilation or linkage of the
application kernel code.
• The laboratory must be able to change the configuration easily.
• The vendor shall generate a unique checksum for each supported
configuration. The method or algorithm used for generating this checksum is
left to the discretion of the vendor, provided, it produces a unique value per
configuration. This checksum associated with the configuration in use should
be stored in the application kernel and should be easily retrievable for
examination.
The EMV Module is architected with a data driven approach. The EMV Module
provides a set of configurable data tables to support different combinations of
scheme data. The application specific data is stored in the EST (EMV Card
Scheme Table), and the transaction specific data is stored in the MVT (General
EMV Configuration data table).
EMV Module allows the EST.dat file to have multiple EST records configured for
the same RID, which contain different set of AIDs of the same scheme. These
multiple EST records are configured to the same or different MVT records based
on the requirement. This allows configuring different set of scheme specific values
to different set of AIDs of the same scheme.
A set of functions (refer to the Lower Level Function Calls and Editing the EST/
MVT Fields sections for more details) are also provided to enable the applications
to directly modify the fields of the table. This chapter discusses in detail about the
definition of the table and the way it is used by the application.
Data Table This section describes the EST and MVT structures.
Structures
EST The EST consists of EMV-related data that are categorized according to card
scheme (Visa, MasterCard, Amex, etc.). The EST can have multiple records with
each record specifying one supported card scheme. A single scheme may have
multiple records if the supported CAPK files are more than 15 or the supported
AIDs are more than 10 per scheme. All the records are read to find the matching
CAPK or supported AIDs. The scheme data should be stored in the EST.txt file
and should be converted to EST.dat data file using the gendata.exe File
Conversion Tool, which is available as a part of the package.
NOTE
Upon start-up, the EST record 0 is loaded. After selecting the application, the
appropriate EST record with the matching AID is loaded.
Refer to the Sample Files chapter for the EST.dat file that is packaged with the
EMV Module. The EST.txt file is built and the EST.dat data file is downloaded
to the terminal along with the application. The EMV Module loads the EST.dat
data file to the memory once the card is inserted. During application selection, the
data is read from the records of the EST.dat data file. The data of the matching
record is stored in an internal structure and used for the rest of the transaction.
Scheme label Yes 34 char* 0-16 This field is used to identify the
bytes card scheme name. For example,
Visa, MasterCard etc.
Note: By default, record 1 is VISA, record 2 is MASTERCARD and record 3 is JCB.
RID Yes 12 char* 5 bytes This field is used to store the RID
(Registered application provider
Identifier) specific to the card
scheme name. For example, Visa
scheme RID is A000000003, and
MasterCard scheme RID is
A000000004. This is used to
perform any scheme specific data
handling/operations recommended
by the issuer/acquirer.
Note: The RID is specific to a scheme. If the user changes the default record from VISA to MASTERCARD, then
the RID should be changed to A000000004.
CAPK File Details
CAPK file1- CAPK file Yes The next set of fields, CAPK File
15 Index, CAPK file name and Expiry
Date, provide the data to access
the CAPK files used for data
authentication. These keys can be
quite large (up to 248 bytes), so the
keys are not stored in the EST.
User can configure up to 15 CAPK
files per scheme. This field has 3
sub fields.
Note: The CAPK File Index, CAPK file name and Expiry Date can be changed for the CAPK files that are
supported for the scheme. Only 15 CAPK files per record are allowed. Ensure that the CAPK Index is a
decimal equivalent of the CAPK File Index.
For example, if the CAPK Index in the card is 0xF8, then the field for CAPK Index in the EST will be 248.
CAPK file name should be the same as the one that is downloaded to the terminal.
CAPK file name1- 32 char* 16 bytes Defines the file name exponent of
CAPK file name15 Certificate Authority. Refer to the
File Formats for Storing CAPKs
chapter for the format of the file.
Expiry Date1-Expiry 8 char* 3 bytes Defines the expiry date of the
Date15 CAPK file.
The expiry date is in dd/mm/yy
format.
Note: This is not a mandatory
field.
Application Identifier Details
Supported AID1- Yes 34 char* 5-16 Used to store the AID supported by
AID10 bytes the application. For example, for
the RID, A000000003, the
possible supported AIDs are
A0000000031010 and
A0000000032020.
Note:
• For example, for VISA scheme, one of the supported AIDs can be A0000000031010. Users can change as per
their requirements ensuring that the RID should be same as the first 5 bytes of the supported AID. Currently, 10
AIDs per record are supported.
• If the partial name selection is enabled, then no two AIDs can have the same partial name. For example,
A000000003101003 and A000000003101004 are not allowed.
Note: A value of 1 indicates that partial name selection is not allowed for this AID. A value of 2 indicates that the
partial name selection is allowed for this AID.
Note: This value can be changed by the user. But the user should ensure that the terminal version number and
the card version number matches.
SecondTerminal Yes 6 char* 2 bytes Used to store the second possible
Application Version terminal AVN for the AID.
Number1-10
Refer to Second Application Version Number in EST appendix for more details.
Note: This field is used for displaying the AID name for cardholder confirmation, only if the application label and
the application preferred name are not present in the card.
MVT The MVT contains all general EMV-related configuration data. Each record
contains the information required by a particular entity. The entities involved are:
• card scheme
• card issuer
• card acquirer
• terminal
The terminal record specifies all data that is independent of scheme, issuer or
acquirer. The user can have different records for different schemes. In the
scheme-specific records, the user should fill in the scheme-specific details.
The data in each record can be specific to an issuer/acquirer or a scheme. The
records can be chained (each record has an index that can point to another
record). For example, an issuer may have just one entry point into the table but
can have several records chained together, one for each card scheme.
NOTE The MVT record number 0 is loaded on start-up. Once the application is selected,
the appropriate MVT as referenced in the EST is loaded. Refer to
EMVTableRecord field under EST for more details.
TAC Denial Yes 11 char* 5 bytes 0010000000 Specifies the acquirer's conditions
that cause the denial of a
transaction without attempting to
go online.
Note: TAC Denial is dependent on the application user.
TAC Online Yes 11 char* 5 bytes D84000F80 Specifies the acquirer's conditions
0 that cause a transaction to go
online.
Based on the values mentioned in
the denial and online, the
transaction will go online, or
decline or approve. The values
mentioned are compared with the
TVR status and the Issuer Action
Code (IAC) values.
For example,
"D84000A800" "TAC
Default"
"0010000000" "TAC Denial"
"D84000F800" "TAC Online"
The terminal’s decision to
approve or decline a transaction
is sent as the result of the TAC.
Finally, the card decides on the
status of the transaction.
Note: TAC Online is dependent on the application user.
Generic Data
Fallback Yes 2 short 0 or 1 0 Specifies the value of the flag. If
allowed flag this is set to 1, fallback is allowed.
Note: Ensure that the value of this field is not set to -1 and that the next record value does not have the same
record number as the record that has called it. For example, record 1 cannot have the next record value as
1. Also, if record 1 has the next record field as 2, record 2 should not have the next record field as 1.
Note: EMV Terminal Capabilities should not be changed as the EMV Module is certified based on the terminal
capabilities.
EMV Yes 12 char* 5 bytes F000F0A00 Specifies the data input and
Terminal 1 output capabilities of the terminal.
Additional This is a five bytes value which
Capabilities defines the additional capabilities
of the terminal. For example, F0
00 F0 F0 01. Refer to the
Additional Terminal Capabilities
section for more details on the
significance of each bit.
Note: EMV Terminal Additional Capabilities can be changed if the user wants to add support for advice.
Sample Sample configuration data files are included as a part of the Test Harness
Configuration application. Refer to the Test Harness application for using the sample EST.dat
Data Files and MVT.dat files. The sample EST and MVT files are available in the following
location:
C:\VerixAps\VXEMVAP\Resources, where C:\VerixAps\VXEMVAP is the
default installation directory.
Editing the Verifone has provided a set of function calls for changing the EST/MVT structure
EST/MVT values. The selected EST/MVT structure variables can be modified by using the
Fields set() functions provided for each field. If the application needs to get a value for
a particular variable from the structure, use the get() functions provided in the
EMV Module.
For example,
• to get the forced online flag from the loaded MVT structure, call
inGetMerchantForcedOnlineFlag() API.
• to set the forced online flag for the particular transaction, call
vdSetMerchantForcedOnlineFlag(flag) API.
The function prototypes are in the mvtfuncs.h and estfuncs.h include files.
Building EST Files Application developer can make required changes to EST.txt file. The EST.txt
file should be converted to EST.dat data file using gendata.exe File
Conversion Tool.
Execute the following statement to convert the text file to binary. It is assumed that
both gendata.exe and EST.txt file are available in the same location.
After execution, EST.dat file is generated. This file should be downloaded along
with the application.
Building MVT Files Application developer can make required changes to MVT.txt file. The MVT.txt
file should be converted to MVT.dat file using gendata.exe File Conversion
Tool.
Execute the following statement to convert the text file to binary. It is assumed that
both gendata.exe and MVT.txt file are available in the same location.
After execution, MVT.dat file is generated; this file should be downloaded along
with the application.
This chapter lists the APIs that can be used by an application to perform an EMV
based transaction. The required steps to perform an EMV transaction are
summarized in Figure 3.
A successful EMV transaction mandates that specific activities should be carried
out in a specific order by the application.
The amount entry should be implemented appropriately. The application should
examine the data object cryptogram information data (9F27 tag) to decide going
online, offline accepted, and offline declined.
DETECT CARD
SELECT APPLICATION
READ APPLICATION
DATA
DATA
AUTHENTICATION
PROCESSING
RESTRICTIONS
TRM
CARDHOLDER
VERIFICATION
TERMINAL ACTION
ANALYSIS
CARD GENERATES
FIRST CRYPTOGRAM
TERMINATE
CARDSLOT
Higher Level All these function calls return SUCCESS (0) or an error condition (a non-zero
Function Calls value). The error values are defined in VXEMVAPDEF.H header file.
When new tagged EMV data is extracted from the card or assigned by the EMV
Module as configuration data, it is placed in a DOC data structure maintained by
the EMV Library. The application may modify some of the tagged data objects.
This can be performed using Data Object Collection Access Functions.
For some of these functions, a prompt manager function must be provided to
handle all required messages and error conditions. It is assumed that there is
usually one general prompt manager that handles all conditions required for an
EMV transaction. The prompt manager function always expects an integer
argument that corresponds to the prompt or error condition that needs to be
displayed.
The higher level function calls listed below are included in the VXEMVAP.H header
file.
inVXEMVAPSCInit()
This function opens the smartcard reader, initializes the EMV configuration data
and builds a list of supported applications from the Card Scheme data table. This
function also validates if the terminal is Vx700 and returns an error as EMV kernel
doesn’t support Vx700 terminal and external smartcard reader. This validation is
not supported for Vx UPT EMV Modules.
NOTE
inVXEMVAPSCInit() API should be called only once after the terminal reboot.
Parameters None
Return Values
Success: 0
inVXEMVAPTransInit()
This function takes the configuration data that is not specific to any particular card,
and places it in the DOC along with the date and time.
Parameters
Input: inTerminalRecord Index of the MVT record that has to be
loaded. Default record (0) will be loaded if
the index is invalid.
inGetTermID() Changes the terminal ID as required by
the application. This is not a mandatory
parameter. To use the default system ID,
pass null value for this value.
Return Values
Success: 0
inVXEMVAPCardPresent()
Parameters None
Return Values
Success: 0 This value is returned when the card is
present.
inVXEMVAPCardInit()
This API establishes communication with an EMV card and powers ON the card.
inVXEMVAPCardInit() API sets the appropriate terminal-to-card communication
parameters.
inVXEMVAPCardInit() API fails, if the card is a non-EMV card.
Parameters None
Return Values
Success: 0 This value is returned when the initialization
is successful.
inVXEMVAPCheckFallback()
Parameters
Input: inOverrideChipScreen() Displays a message. For example,
“Override Chip Requirement? Yes/
No”.
Returns success if the operator chooses
Yes (i.e., continue with the magnetic stripe
transaction).
szServiceCode Indicates whether to use a magnetic card/
chip card or not.
vdPromptManager() Displays the appropriate error messages.
incondition Parameter of vdPromptManager() function.
Refer to the usCandListModify() function for
more details.
Return Values
Success: 0 This value is returned if the terminal is
continuing with the magnetic stripe
transaction.
NOTE Application can decide to support fallback or not by setting the Fallback
Allowed flag to either 1 or 0 in the MVT. Refer to the Verix/Verix V EMV Module
Data Tables chapter for more details on MVT.
inVXEMVAPSelectApplication()
This function selects the EMV application and searches for the PSE file on the
card. If the file is found, the application is selected, else explicit option is used
(refer to the EMV documents listed in References section for more details). This
function uses the list of supported applications built in inVXEMVAPSCInit() API.
If the bit 8 of the short RFU1 field is set in the MVT default record, then
inVXEMVAPSelectApplication() API performs the application selection and
returns back to the application. In this scenario the application can fetch the finally
selected AID from the collection and can decide on further processing. If the
application wants to continue with the EMV processing, then the application can
invoke inVXEMVAPPerformGPO() API that is new.
If the bit 8 of the short RFU1 field is not set in the default record of MVT, then the
existing inVXEMVAPSelectApplication() API performs both application selection
and GPO.
If the selected application is Easy Entry (as defined in VIS), the Easy Entry
condition value is returned.
Parameters
Input: inSelectMethodFlag The EMV auto application selection flag
value from the MVT should be passed. The
recommended value is 0.
Note: The value for this parameter is taken from
the default record of the MVT. This data is
not scheme specific.
CAUTION
Extreme care should be taken while modifying the srAIDList structure.
Transaction may be affected if the candidate list is not handled carefully.
Return Values
Success: 0 This value is returned when the
application selection is successful.
inVXEMVAPPerformGPO()
This API initiates the application selected on the card by sending a GPO
command. This API should be called only if the short RFU1 field of default record
in MVT has the bit 8 set and the application wants to continue the EMV
transaction flow. If the bit 8 of the short RFU1 field in the MVT default record is set,
then inVXEMVAPSelectApplication() API only performs the application selection.
The prerequisite for this API is that the application should have called the
inVXEMVAPSelectApplication() API and the MVT's default record has bit 8 set for
the short RFU1 field.
This API performs the following:
1 If the PDOL has requested for amount or account type, then invoke
usAmtEntryFunc() application callback API to accept the same.
2 Initiate the application by sending the GPO command.
3 If the card has returned the status word as 0x6985 (SW1,SW2) for the GPO
command, then this API performs the final application selection after
removing the specific AID from the candidate list for which GPO command
has returned the status word as 0x6985. After successful final application
selection, GPO is performed by the EMV Module.
Parameters
None
Return Values
Success: EMV_SUCCESS This value is returned when get processing
options are completed successfully.
NOTE If the application invokes inVXEMVAPPerformGPO() API even after the failure
of inVXEMVAPSelectApplication() API, then the EMV kernel sends the
GPO command that results in a failure.
inVXEMVAPProcessAFL()
This function obtains the AFL from the DOC and uses it to locate the files
associated with the selected card application. This function then reads all
appropriate records from these files, extracts the data, and places it in the DOC.
This function checks for the presence of mandatory data objects. It also ensures
that a data object does not occur more than once. It also builds up the
concatenated static data required for data authentication (refer to the EMV
specifications listed in References section for more details).
Parameters None
Return Values
Success: 0 This value is returned if the read
application data command is successful.
inVXEMVAPDataAuthentication()
This function obtains the relevant cryptographic data from the DOC and uses it to
perform SDA (Static Data Authentication), DDA (Dynamic Data Authentication), or
CDDA (Combined DDA/AC), as required, as described in the EMV specifications
listed in References section. inVXEMVAPDataAuthentication() API obtains the
relevant CAPK from the appropriate configuration file (refer to the File Formats for
Storing CAPKs chapter for more details) and checks the issuer public key
certificate serial number against the list of revoked serial numbers stored in the file
(refer to the File Formats for Revoked Issuer PK CSNs chapter for more details). It
appropriately adjusts the values of the TVR and TSI in the DOC.
If the card does not support SDA, DDA or CDDA,
inVXEMVAPDataAuthentication() API returns SUCCESS, and set the TVR bits for
Data authentication not performed.
inVXEMVAPDataAuthentication() API invokes the following library callback
functions:
• getCapkExp()
• getTerminalParam()
• usEMVDisplayErrorPrompt()
Parameters
Input: bIsCSNValid() Checks the CSN details in the CSN List (a field in
the EST) file.
This function should be implemented to accomplish
validation, otherwise pass a null value.
CardCSN EMV Library fills the CardCSN parameter with the
card serial number.
Return Values
Success: 0 This value is returned if the SDA, DDA, or CDDA is
successfully performed.
inVXEMVAPProcRisk()
This function obtains the relevant data from the DOC (which should include the
transaction amount) and uses it to perform both the processing restrictions and
Terminal Risk Management procedures according to the EMV specifications listed
in References section. This function appropriately adjusts the values of the TVR
and TSI in the DOC.
The EMV kernel always performs Terminal Risk Management, irrespective of the
AIP bit setting for ‘TRM to be performed’ in the card.
NOTE
inVXEMVAPProcRisk() API should be called after amount has been entered.
Parameters
Input: bIsCardBlackListed() Checks the card details in the exception file.
This function should be implemented to
accomplish validation, else pass a null value.
Return Values
Success: 0
inVXEMVAPVerifyCardholder()
This function obtains the relevant data from the DOC (mainly, the CVM list, refer to
the Cardholder Verification Rule Format section for more details) and performs
cardholder verification (as described in the EMV specifications listed in
References section). This function then appropriately adjusts the values of the
TVR and TSI in the DOC. If the card does not support cardholder verification, this
function returns SUCCESS and the Cardholder Verification Performed
bit is not set in the TSI.
This function invokes the following library callback functions:
• getCapkExp()
• getUsrPin()
• getXUsrPin()
• usEMVDisplayErrorPrompt()
• usEMVPerformSignature()
• usEMVPerformOnlinePIN()
• usEMVIssAcqCVM()
• usGetBypassDecsn()
• usGetPOSDecsn()
For Vx UPT EMV Modules, usGetBypassDecsn() and usGetPOSDecsn()
callback functions are not invoked during PIN entry.
As part of cardholder verification:
• The EMV kernel supports POS/External Device initiated PIN Bypass and PIN
Cancel during a secure PIN Entry. Refer to Appendix L for more details
regarding this feature. This feature is not supported for Vx UPT EMV Modules.
• The EMV kernel supports double PIN bypass during secure PIN Entry. Refer
to Appendix M for more details regarding this feature. This feature is not
supported for Vx UPT EMV Modules.
• The EMV kernel is enhanced such that the application can enable or disable
the backspace key press during the PIN entry feature, that is if the backspace
key is pressed on the PIN Entry prompt and if the number of PIN digits entered
is zero, then the EMV kernel will return
E_USR_BACKSPACE_KEY_PRESSED value back to the application, so that
the application can go back to the previously prompted menu. Refer to
usEMVSetBackSpaceKeyFnlty() API in Verix/Verix V EMV Library
Programmers Manual for more details. This API need not be called for Vx UPT
EMV Modules.
• The EMV kernel is enhanced to provide an option to the application to get the
number of PIN digits entered during the PIN entry process so that the
application can provide this to the ECR/POS to display the respective number
Parameters
Input: bIsCSNValid() Checks the CSN details in the CSN List (a
field in the EST) file.
This function should be implemented to
accomplish validation, otherwise pass a null
value.
CardCSN EMV Library fills the CardCSN parameter with
the card serial number.
Return Values
Success: 0 This value is returned if the cardholder
verification is successful.
inVXEMVAPFirstGenerateAC()
This function enforces the merchant forced online option and performs TAA to
decide the type of cryptogram to request (refer to the EMV specification listed in
the References section for more details). It then updates the ARC tag based on
the TAA result.
The EMV Module updates the Cryptogram Information Data (CID, 9F27 tag) in
the DOC. The application will check the CID to decide on how to proceed with the
transaction (refer to the EMV specification listed in References section for more
details). For example, if the transaction is to be declined offline.
inVXEMVAPFirstGenerateAC() function invokes the getTerminalParam() library
callback function.
If CDDA is supported, it is performed as a part of Generate AC.
Parameters
Input: inTerminalDecision Enables the application to force the
transaction online or offline, or decline the
transaction. If the merchant is suspicious, they
can force online and contact the host for
approval. Valid values are:
• FORCED_ONLINE: enabled only when the
Merchant Forced Online flag is set in
the MVT for that particular scheme. If the
flag is disabled in the MVT, the merchant
cannot force the transaction online.
• FORCED_DECLINE: the merchant can
force decline the transaction using this
value.
• 0: no decision.
Return Values
Success: TC, AAC or ARQC is returned.
inVXEMVAPUseHostData()
This function obtains the data returned by the host after a transaction has gone
online and uses the data to perform the steps required to complete the
transaction. This always involves performing the Second Generate AC and can
also involve issuer authentication and issuer script processing, depending on the
data returned by the host and the processes supported by the card (refer to the
EMV specifications listed in References section for more details).
This function appropriately adjusts the values of the TVR and TSI in the DOC. The
application should check the CID to decide on how to complete the transaction.
All scripts returned by the host are written to the buffers.
NOTE If the card response for the Second Generate AC command is not valid, then the
EMV kernel terminates the transaction. But the 0x9F26 tag present in the DOC
will have the value received for the First Generate AC command response.
Parameters
Input: inHostDecision Host decision. Valid values are:
• HOST_AUTHORISED
• HOST_DECLINED
• FAILED_TO_CONNECT
Return Values
Success: 0 This value is returned when the transaction is
successfully completed.
inVXEMVAPGetCardConfig()
This API is called by the application to load an MVT record that is different from
the one that gets loaded after the final application selection. At least one of the
function arguments should be -1.
This function performs the following:
1 If the function argument inAquirerNumber is equal to x, where x is not
equal to -1 and inIssuerNumber is equal to -1, then it loads the MVT
record which has the issuer reference value as x. This forms the base record.
Then it perform the steps from a to c mentioned below.
2 If the function argument inIssuerNumber is equal to y, where y is not equal
to -1 and inAquirerNumber is equal to -1, then it loads the MVT record
which has the scheme reference value as y. This forms the base record.
Then it performs the steps from a to c as mentioned below.
a Checks if the newly loaded MVT record has MVT chaining enabled with a
value other than -1 for the inNextRecord field. If chaining is enabled, the
terminal loads the chained MVT record and updates the base record which
has default values as 0 or -1 or "" (NULL string) with the valid values
present in the chained record.
b Loads the MVT record pointed by the EST record, which has the finally
selected AID. Updates the latest base record for the fields with default
values as 0 or -1 or "" (NULL string) from the newly loaded MVT record,
which has valid values present. Check for the chaining of the record. If
chaining is available, load the chained record and update the latest base
record for the fields with default values as 0 or -1 or "" (NULL string) from
the newly loaded MVT record which has valid values present.
c Loads the default record present in MVT. Updates the latest base record
for the fields with default values as 0 or -1 or "" (NULL string) from the
newly loaded MVT record which has valid values present.
3 If both the function arguments are greater than 0 or are equal to -1, only then
steps b and c are performed.
Parameters
Input: inIssuerNumber Maps to the field "Scheme Reference" in MVT.
inAquirerNumber Maps to the field "Issuer Reference" in MVT.
Return Values
Success: 0 This value is returned upon successful execution of
this API.
inVXEMVAPRemoveCard()
This function displays an appropriate message, prompting card removal when the
transaction is complete.
Parameters
Input: vdPromptManager() Displays the “Remove Card” message.
incondition Parameter of vdPromptManager() function.
Refer to the usCandListModify() function for
more details.
Return Values
Success: 0 This value is returned when the message is
successfully displayed.
inVXEMVAPKeyRevocation()
This API reads each record of the EST.dat file and validates the CAPK expiry
date field with the terminal date. If the terminal date is greater than the CAPK
expiry date field, then the fields of that CAPK file (Index, File name and Expiry
date) are updated with null values and are saved into the EST.dat file. This API
will also remove this particular CAPK from the terminal if it is present, and the
terminal will be rebooted.
NOTE
Applications following XML approach of configuration need not call
inVXEMVAPKeyRevocation() API.
For example, in one of the EST records, if there is a CAPK with the following
fields:
248, /* "CAPK Index" */
"A000000004.F8", /* "CAPK File" */
"311206", /* "CAPK Expiry Date" */
and if the system date is the current date (090807), then the Key revocation API
will do the revocation process and update the above three fields to the following
values,
256, /* "CAPK Index" */
"", /* "CAPK File" */
"", /* "CAPK Expiry Date" */
and saves back in the EST.dat file.
The terminal will reboot after updating the CAPK fields to achieve contiguous
memory locations.
Parameters
None
Return Value:
Success: VS_SUCCESS This value is returned when there is no CAPK
to revocate based on expiry date in the EST
file. It reboots the terminal when it finds an
expired CAPK field in the EST after updating
and saving the fields with null values, and also
removes the CAPK files from the terminal
RAM.
Failure: None
inVXEMVAPSetFunctionality()
This function is used to set the function pointer of EMV Library callback functions
mentioned in EMV Library Callback Function Calls chapter. This API is called
during application initialization.
The application should call inVXEMVAPSetFunctionality() API only if any specific
functionality is required. The EMV Module will have default implementations for
each of the callback functions. However, for handling any specific application
functionality, the application should be changed to include a call to the
inVXEMVAPSetFunctionality() API with appropriate codes. The application should
also ensure that the correct functions are assigned to each of the codes that are
used.
Parameters
Input: usCode This value specifies the functionality for
which the API is being used.
Valid values are:
• GET_LAST_TXN_AMT
• GET_TERMINAL_PARAMETER
• GET_CAPK_DATA
• GET_USER_PIN
• IS_CSN_VALID
• DISPLAY_ERROR_PROMPT
• PERFORM_SIGNATURE
• PERFORM_ONLINE_PIN
• PERFORM_ISS_ACQ_CVM
• IS_CARD_BLACKLISTED
• IS_PARTIAL_SELECT_ALLOWED
• PERFORM_LANGUAGE_SEL
• GET_TERMINAL_AVN
• GET_TXN_AMT
• Get_EXT_AUTH_DECISION
• GET_POS_CVM_DECISION
• GET_BYPASS_DECISION
• GET_PIN_INFO
• GET_X_USER_PIN
Refer to the Function Pointers of the
Callback Function appendix for the
codes and associated functions.
fnPtrSet Pointer to the function that has been
implemented in the application.
Return Values
Success: EMV_SUCCESS This value is returned if the function
code is set correctly.
inVXEMVAPSetDisplayPINPrompt()
This function is used to set the function pointer of the EMV Library callback
function displayPINPrompt(). This API should be called before calling
inVXEMVAPVerifyCardholder() API.
Parameters
Input: fptr Pointer to displayPINPrompt() API in the application.
Return Values
Success: SUCCESS This value is returned if the function code is set
correctly.
NOTE
This API is not applicable for Vx UPT EMV Modules.
inVXEMVAPInitCardslot()
Parameters
None
Return Values
Success: SUCCESS This value is returned if the CardSlot
initialization is successful.
Backward Compatibility
All applications using Vx EMV Module should call inVXEMVAPInitCardslot() API
to open the CardSlot, as inVXEMVAPSCInit() API does not open the CardSlot.
inVXEMVAPCloseCardslot()
Parameters
None
Return Values
Success: SUCCESS This value is returned if the CardSlot is closed
successfully.
inVXEMVAPKeyRollOver()
NOTE
Applications following XML approach of configuration need not call
inVXEMVAPKeyRollOver() API.
Parameters
None
Return Values
Success: SUCCESS If the key rollover is performed successfully.
Backward Compatibility
No change is required for applications that do not require key rollover functionality.
Applications that need to use the key rollover functionality should call
inVXEMVAPKeyRollOver() API separately.
Lower Level This section lists and describes the function calls which are not mandatory while
Function Calls implementing EMV transaction. Whereas these function calls can be used to
implement EMV transaction for more flexibility.
For example, when an application does not require all of the EMV functionality or
where customer-specific card commands should be added.
All of these functions return SUCCESS (0) or an error condition (a non-zero
value). All error conditions are defined in VXEMVAPDEF.H header file.
inVXEMVAPProcRestrictions()
This function obtains the relevant data from the DOC and uses it to perform the
processing restrictions (as described in the EMV specifications listed in
References section). It also appropriately adjusts the value of the TVR in the
DOC.
Parameters
None
Return Values
Success: 0 This value is returned if the processing restrictions are
successful.
Failure: None
NOTE
inVXEMVAPProcRestrictions() API should be used only when
inVXEMVAPProcRisk() API is not being used.
inVXEMVAPTermRisk()
This function obtains the relevant data from the DOC and uses it to perform
Terminal Risk Management (as described in the EMV specifications listed in
References section). It appropriately adjusts the values of the TVR and TSI in the
DOC.
NOTE
inVXEMVAPTermRisk() API should be called after amount has been entered.
Parameters
Input: bIsCardBlackListed() Checks the card details in the exception file.
This function should be implemented to
accomplish validation, otherwise pass a null
value.
Return Values
Success: 0 This value is returned if Terminal Risk
Management is successfully performed.
inVXEMVAPGetCAPK()
This function obtains the appropriate CAPK Modulus and Exponent required for
SDA, DDA or CDDA. It accomplishes this by opening the relevant CAPK
configuration file (refer to the File Formats for Storing CAPKs chapter for more
details), and extracting the key in binary form.
NOTE
inVXEMVAPGetCAPK() API may be called if the application is using an SDA,
DDA, or CDDA module different from that provided in the EMV Module.
Parameters
Input: pAID AID of selected card application.
pCAPKIndex CAPK Index (8F tag) specified by the
card application.
Return Values
Success: 0 This value is returned if all the CAPK
elements are obtained successfully.
inVXEMVAPSecondGenerateAC()
Parameters
Input: inHostDecision Host decision. Valid values are:
• HOST_AUTHORISED
• HOST_DECLINED
• FAILED_TO_CONNECT
• OFFLINE_TERMINAL
Return Values
Success: 0 This value is returned when the Generate AC
command is generated successfully.
inVXEMVAPProcessScript()
This function obtains an issuer script received from the host and sends it to the
card (refer to the EMV specifications listed in References section for more
details). The application should ensure that scripts (71 and 72) received from the
host are written to buffers.
NOTE
inVXEMVAPProcessScript() API should be used only when
inVXEMVAPUseHostData() API is not being used.
Parameters
Input: pScript Issuer script.
Return Values
Success: 0 This value is returned if the script processing
is successful.
inVXEMVAPAuthIssuer()
This function obtains the issuer authentication data that the application received
from the host after going online, and performs issuer authentication (refer to the
EMV specifications listed in References section for more details). This function
then appropriately adjusts the values of the TVR and the TSI in the DOC. If issuer
authentication is not supported, inVXEMVAPAuthIssuer() API returns SUCCESS.
It is assumed that the issuer authentication data (0x91 tag) is in the DOC.
NOTE • Application has to ensure that the issuer authentication data received from
the host is updated in the 0x91 tag.
• inVXEMVAPAuthIssuer() API should be used only when
inVXEMVAPUseHostData() API is not being used.
Parameters
None
Return Values
Success: 0 This value is returned if the issuer
authentication is successful.
inVXEMVAPAPDU()
This function enables a standard ICC APDU command (EMV or non EMV) to be
sent to the card, as required. This function can be used to send non EMV
commands to the card. For example, any proprietary commands to be sent.
NOTE
inVXEMVAPAPDU() API can be called any time after the card has been powered
ON (by inVXEMVAPCardInit() API).
Prototype int inVXEMVAPAPDU(unsigned char *Header, unsigned char Lc, unsigned char
*SendData, unsigned char Le, unsigned
char *pReceiveDataLen, unsigned char *ReceivedData);
Parameters
Input: Header Four byte header, per ISO definition - CLA, INS,
P1, P2.
Lc Length of data sent to card.
SendData Buffer containing data to be sent. Can be null if
there is no data to be sent.
Le Maximum number of data bytes expected to be
received from card.
Return Values
Success: 0 This value is returned if the EMV commands are
successfully sent.
inVXEMVAPSetDefDDOL()
This function sets the default DDOL directly. This function is used when the
configuration data handling mechanism provided in the EMV Module is not
appropriate.
Parameters
Input: pDefDDOL Buffer containing the default DDOL.
inLenDefDDOL Length of the default DDOL.
Return Values
Success: 0 This value is returned if the DDOL is set
successfully.
NOTE
inVXEMVAPSetDefDDOL() API is not required if the default DDOL is updated in
the MVT.
inVXEMVAPSetDefTDOL()
This function sets the default TDOL directly. This function is used when the
configuration data handling mechanism provided in the EMV Module is not
appropriate.
Parameters
Input: pDefTDOL Buffer containing the default TDOL.
inLenDefTDOL Length of the default TDOL.
Return Values
Success: 0 This value is returned if the TDOL is set
successfully.
NOTE
inVXEMVAPSetDefTDOL() API is not required when TDOL is updated in the
MVT.
inVXEMVAPSetTACs()
This function sets the TACs directly. It is used where the configuration data
handling mechanism provided in the EMV Module is not appropriate.
Parameters
Input: pTACDecline Buffer containing the TAC decline (5 bytes).
pTACOnline Buffer containing the TAC online (5 bytes).
pTACDefault Buffer containing the TAC default (5 bytes).
Return Values
Success: 0 This value is returned if the TAC is set
successfully.
NOTE • inVXEMVAPSetTACs() API is not required if the TAC values are set in the
MVT.
• inVXEMVAPSetTACs() API may be required when the TACs frequently
change the First Generate AC.
inVXEMVAPSetROSParams()
This function sets the parameters for random online selection in the global
collection. It is used where the configuration data handling mechanism provided in
the EMV Module is not appropriate and should be changed for a particular
transaction.
The modified values are used only for that particular transaction and then revert to
their original values (obtained from the MVT) for the next transaction.
Parameters
Input: ulFloorLimit Floor limit.
ulRSThreshold Threshold value for biased random selection.
inRSTarget Target percentage for biased random selection.
inRSMax Maximum target percentage for biased random
selection.
Return Values
Success: 0 This value is returned if the risk management
parameters are set successfully.
Failure: None
usVXEMVAPGetVersion()
This function obtains the EMV Module version number. This can be used for
debugging purposes.
Parameters
Output: szVersionNo EMV Module fills the version number in this
buffer. Minimum size of the buffer should be 12
chars.
Return Values
Success: 0 This value is returned if the version number is
successfully copied.
vdSetCAPKExpiryCheck()
The CAPK expiry date check is configurable. Applications will be able to enable/
disable CAPK expiry date check using this API. By default, the kernel will not
perform the CAPK expiry date check.
Parameters
Output: flag Indicator to enable/disable CAPK expiry date.
1 – to enable CAPK expiry date check.
0 – to disable CAPK expiry date check.
vdSetConfigOption()
The config file format is configurable. Applications will be able to set the config file
format using this API. By default, the kernel uses est.dat and mvt.dat
approach.
Parameters
Input: shConfigOption Indicator to set the config file format.
TYPE_XML – enforces kernel to use XML file
format (EST.XML, MVT.XML, and KEYS.XML).
Data Object The functions in this section are needed when an application access or
Collection manipulate a tagged EMV data object in the DOC, or add a new data object to the
Access DOC.
Functions These functions are provided by the EMV Library and the descriptions are from
the Verix/Verix V EMV Library Programmers Manual.
To make changes to the TVR or TSI, use usEMVGetTxnStatus() API or
usEMVSetTxnStatus() API instead of usEMVUpdateTLVInCollxn() API, as the
update functions do not work for the TVR or the TSI.
The return values are defined in the file EMVResult.hpp header file, which is a
part of the EMV Library. Refer to the sample code in Building an EMV Application
chapter for more details.
usEMVGetTxnStatus()
Parameters
Input: None
Return Values
Success: EMV_SUCCESS (0) This value is returned if the TVR and TSI
tags are found, and data is copied
correctly to the output buffer.
usEMVSetTxnStatus()
This API sets the TVR and TSI bytes in the collection.
Parameters
Input: psrTVR_TSI Structure containing the TVR and TSI bytes to
update in the collection.
Return Values
Success: EMV_SUCCESS (0) This value is returned if the TVR/TSI bytes are
set correctly.
The Vx EMV Module is enhanced to support multi-byte tags. To support this, the
following APIs are modified accordingly:
usEMVAddTLVToCollxn()
This API adds a TLV object with tag, data and length to the TLV collection
maintained by the library.
Parameters
Input tag Tag coded in 1 or 2 bytes to be added to
the collection.
pData Value of the TLV object to be added to
the collection.
dLen Length of the data pData.
multiTag Tag coded in more than 2 bytes to be
added to the collection.
tagLen Length of the multiTag tag name.
Output None
Return Values
Success: EMV_SUCCESS This value is returned if the data
object is added to the collection.
NOTE • It is required to provide only three parameters (tag, pData and dLen) while
adding 1 or 2 byte(s) tags to the collection.
• If the application needs to add a multi-byte tag, then the value of the tag
should be 0x00 and the multiTag tag name and the length of the
multiTag tag name tagLen should be passed in addition to the tag,
pData and dLen parameters.
usEMVGetTLVFromColxn()
Parameters
Input tag Tag coded in 1 or 2 bytes to be obtained from the
collection.
multiTag Tag coded in more than 2 bytes to be obtained
from the collection.
tagLen Length of the multiTag tag name.
Return Values
Success: EMV_SUCCESS This value is returned if the tag is found in the
collection.
Failure: E_TAG_NOTFOUND This value is returned if the tag is not found in the
collection.
NOTE • It is required to provide only three parameters (tag, pData and dLen)
while retrieving 1 or 2 byte(s) tags from the collection.
• When the application needs to retrieve a multi-byte tag, then the value of the
tag should be 0x00 and the multiTag tag name and the length of the
multiTag tag name tagLen should be passed in addition to the tag,
pData and dLen parameters.
usEMVUpdateTLVInCollxn()
This API updates TLV object in the collection. If the TLV object is not found in the
collection, then it is added.
Parameters
Input tag Tag coded in 1 or 2 bytes to be updated to
the collection.
pData Value of the TLV object to be updated to
the collection.
dLen Length of the data pData.
multiTag Tag coded in more than 2 bytes to be
updated to the collection.
tagLen Length of the multiTag tag name.
Output None
Return Values
Success: EMV_SUCCESS This value is returned if the tag is
updated successfully.
NOTE • It is required to provide only three parameters (tag, pData and dLen) while
updating 1 or 2 byte(s) tags to the collection.
• When the application needs to update a multi-byte tag, then the value of tag
should be 0x00 and the multiTag tag name and the length of the
multiTag tag name tagLen should be passed in addition to the tag,
pData and dLen parameters.
usEMVRetrieveTLVFromColxn()
This API is used by the application to retrieve a tag from the TLV collection. This
API is similar to the existing usEMVGetTLVFromColxn() API except that, the
application passes the length of the buffer to this API to get the value of the tag.
Parameters
Input tag Tag coded in 1 or 2 bytes to be obtained from the
collection.
iDataLen Size of the buffer pData (to be provided by the
application).
Return Values
Success: EMV_SUCCESS This value is returned if the tag is found in the
collection.
Failure: E_TAG_NOTFOUND This value is returned if the tag is not found in the
collection.
This chapter lists and describes the callback functions implemented by the
application. These calls are used when the library requests the application for
some information to complete the execution of a function.
If the callback functions should be used by EMV Library during the course of the
transaction, then the function pointers for the following EMV Library callback
functions have to be set with EMV Module using inVXEMVAPSetFunctionality() as
an interface API:
• getLastTxnAmt()
• getTerminalParam()
• getCapkExp()
• getUsrPin()
• getXUsrPin()
• usEMVDisplayErrorPrompt()
• usEMVPerformSignature()
• usEMVPerformOnlinePIN()
• usEMVIssAcqCVM()
• displayPINPrompt()
• bIsMultipleOccurencesAllowed()
• usGetBypassDecsn()
• usGetTermAVN()
• usGetExtAuthDecision()
• usGetPOSDecsn()
• vdSelPreferredLang()
• usPinInfo()
getLastTxnAmt()
This API returns the last transaction amount for a card with the same PAN as the
card inserted for the current transaction, and returns an amount equal to 0 if the
record does not exist for the same PAN.
getLastTxnAmt() API is used in the EMV Library to check if the sum of the
transaction amount and the last transaction amount is greater than or equal to the
terminal floor limit during Terminal Risk Management. Refer to the EMV
Specifications listed in References section for more details.
getLastTxnAmt() API is called when the user calls inVXEMVAPProcRisk() and
inVXEMVAPTermRisk() APIs. The function pointer for getLastTxnAmt() API
should be set using inVXEMVAPSetFunctionality() API with the respective
functionality code. Refer to the Function Pointers of the Callback Function chapter
for the functionality code.
The application should implement:
• split sales function,
• obtain the last transaction value on the same PAN from the log file, and
• pass the value as a part of the return value.
If the same PAN entry is not found in the log file, it should return zero.
Refer to the EMVUI.C test sample file for the example implementation.
Parameters
Input: None
Return Values
Success: EMV_SUCCESS This value is returned when the processing is
completed successfully.
getTerminalParam()
This API provides all the required data for TAC and also contains data for the
default DDOL and default TDOL.
getTerminalParam() API is used in the library during data authentication to obtain
the default DDOL, and during card risk management to obtain the default TDOL.
This API is also used during TAA for obtaining the TAC. Refer to the EMV 4.3
Integrated Circuit Card Application Specification for Payment Systems for more
details.
This callback function is called when the user calls
inVXEMVAPDataAuthentication() and inVXEMVAPFirstGenerateAC() APIs. The
function pointer for getTerminalParam() API should be set using
inVXEMVAPSetFunctionality() API with the respective syntax. Refer to the
Function Pointers of the Callback Function chapter for the syntax.
Parameters
Input: id ID of the data to be retrieved. Valid IDs are:
• TAC_DEFAULT
• TAC_ONLINE
• TAC_DENIAL
• TAG_97_TDOL
• TAG_9F49_DDOL
Return Values
Success: EMV_SUCCESS This value is returned when the processing is
completed successfully.
NOTE
getTerminalParam() API is implemented in the EMV Module. The application
developer need not implement this function.
getCapkExp()
This API obtains the CAPK Modulus and Exponent required for SDA, DDA, CDDA
and enciphered PIN offline. It does this by opening the relevant CAPK
configuration file and extracting the key in binary form.
This API also gets the expiry date of the CAPK from the EST file (if present) and
checks if the expiry date is valid.
This callback function is called when the user calls:
• inVXEMVAPDataAuthentication()
• inVXEMVAPVerifyCardholder()
• inVXEMVAPFirstGenerateAC()
• inVXEMVAPUseHostData()
• inVXEMVAPSecondGenerateAC().
The function pointer for getCapkExp() API should be set using
inVXEMVAPSetFunctionality() API with the respective functionality code. Refer to
the Function Pointers of the Callback Function chapter for the functionality code.
Prototype EMVResult getCapkExp(const unsigned char *aid, const unsigned char
capkIndex, unsigned char *pstCapk, short *pCapkLen,
unsigned char *pstCapkExp, short *pCapkExplen);
Parameters
Input: aid Pointer to a buffer that contains the
AID of the selected card application.
capkIndex CAPK Index (0x8F) specified by the
card application.
Return Values
Success EMV_SUCCESS This value is returned when the CAPK
file is found, and the data to be used
for the rest of the transaction is
correct.
NOTE
getCapkExp() API is implemented in the EMV Module. The application developer
need not implement this function.
getUsrPin()
This API is called as a part of CVM. It obtains the PIN to complete CVM
processing. The application handles the UI to obtain the PIN from the cardholder.
Application should return E_PERFORM_SECURE_PIN for getUsrPin() API to
perform secure PIN entry.
The function pointer for getUsrPin() API should be set using
inVXEMVAPSetFunctionality() API with the respective functionality code. Refer to
the Function Pointers of the Callback Function chapter for the functionality code.
Parameters
Input: None
Return Values
Success: Returns the PIN length if the PIN is entered successfully. ucPin has the PIN
value.
getXUsrPin()
This API is called as a part of CVM. The EMV kernel supports secure PIN on
Vx520 connected to a PP1000seV3. The kernel invokes callback function
getXUsrPIN() upon receiving X_PERFORM_SECURE_PIN from
getUsrPIN() API. The application should provide the encrypted PIN block
received from the external PINpad (PP1000seV3) to the kernel through this
callback function.
It obtains the PIN to complete CVM processing. The application handles the UI to
obtain the PIN from the cardholder.
The function pointer for getXUsrPin() API should be set using
usEMV_Set_Functionality() API (Refer to the Verix/Verix V EMV Library
Programmers Manual for more details on this API).
NOTE
This callback function is not applicable for Vx UPT EMV Modules.
Parameters
Input None
Return Values
Success: X_PIN_SUCCESS PIN block successfully received from
PP1000seV3. PinBlock points to the 8-
byte PIN block and Mode is set to
appropriate value.
usEMVDisplayErrorPrompt()
Parameters
Input:
errorID Contains a list of values used by the library to notify the application to
display a message. Valid values of the error IDs are:
Return Values
None
NOTE • The error IDs are defined in the EMVResult.hpp header file.
• usEMVDisplayErrorPrompt() API can use any error ID if the application
defines these IDs.
usEMVPerformSignature()
This API should be implemented by the application. The EMV Library uses this
API when the CVM is Signature and the terminal supports Signature verification.
The application should print a signature line on the receipt. This API is called
when the user calls inVXEMVAPVerifyCardholder() API.
The function pointer for usEMVPerformSignature() API should be set using
inVXEMVAPSetFunctionality() API with the respective functionality code. Refer to
the Function Pointers of the Callback Function chapter for the functionality code.
Refer to the EMVUI.C test sample file for the example implementation.
Parameters
None
Return Values
Success: EMV_SUCCESS This value is returned if the signature verification is
successful.
usEMVPerformOnlinePIN()
This API should be implemented by the application. The library uses this API
when the CVM is online enciphered PIN and the terminal supports online
enciphered PIN verification. The application should request for PIN entry from the
user, encrypt the PIN and send the PIN to the host for verification. The library sets
the TVR/TSI bits and the CVM results based on the return value from the
application.
This API is called when the user calls inVXEMVAPVerifyCardholder() API.
The function pointer for usEMVPerformOnlinePIN() API should be set using
inVXEMVAPSetFunctionality() API with the respective functionality code. Refer to
the Function Pointers of the Callback Function chapter for the functionality code.
Refer to the EMVUI.C test sample file for the example implementation.
Parameters
None
Return Values
Success: EMV_SUCCESS This value is returned if online PIN
is obtained successfully.
usEMVIssAcqCVM()
Parameters
Input: issacq Specifies if the CVM is issuer or acquirer.
The library has two #defined values to
recognize if the CVM is issuer-specific or
acquirer-specific. Valid values are:
• ACQ_CVM: The card returned a CVM
in the acquirer-specific CVM range.
• ISS_CVM: The card returned a CVM in
the issuer-specific CVM range.
code Input/output parameter. The module sends
the exact value of CVM received from the
card.
Return Values
Success EMV_SUCCESS This value is returned if the cardholder
verification is successful.
displayPINPrompt()
This callback function is used to display a message for accepting the PIN from the
user. displayPINPrompt() API is used by the library only when secure PIN
processing has to be performed.
If the EMV Module is used, the application calls the existing
inVXEMVAPSetDisplayPINPrompt() API to set the function pointer for
displayPINPrompt() API. If the application is not using any specific display PIN
prompt function, the EMV Module has a default implementation, and the
application can pass null value for the *fptr parameter in the
inVXEMVAPSetDisplayPINPrompt() API.
If the EMV Module is used and the inVXEMVAPSetDisplayPINPrompt() API
is not called, there will not be any message displayed for the user to enter the PIN.
However, users will be able to enter the PIN.
Parameters
None
Return Values
None
NOTE
This API is not applicable for Vx UPT EMV Modules.
bIsMultipleOccurencesAllowed()
This API is used by the library during the application selection to allow partial
selection of AIDs. This API should be implemented by the application.
The function pointer for bIsMultipleOccurencesAllowed() API should be set using
inVXEMVAPSetFunctionality() API with the respective function code referred in
Appendix C.
Parameters
Input: pAid The AID that is being sent to the card for
selection.
Return Values
Success EMV_TRUE This value is returned if the partial name
selection is allowed for the AID.
usGetBypassDecsn()
This function is invoked by the library for secure PIN, when the OS indicates that a
PIN bypass key is pressed. The application can display the required message in
the callback function and return a specific value PIN_MANDATORY to the kernel
to indicate if the PIN session should be continued.
The function pointer for usGetBypassDecsn() API should be set using
inVXEMVAPSetFunctionality() API with the respective function code. Refer
to Appendix M for more details.
Parameters
None
Return Values
PIN_MANDATORY The EMV kernel will continue to prompt for the PIN entry,
discarding the cardholder PIN bypass.
For any other return values, the kernel will allow the cardholder PIN bypass and will
continue with the PIN bypass transaction flow.
NOTE
This API is not applicable for Vx UPT EMV Modules.
usGetTermAVN()
Parameters
Input/ iCount This is an input-output parameter. The kernel
Output provides the number of instances of pszTermAVN.
Application can fill the number of terminal application
version numbers it copies into pszTermAVN
parameter.
Output pszTermAVN Array of structures that the kernel creates and passes
to the application. The application needs to fill this
array with the terminal application version numbers.
Note: The module supports up to 10 application
version numbers.
Return Values
Success: EMV_SUCCESS This value is returned if the processing is completed
successfully.
Failure: EMV_FAILURE This value is returned if the application fails to get the
terminal application version numbers.
usGetExtAuthDecision()
This callback function is used by the library to get the application's decision
whether to terminate or continue with the transaction on receiving the status word
as 0x6985 for the external authenticate command. This API should be
implemented by the application.
The function pointer for usGetExtAuthDecision() API should be set using
inVXEMVAPSetFunctionality() API with the respective function code. Refer to
Appendix C for more details.
Parameters
Input: usStatusWord The status word in response of the external
authenticate command.
Return Values
Success: EMV_SUCCESS This value is returned if the application wants
to continue with the transaction.
usGetPOSDecsn()
This callback function is used by the library for secure PIN, to get the application's
decision on whether to cancel or bypass the PIN CVM from POS/external device.
The function pointer for usGetPOSDecsn() API should be set using
inVXEMVAPSetFunctionality() API with the respective function code. Refer
to Appendix L for more details.
Parameters
None
Return Values
EXT_PIN_CNCL To cancel the PIN.
NOTE
This API is not applicable for Vx UPT EMV Modules.
vdSelPreferredLang()
This API is used to perform the language selection for the transaction.
• If the language preference tag is provided and if the terminal supports the
languages mentioned, then the language with the highest preference is
selected.
• If the language preference tag is not present or if the terminal does not have a
matching language with the language preference tag and if the terminal has
more than one supported language, then the terminal displays the supported
languages to the cardholder for selection.
• If the language preference tag is not present or if the terminal does not have a
matching language with the language preference tag and if the terminal
supports one language, then the terminal displays the messages in that
language.
Language selection should be performed before the GPO command is issued to
the card.
This API is used by the library after application selection and before GPO for
language selection. This API should be implemented by the application.
The function pointer for vdSelPreferredLang() API should be set using
inVXEMVAPSetFunctionality() API with the respective function code referred in
Appendix C. EMV kernel invokes this callback after the application selection is
carried out successfully and before the GPO command is issued.
Parameters
None
Return Values
None
usPinInfo()
The EMV kernel is enhanced to allow PIN bypass even when PIN digits are
present. This is performed by providing the key press information along with the
number of PIN digits entered to the application through this callback function. The
application can indicate if the PIN needs to be bypassed. The kernel invokes this
callback to pass on key press information along with the number of PIN digits
entered.
The function pointer for usPinInfo() API should be set using
inVXEMVAPSetFunctionality() API with the respective function code. Refer to
Appendix C for more details.
Parameters
Input: ucNumOfPINDigits Number of PIN digits entered.
usLastNonNumericKeyPressed The last non-numeric key pressed.
Output: None
Return Values
CONTINUE Kernel continues with the PIN session.
NOTE • The application must first register the callback with the kernel to use this
feature.
• This API is not applicable for Vx UPT EMV Modules.
This chapter lists and describes the EMV Module callback functions. In addition to
the EMV Module, examples are provided to implement the UI and other auxiliary
functions required for an application to make use of the EMV Module functions.
Refer to the EMVTEST.C file for an example of a test program that uses the
Higher Level Function Calls to carry out an EMV transaction from card insertion to
transaction completion.
bIsCardBlackListed()
The EMV Module provides default implementation for this library callback
function. The default implementation does not perform any checking because it is
an optional feature. This function is implemented only when you want to perform
blacklisted card check.
To override the default implementation, provide an implementation and pass the
function pointer to the EMV Module. The application uses the PAN and PAN
sequence number to determine if the inserted card is a blacklisted card. This is
performed by checking the PAN and sequence number against a card exception
file that is present in the terminal. If the card is found in the exception file, the
user-defined function returns EMV_TRUE and the card found in exception
file bit is set in the TVR by the EMV Library. Otherwise, the user-defined
function returns EMV_FALSE. The terminal should have a proper exception file in
the memory.
The user should pass the user-defined function (when blacklisted card checking is
implemented) as a parameter when calling inVXEMVAPProcRisk() API or this API
is called only when the Black Listed Card Support flag is enabled in the
MVT for the specific scheme.
If the application does not require specific blacklisted card validation, the EMV
Module has a default implementation. The application has to pass null value to
*bIsCardBlackListed parameter in the inVXEMVAPProcRisk() API for the
default implementation.
Refer to the EMVUI.C test sample file for the example implementation.
Parameters
Input: pan PAN of the card.
panLen Number of digits of the PAN.
panSeqNo PAN sequence number of the card.
panSeqLen Number of digits of the PAN sequence number.
Return Values
EMV_TRUE This value is returned when the inserted card’s PAN is found in the
exception file.
EMV_FALSE This value is returned when the inserted card’s PAN is not found in the
exception file.
NOTE
Checking blacklisted cards is optional. The blacklisted checking is performed
only if the existing file is found in the terminal.
bIsCSNValid()
NOTE By default, EMV Module checks the validity of the CSN, which is invoked if the
application does not set and pass the function pointer to the EMV Module. By
default, the name of the CSN file is used with the RID and .CSN as the extension.
For example, if the RID is A000000003, then the CSN file name should be
A000000003.CSN.
Parameters
Input: CardCSN EMV Library fills the CardCSN parameter with
the card serial number.
Return Values
Output: EMV_SUCCESS This value is returned if the certificate serial
number processing is validated successfully.
inGetPTermID()
Parameters
Input: ptid Buffer to store the terminal ID.
Return Values
Output: EMV_SUCCESS This value is returned if the terminal ID is obtained
from the terminal and added to the global collection.
inMenuFunc()
This API is required to allow the operator to choose a card application when more
than one card application is supported. The EMV Module calls inMenuFunc() API
during application selection.
Parameters
Input: labels An array of pointers to strings (names for the menu
options).
numLabels Number of names in the list.
Return Values
An integer that corresponds to the item selected from the array (starting from 1).
usAmtEntryFunc()
Parameters
ulTxnAmt This parameter is an input - output parameter.
The values for ulTxnAmt and the implementation for each of them is as
follows:
Return Values
Success: EMV_SUCCESS This value is returned if the
amount and account type are
accepted and successfully
added to the collection.
usCandListModify()
The EMV Module allows the application to modify the candidate list to meet
requirements. This function is called only if the Modify candidate list flag is
enabled in the MVT (that is, set to 1). Refer to the MVT for more details.
The application can use this function to exclude some of the smart cards
displayed or selected by the EMV Module. To exclude an AID, the application
should set the bExcludedAID field in the srAIDList structure to 1. The EMV
Module does not include AIDs with the bExcludedAID field set to 1. By default,
the EMV Module includes all AIDs supported by the card for application selection.
Parameters
candidateList Structure of srAIDList.
Return Values
None
vdPromptManager()
The EMV Module uses this function when the application has to display a
message to warn or inform the user.
Refer to the EMVUI.C test sample file for the example implementation.
Parameters
Input:
inCondition Contains a list of values used by the EMV Module to notify the
application to display a message. Valid values are:
• APPL_NOT_AVAILABLE
• APPL_BLOCKED
• BAD_ICC_RESPONSE
• BAD_DATA_FORMAT
• CARD_BLOCKED
• CANDIDATELIST_EMPTY
• CARD_REMOVED
• CHIP_ERROR
• CONFIG_FILE_NOT_FOUND
• EASY_ENTRY_APPL
• EMV_CHIP_ERROR
• E_TAG_NOTFOUND
• EMV_FAILURE
• FAILURE
• FAILED_TO_CONNECT
• INSERT_CARD
• ICC_DATA_MISSING
• INVALID_CAPK_FILE
• NONEMV
• OFFLINE_APPROVED
• OFFLINE_DECLINED
• OFFLINE_NOTALLOWED
• REMOVE_CARD
• SELECT_FAILED
• TRANS_APPROVED
• TRANS_DECLINED
• TRANS_CANCELLED
• USE_CHIP
• USE_MAG_CARD
Return Values
None
The application should call the EMV Module functions in the appropriate order and
should also perform other application-specific EMV-related actions. This can be
classified in the following two operations:
1 Extract data objects from the DOC (using the EMV Library functions) for
processing application-specific code.
2 Insert data objects into the DOC for processing using the EMV Module
functions.
The two operations can occur in the following scenarios:
• Setting the transaction type.
• Processing of proprietary data objects on a card.
• Batch file data.
• Foreign language support.
• Terminal-to-host communications.
Setting the A data object should be created to record the transaction type (9C tag) being
Transaction performed (for example, sale, cashback, etc.). It consists of one byte, which is a
Type BCD representation of the first two digits of the ISO 8583:1987 (section 4.3.8)
processing code. The relevant values for EMV debit/credit transactions are:
TVR/TSI When an application has to change the TVR/TSI settings that are not changed by
Changes the EMV Module, the TVR/TSI should be extracted from the DOC, change the bit
setting, and update the DOC.
NOTE
It is recommended that the application should avoid changing the TVR/TSI
directly. Required changes are done by the EMV Module and the EMV Library.
The following code fragment shows how to set the Forced Online bit in the
TVR.
srTxnResult TVRTSI;
usEMVGetTxnStatus(&TVRTSI);
// Set bit in tvr for online forced by merchant
TVRTSI.stTVR[3] |= 0x8;
usEMVSetTxnStatus(&TVRTSI);
The EMV Library provides an API for setting the forced online bit in the TVR/TSI.
Refer to the Verix/Verix V EMV Library Programmers Manual for details.
Proprietary EMV allows data objects on cards that are not defined in the EMV specification.
Data Objects For example, data objects in the range 9F50–9F7F are reserved for payment
systems. Refer to the EMV specifications listed in References section for more
details. If these data objects are found in a card’s file structure, they are extracted
by the application, and placed in the DOC like any other data object.
If a proprietary data object of tag value 0x9F55 with a maximum length of 32 bytes
is to examined or processed, the following code fragment is necessary:
unsigned char ProprietaryData[32];
unsigned short Len;
Batch File Data Obtaining data for the batch file (if one is required) consists of using API to extract
relevant data objects from the DOC. The minimum data required for an EMV
batch record is described in the EMV Specifications listed in References section.
Foreign EMV-compliant terminals have the optional capability to print receipts and display
Language text to the cardholder in the preference language indicated by the card. They can
Support also optimally display the name of applications (for cardholder selection or
confirmation) in the character set (alphabet) indicated by the card.
There are two data objects used in these options: language preference (5F2D tag)
and the issuer code table index (9F11 tag). These data objects can be extracted
from the DOC in the normal way.
Language preference is a list of up to four languages (indicated by two alpha
characters, according to ISO 639), in decreasing order of preference. For
example, a card might contain a language preference that looks like esenfrde.
This indicates that Spanish (es) is the preferred language. If Spanish is not
available, English (en) is acceptable, followed by French (fr) and German (de).
This data object can be accessed any time after application selection.
It is not normally necessary for the application to access the issuer code table
index. It is only necessary if the application supports more than one non-ASCII
character set and can switch fonts according to the language requirements of the
card. The terminal uses one font, making use of an ISO 8859 character set (for
example, ISO 8859-1 that enables the representation of all Western European
languages). The possession of this character set should be reflected in additional
terminal capabilities in the terminal configuration.
As the language selection should be performed before the GPO command is sent
to the card, the application should set the function pointer in the EMV kernel.
Refer to the inVxEMVAPSetFunctionality(PERFORM_LANGUAGE_SEL,
(void*)&vdSelPreferredLang) callback API for more details.
Terminal-to-Host To communicate with a host, the application should perform the following:
Communications
• Copy data objects from the DOC to incorporate them in terminal-to-host data
packets.
• Extract data objects from the host-to-terminal data packets and add them to
the DOC so that the EMV Module function calls can perform Second Generate
AC and external authentication.
Script processing has its own additional data structures that should be filled
correctly.
The minimum requirements for data to be exchanged between the terminal and
the host are set out in the Acquirer Interface section of the EMV Terminal
specification document mentioned in the References section. But there are
additional data objects required by particular terminal-to-host protocols.
Failure to Go If it is not possible to go online to the host, it should be indicated while calling the
Online inVXEMVAPUseHostData() or inVXEMVAPSecondGenerateAC() API. In this
case, the terminal and the card can make a decision whether to authorize offline
transaction or not. This is achieved by setting the host decision argument to
FAILED_TO_CONNECT.
Implementation
This chapter describes the procedure to implement the EMV Module into your
own payment application.
Transaction This section explains an EMV transaction flow and the EMV Module functions to
Flow call in the sequence.
1 Transaction initialization:
inVXEMVAPTransInit(terminalRecord)
2 Check for card insertion:
inVXEMVCardPresent()
3 Set transaction type:
inVXEMVAPCardInit()
5 Set account type:
usEMVAddTLVToCollxn(0x5F57, &accType, 1)
NOTE
Verifone recommends using inVXEMVAPUseHostData(...) to perform the
above operations.
Online This section describes the requirements for application online processing. A
Processing payment application should follow the rules outlined in this section for
EMV Level 2 compliance.
Notes on Online • Add all TLV objects received from the host to the database (excluding data
General from template 71 or 72).
Processing
• If the CID value returned by the card is unknown, assume that it is an AAC.
• The external authenticate process is automatically performed if the necessary
data is available.
• A reversal should be sent if communication with the host is unsuccessful
(even if the transaction is approved offline in Second Generate AC).
• A reversal should also be sent if the transaction is approved by the host, but
declined by the card in the Second Generate AC.
• Do not terminate the transaction even if host declined; allow the card to
perform Second Generate AC.
• Print receipt after the Second Generate AC with the correct value of the
transaction cryptogram. The receipt should contain some additional data: AID,
cryptogram value, TVR, etc.
This appendix provides the information about the CAPK file, it’s structure and
naming convention.
Certification authority public keys are normally distributed in ASCII format.
1 Each CAPK should have its own configuration file.
For example, the file for the first Visa test key (A000000003.01) would contain:
040C2CC423911DC4697CC223F7CBBD82C100FF4313C2D0F06941DBEE34A9D512FAC7957CB
4A03BF16A10103
RID of the card ASCII representation ASCII Hex Carriage Return (CR)/
scheme of 1 byte CAPK Index representation of 3 Line feed (LF)
byte ICSN
For example, if the issuer public key certificates with serial numbers 123456 and
654321 are no longer valid, and that these are associated with the CAPK indices
03 and 04 for the A000000003 card scheme respectively, then the issuer PK CSN
file contains:
A00000000303123456
A00000000304654321
The function pointer of the EMV Library callback functions, which are
implemented in the application have to be set with EMV Library using
inVXEMVAPSetFunctionality() EMV Module interface function. The function code
parameter of inVXEMVAPSetFunctionality() API indicates the callback function
which is being set. The function pointer parameter provides the function pointer of
the callback API implemented in the application.
Table 6 explains the function codes for each of the callback API that is used with
the inVXEMVAPSetFunctionality() Module API.
Table 6 Function Pointers for Callback APIs
Callback API Function Code
getLastTxnAmt() GET_LAST_TXN_AMT
getTerminalParam() GET_TERMINAL_PARAMETER
getCapkExp() GET_CAPK_DATA
getUsrPin() GET_USER_PIN
getXUsrPin() GET_X_USER_PIN
usEMVDisplayErrorPrompt() DISPLAY_ERROR_PROMPT
usEMVPerformSignature() PERFORM_SIGNATURE
usEMVPerformOnlinePIN() PERFORM_ONLINE_PIN
usEMVIssAcqCVM() PERFORM_ISS_ACQ_CVM
bIsMultipleOccurencesAllowed() IS_PARTIAL_SELECT_ALLOWED
vdPromptManager()vdSelPreferredLang() PERFORM_LANGUAGE_SEL
usGetExtAuthDecision() Get_EXT_AUTH_DECISION
usGetTermAVN() GET_TERMINAL_AVN
usGetPOSDecsn() GET_POS_CVM_DECISION
usGetBypassDecsn() GET_BYPASS_DECISION
usPinInfo() GET_PIN_INFO
Standard Implementation: The function pointer of the standard implementation of the getTerminalParam() API is
set using inVXEMVAPSetFunctionality() API in inVXEMVAPTransInit() API during the beginning of each transaction.
Hence, if the application has to override the standard implementation, the function pointer of the application function
should be set in the module after the inVXEMVAPTransInit() function call. If no application function pointer is set or
inVXEMVAPSetFunctionality() API is not called, then the standard implementation is used.
Standard Implementation: The function pointer of the standard implementation of the getCapkExp() API is set
using inVXEMVAPSetFunctionality() API in inVXEMVAPTransInit() API during the beginning of each transaction.
Hence, if the application has to override the standard implementation, then the function pointer of the application
function is to be set in the module after the inVXEMVAPTransInit() function call. If no application function pointer is
set or inVXEMVAPSetFunctionality() API is not called, then the standard implementation is used.
inVxEMVAPSetFunctionality The application calls the If the EMV Module is used and the
(GET_USER_PIN, (void *) & inVXEMVAPSetFunctionality() API inVXEMVAPSetFunctionality() API is
getUsrPin) with the syntax during transaction not called, then no default
initialization. If the getUsrPin implementation of the EMV Module will
parameter is passed as null, then be used for getUsrPin() API. Then the
the default implementation in the cardholder verification
EMV Module will be used. The failed and the PIN entry
default function in the EMV Module required, PIN not entered bits
sends a PIN value of 1234 as are set in the TVR.
default PIN.
inVxEMVAPSetFunctionality( The application calls the If the EMV Module is used and the
GET_X_USER_PIN, (void *) inVXEMVAPSetFunctionality() API inVXEMVAPSetFunctionality() API is
&getXUsrPin) with the syntax during transaction not called, then the cardholder
initialization. If the getXUsrPin verification failed and the PIN
parameter is passed as null, then entry required, PIN not
callback will not be invoked. entered bits are set in the TVR.
inVxEMVAPSetFunctionality( The application calls If the function pointer is not set by the
GET_TERMINAL_AVN, (void*)& inVXEMVAPSetFunctionality() API application, then the terminal
usGetTermAVN) during the transaction initialization. application version numbers present in
If the usGetTermAVN parameter the EST.dat will be used for
value is passed as null, then the application version number
terminal application version comparison between the terminal and
numbers present in the EST.dat the card.
will be used for application version
number comparison between the
terminal and the card.
If the usGetTermAVN parameter
value is not passed as null, then the
application should implement
usGetTermAVN() API and set this
function pointer with the EMV
kernel. This API will be used by the
EMV kernel to consider the multiple
application version numbers
provided by the application for
application version number
comparison between the terminal
and the card.
inVxEMVAPSetFunctionality( The application calls If the function pointer is not set by the
GET_BYPASS_DECISION, inVXEMVAPSetFunctionality() API application, then the double PIN
(void*)&usGetBypassDecsn); during the transaction initialization. bypass feature will be disabled.
If the usGetBypassDecsn
Note: This API is not applicable for
parameter value is passed as null, Vx UPT EMV Modules.
then the double PIN bypass feature
will be disabled.
If the usGetBypassDecsn
parameter is not passed as null,
then the application should
implement
usGetBypassDecsn(), which will
let the library know whether the PIN
session should be continued or the
cardholder bypass should be
allowed.
inVxEMVAPSetFunctionality( The application calls If the function pointer is not set by the
GET_PIN_INFO, (void *) inVXEMVAPSetFunctionality() API application, then the existing
&usPinInfo); with the syntax during transaction functionality of PIN bypass with no PIN
initialization. The EMV kernel is digits will still be supported.
enhanced to allow PIN bypass even
Note: This API is not applicable for
when PIN digits are present. This is Vx UPT EMV Modules.
performed by providing the key
press information along with the
number of PIN digits entered to the
application through this callback
function. The application can
indicate if the PIN needs to be
bypassed.
This appendix describes the second application version number in EST. EST
supports two different application version numbers for the finally selected AID.
During the application version number checking, the EMV kernel follows the steps
provided below:
1 For the finally selected AID, compare the card application version number
with the first terminal application version number. If this version number
matches, then second application version number need not be compared
against the card application version number.
2 If the card application version number does not match against the first
terminal application version number present in the EST, then the second
application version number is validated for the existence in the EST and
compared against this value. If there is no match found, then TVR bit is set
for "ICC and terminal have different application versions".
3 Finally in the 0x9F09 tag, terminal application version number is updated
with the first terminal application version number or with the second terminal
application version number for which the card application version number
matches.
NOTE • The EMV kernel stores the second terminal application version number in a
kernel defined tag.
• If the card application does not match with both first and second terminal
application version numbers, then the 0x9F09 tag will have the first terminal
application version number.
• If the application does not want EMV kernel to perform the second application
version number checking, then the EST should not have any value specified
for the second terminal application number field.
The specific return values for each function are mentioned in the corresponding
functions. This appendix lists the other possible return values returned by the
library depending on the specific card condition.
Sample Files
This chapter lists the sample configuration files. Click on these links to view
sample code for each configuration file.
This appendix provides coding for specific data elements that control the
transaction flow in the terminal or record the status of processing for the
transaction.
In the following tables,
• ‘1’ indicates that if the bit has the value ‘1’, the corresponding ‘Meaning’
applies,
• ‘x’ indicates that the bit does not apply.
Set the data (bytes or bits) marked as RFU to ‘0’.
The following data structures are described in this section:
• Application Interchange Profile (AIP)
• Application Usage Control
• Terminal Verification Results (TVR)
• Transaction Status Information (TSI)
• Terminal Capabilities
• Additional Terminal Capabilities
• Terminal Type
• Cardholder Verification Rule Format
1 SDA supported.
1 DDA supported.
0 RFU
1 CDDA/AC supported.
Byte 2: (Rightmost)
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
1 Valid at ATMs.
Byte 2: (Rightmost)
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
1 SDA selected.
0 RFU
Byte 2:
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
1 Expired application.
1 New card.
0 RFU
0 RFU
0 RFU
Byte 3:
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
1 Unrecognized CVM.
0 RFU
0 RFU
Byte 4:
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
0 RFU
0 RFU
0 RFU
Byte 5: (Rightmost)
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
Byte 2: (Rightmost)
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
1 Magnetic stripe.
1 IC with contacts.
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
1 Signature (paper).
1 No CVM.
0 RFU
0 RFU
0 RFU
When the terminal supports Signature CVM, the terminal is an attended terminal
(Terminal Type = ‘x1’, ‘x2’, or ‘x3’) and should support a printer (Additional
Terminal Capabilities, byte 4, Print, attendant bit = ‘1’).
Byte 3: Security Capability
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
1 SDA
1 DDA
1 Card capture.
0 RFU
1 CDDA/AC supported.
0 RFU
0 RFU
0 RFU
1 Goods
1 Services
1 Cashback
1 Inquiry
1 Transfer
1 Payment
1 Administrative
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
1 Cash deposit.
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
0 RFU
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
1 Numeric keys
1 Command keys
1 Function keys
0 RFU
0 RFU
0 RFU
0 RFU
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
1 Print, attendant
1 Print, cardholder
1 Display, attendant
1 Display, cardholder
0 RFU
0 RFU
1 Code table 10
1 Code table 9
• If the terminal is attended (terminal type = ‘x1’, ‘x2’, or ‘x3’) and there is only
one printer, the Print, attendant bit is set to ‘1’ and the Print,
cardholder bit is set to ‘0’.
VERIX/VERIX V EMV MODULE REFERENCE MANUAL 151
R ELEVANT EMV D ATA O BJECTS
Terminal Type
• If the terminal is attended and there is only one display, the Display,
attendant bit is set to ‘1’ and the Display, cardholder bit is set to ‘0’.
• If the terminal is unattended (terminal type = ‘x4’, ‘x5’, or ‘x6’), the Print,
attendant and Display, attendant bits are set to ‘0’.
• The code table number refers to the corresponding part of ISO 8859.
Byte 5: Terminal Data Output Capability (continued)
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
1 Code table 8
1 Code table 7
1 Code table 6
1 Code table 5
1 Code table 4
1 Code table 3
1 Code table 2
1 Code table 1
Attended
Online only 11 21
Offline with online capability 12 22
Offline only 13 23
Unattended
Online only 14 24 34
Offline with online capability 15 25 35
Offline only 16 26 36
• Terminal Types ‘14’, ‘15’, and ‘16’ with cash disbursement capability
(Additional Terminal Capabilities, byte 1, cash bit = ‘1’) are considered ATMs.
• All other Terminal Types are not considered ATMs.
• An APACS Standard 40 terminal has a terminal type of ‘22.’
0 1 1 1 1 0 Signature (paper).
0 1 1 1 1 1 No CVM required.
Value Meaning
‘00’ Always
‘02’ If neither unattended cash nor manual cash nor purchase with cashback.
The following table lists the Terminal Category Code values and their descriptions:
Table 8 Terminal Category Code Values
Terminal Category Code
Description
Value
A Automobile/Vehicle Rental
C or Z Cash Disbursement
F Restaurant
H Hotel/Motel
O College/School Expense
O Hospital
P Payment Transaction
R All Other Merchants/U.S. Post Exchange
T All Other Non Face-to-Face Transaction
U Unique Transaction Quasi-Cash Disbursement
U or R Cardholder-Activated Terminal (CAT level 1, 2, 3, and
4)
X Airline
X Railroad
X Travel Agency/Transportation
The kernel is enhanced to support the requirement of certain regions where the
EMV configuration data is setup and maintained by application integrators who do
not have a build environment to generate the EST.dat and MVT.dat files. To
meet this requirement the EMV kernel is enhanced to accept the configuration
data. The main advantage of this feature is that these files can be downloaded
directly to the terminal in their format. They do not have to be converted to the
binary format as in the case of the EST.txt and MVT.txt before loading it to the
terminal. The kernel will read the data from these text based files and create the
EST.dat and MVT.dat. This feature is supported to only those applications
unable to provide the configuration data in the expected EST.dat and MVT.dat
format.
The Input configuration files can be in any of the following formats.
• Option 1 – EST.dat, MVT.dat
• Option 2 - ICCDATA.DAT, ICCKEYS.KEY
• Option 3 – ADK Configuration files EMV_CTLS_Applications.XML,
EMV_CTLS_Keys.XML and EMV_CTLS_Terminal.XML
• Option 4 – MVT.XML, EST.XML, KEYS.XML
Option1 - there is no specific processing required.
Option2 - the GenConfig library supports text based file formats. The kernel will
read the data from the text based files and creates the EST.dat and MVT.dat.
This feature is supported to only applications unable to provide the configuration
data in the expected EST.dat and MVT.dat formats. The text based input is
accepted from the two files namely, ICCKeys.key and ICCData.dat files. The
format of the data in these files are described in the ICCKey File Data and
ICCData File Data sections.
Option3 - the GenConfig library is enhanced to support ADK XML files. The
kernel reads the data from the XML based files, and creates the EST.dat and
MVT.dat. The format of the data in these files are described in the ADK
Configuration XML file sections.
Option4 - the GenConfig library is enhanced to support EST and MVT in XML
formats. The format of the data in these files are described in the EST/MVT XML
files sections.
If the application is using the new configuration file formats, then it has to call the
inVXEMVAPConvertConfigData() API with the function arguments as file
format used. For this, the application has to link to genconfig library and download
the same to the terminal. The application is expected to call this API only once
after the terminal reboot before calling the first API of the EMV kernel,
inVXEMVAPSCInit().
inVXEMVAPConvertConfigData()
If the application is using the new configuration file formats, then it has to call the
inVXEMVAPConvertConfigData() API with the function arguments as
TYPE_DIONE, TYPE_ADK or TYPE_XML based on the selected combination of
file formats. The application is expected to call this API only once after the
terminal reboot before calling the first API of the EMV kernel,
inVXEMVAPSCInit(). This API is used to support EMV terminal configuration
files in three formats
• TYPE_DIONE
When inVXEMVAPConvertConfigData() is called with TYPE_DIONE, the
input ICCKEYS.key file is converted into the expected configuration files,
EST.dat and MVT.dat. It also creates the CAPK files and converts the input
ICCDATA.dat file into multiple data files, which contain the TLVs to be updated
in the global TLV collection of EMV kernel upon request from the application.
• TYPE_ADK
When inVXEMVAPConvertConfigData() is called with TYPE_ADK, the
input XML files, EMV_CTLS_Applications.XML, EMV_CTLS_Keys.XML
and EMV_CTLS_Terminal.XML are converted into the expected
configuration files, EST.dat and MVT.dat.
• TYPE_XML
When inVXEMVAPConvertConfigData() is called with TYPE_XML, the
input XML files, MVT.XML, EST.XML and KEYS.XML are processed to the
database. CAPK file format will be retained in the same format as before. Only
the CAPK file names will be mentioned in the new XML file.
Parameters
Input: shConfigOption Should pass as per the configura-
tion files to be used.
TYPE_DIONE, TYPE_ADK and
TYPE_XML
Return Values
Success: GEN_CONFIG_SUCCESS If the parsing has completed
successfully with the creation of
EST.dat and MVT.dat.
NOTE Once the parsing of the input files is complete and successful, the EMV Module
deletes the existing EST.dat and MVT.dat files and renames the new files
created to EST.dat and MVT.dat in case of TYPE_DIONE and TYPE_ADK.
The application needs to calculate the CRC of the input files upon boot up and
invoke inVXEMVAPConvertConfigData() API to check if the files have
changed, and conversion is required.
inVxEMVAPUpdateConfigData()
The application calls this API to override the finally selected AID's MVT terminal
data with a different set of data present in the ICCDATA.dat input file.
Parameters
Input: chBlockValue Name of the block from which the
values should be updated in the
global TLV collection.
Example: "00", "02", etc.
Return Values
Success: GEN_CONFIG_SUCCESS If the new set of values are
successfully updated in the global
TLV collection.
usModifyESTXML()
This API is applicable for TYPE_XML configuration. The application should call
this API to:
1 EMV_UPDATE_ONE_RECORD - update an existing record from the internal
database to EST.XML file.
2 EMV_CLEAR_ONE_RECORD - clear an existing record in the EST.XML file
Parameters
Input: HandleType The handle should be one of the following values
as per the usage of this API:
EMV_UPDATE_ONE_RECORD/
EMV_CLEAR_ONE_RECORD/
EMV_CLEAR_ALL_RECORDS/
EMV_ADD_NEW_RECORD/
EMV_UPDATE_ALL_RECORD
szAIDstr Specify the AID which needs to be updated/
cleared from the internal database to/from the
EST.XML file.
This is used for EMV_UPDATE_ONE_RECORD
and EMV_CLEAR_ONE_RECORD.
This should be NULL for all other handles.
srNewRecord This is used for EMV_ADD_NEW_RECORD.
Specify the new record in srESTRecord format to
be added to the EST.XML file.
This should be NULL for all other handles.
Return Values
Success: EMV_SUCCESS Record updated/cleared/created
successfully.
usModifyMVTXML()
This API is applicable for TYPE_XML configuration. The application should call
this API to:
1 EMV_UPDATE_ONE_RECORD - update an existing record from the internal
database to MVT.XML file.
2 EMV_CLEAR_ONE_RECORD - clear an existing record in the MVT.XML file
Parameters
Input: HandleType The handle should be one of the following values
as per the usage of this API:
EMV_UPDATE_ONE_RECORD/
EMV_CLEAR_ONE_RECORD/
EMV_CLEAR_ALL_RECORDS/
EMV_ADD_NEW_RECORD/
inRecNum Specify the record number which needs to be
updated/cleared from the internal database to/from
the MVT.XML file.
This is used for EMV_UPDATE_ONE_RECORD
and EMV_CLEAR_ONE_RECORD.
This should be NULL for all other handles.
srRec This is used for EMV_ADD_NEW_RECORD.
Specify the new record in MVT_REC format to be
added to the MVT.XML file.
This should be NULL for all other handles.
Return Values
Success: EMV_SUCCESS Record updated/cleared/created
successfully.
usModifyKEYSXML()
This API is applicable for TYPE_XML configuration. The application should call
this API to:
1 EMV_CLEAR_ONE_RECORD - clear an existing record in the keys.XML
file
2 EMV_CLEAR_ALL_RECORDS - clear all the records in the MVT.XML file and
delete the keys.XML file from the terminal.
3 EMV_ADD_NEW_RECORD - add a new record to the existing keys.XML
file.
Parameters
Input: HandleType The handle should be one of the following values
as per the usage of this API:
EMV_CLEAR_ONE_RECORD/
EMV_CLEAR_ALL_RECORDS/
EMV_ADD_NEW_RECORD/
srRec Specify the CAPK filename (in srKEYSRecord
format) which needs to be added to the keys.XML
file.
This is used for EMV_ADD_NEW_RECORD.
This should be NULL for all other handles.
szCAPKFileName This is used for EMV_CLEAR_ONE_RECORD.
Specify the CAPK filename to be removed from
keys.XML file.
This should be NULL for all other handles.
Return Values
Success: EMV_SUCCESS Record updated/cleared/created
successfully.
inVXEMVAPGetLastErrCode()
This API is used to get the last error code. Application should call this API to know
where exactly the error has occurred. Whenever there is an error within the library,
the library will set the error code based on the kind of error that has occurred.
Parameters
None
Return Values
Error code value
ICCKey File The data from the ICCKeys.key file is used to create EST.dat and MVT.dat
Data files. This file should contain the RID, AID and CAPK values to be supported by
the application.
Refer to Appendix J for more details on the format of a sample ICCKeys.key file.
The initial content of file has values for creation of the default record of the MVT
file. The file has two sections:
• RID definition section
• CAPK definition section
NOTE The following data elements are mandatory and should be present in the default
record of the ICCKeys.key file: Terminal Capabilities, Additional Terminal
Capabilities and Terminal Type.
ICCData File The data from the ICCData.dat is used to update the global TLV collection. The
Data file contains multiple blocks with a block identifier for each block.
Refer to Appendix J for details on the format of a sample ICCData.dat file.
Limitations The following fields required for the EST and MVT data files creation are not
present in the new input file formats. The default value for each of these is also
indicated.
MVT.dat -
• TRM data present field (1)
• Scheme reference (-1)
• Issuer reference (-1)
• EMVCounter=0
• NextRecord=-1
• Automatic Application Selection = 0
• Black listed card support (1)
• Merchant forced online (1)
• Automatic Application selection flag (0)
• Fallback allowed flag (0)
• Modify candidate list flag (1)
• Application selection and GPO separation flag (0)
Default values within () as mentioned above will be assumed for the above fields
as they are not present in the input file.
Backward The EMV configuration update from the text based input files is an optional
Compatibility feature provided by the EMV kernel. Applications to use this feature need to link
with the new library and invoke inVXEMVAPConvertConfigData() API else
applications can continue to provide the EMV configuration data in the EST.dat
and MVT.dat files.
NOTE • Applications that choose to use this feature will see an additional processing
time taken by the kernel to convert the ICCKeys.key and ICCData.dat
files to EST and MVT files. This is a one-time operation and will not have an
impact on the transaction performance.
• The keyword ACTIVE will not be processed by the library.
• inVxEMVAPUpdateConfigData() API will update only the tags that are
defined according to the BER-TLV rules to the collection. Keywords like
TDOL and DDOL will not be updated.
This appendix lists sample configuration files, and describes the keywords used in
ICCKeys.key file.
Config File as This section provides the sample ICCKEYS.key and ICCData.dat file formats:
Text Format MTBRS Maximum Target Percentage for Biased Random Selection
Following table lists and describes the keywords used in ICCKeys.key file:
SHRFU1 = The first short RFU field value to indicate the CDA mode and if
inVXEMVAPSelectApplication() API should perform application selection
and GPO
[RID]
A000000003
TDOL=9F02065F2A029A039C0195059F3704
DDOL=9F3704
9F1A=826
[AID]
A0000000031010-VISA
PARTIAL
[Active]
19980101-20491231
[9F09]
008C
[STAVN]
0001
[9F1D]
FFFF
[9FTAC]
D84000A8000010000000D84004F800
[Floor]
01F4
#99 4ABFFD6B1C51212D05552E431C5B17007D2F5E6D
[Modulus]
19980101-20491231
AB79FCC9520896967E776E64444E5DCD
D6E13611874F3985722520425295EEA4
BD0C2781DE7F31CD3D041F565F747306
EED62954B17EDABA3A6C5B85A1DE1BEB
9A34141AF38FCF8279C9DEA0D5A6710D
08DB4124F041945587E20359BAB47B75
75AD94262D4B25F264AF33DEDCF28E09
615E937DE32EDC03C54445FE7E382777
[Exponent]
03
NOTE • Tag 9F1D mentioned above will not be added to the collection. It is the
responsibility of the application developers to add it to the collection.
• ICS field mentioned above in sample ICCKEYS.key file is not a mandatory
field.
#01
9F01=000001
9F40=5000E0A001
9F15=1234
9F16=012345678901234
9F33=E0B8C0
9F1A=826
9F35=22
5F2A=826
5F36=2
9F3C=826
9F3D=2
TDOL=9F02065F2A029A039C0195059F3704
DDOL=9F3704
TRCC=1
#00
9F01=000066
9F40=5000E0A001
9F15=1234
9F16=012345678901234
9F33=E0B8C0
9F1A=826
9F1B=0000
9F35=22
5F2A=826
5F36=2
9F3C=826
9F3D=2
TDOL=9F0206
TRCC=1
$Revision:20091214115827 $
NOTE
The following keywords will be ignored if present in the ICCDATA.dat file
TACDF, TACDN, TACOL, VACDF, VACDN, VACOL, MTBRS, TPRS, TVBRS.
Config File as This section provides the sample EST, Keys and MVT XML files:
XML Format
NOTE
Applications using XML format should call vdSetConfigOption() API by
passing TYPE_XML parameter.
<ESTData>
<SCHEME NAME="SCHEME_1">
<MVTRecord>1</MVTRecord>
<AID VALUE= "A0000000031010">
<PartialNameAllowed>2</PartialNameAllowed>
<AVN1>008C</AVN1>
<AVN2>008C</AVN2>
<RecommendedAppName>AN08</RecommendedAppName>
</AID>
<KeysData>
<SCHEME NAME="SCHEME_1">
<CAPK NAME="A000000003.53">
<PublicKeyIndex>83</PublicKeyIndex >
<CAPKExpDate>311220</CAPKExpDate>
</CAPK>
<CAPK NAME="nnn">
...
</CAPK>
</SCHEME>
<SCHEME NAME="SCHEME_2">
<CAPK NAME="A000000004.00">
...
</CAPK>
</SCHEME>
</KeysData>
NOTE
As shown above the CAPK file format will be retained in the same format as
before. Only the CAPK file names will be mentioned in the new XML file.
NOTE
The fields are same and corresponds to MVT.dat file structure.
Config File as This section provides the sample EMV_Applications.XML, EMV_Keys.XML and
ADK File EMV_Terminal.XML files:
Format
<Key>A1F5E1C9BD8650BD43AB6EE56B891EF7459C0A24FA84F9127D1A6C79D4930F6DB1
852E2510F18B61CD354DB83A356BD190B88AB8DF04284D02A4204A7B6CB7C5551977A9B
36379CA3DE1A08E69F301C95CC1C20506959275F41723DD5D2925290579E5A95B0DF632
3FC8E9273D6F849198C4996209166D9BFC973C361CC826E1</Key>
<Hash>F06ECC6D2AAEBF259B7E755A38D9A9B24E2FF3DD</Hash>
<ExpiryDate>000000</ExpiryDate>
<RevocationList>010203111213212223</RevocationList></CapKey>
<CapKey Index="F3" RID="A000000004">
<Exponent>03</Exponent>
<KeyLen>90</KeyLen>
<Key>98F0C770F23864C2E766DF02D1E833DFF4FFE92D696E1642F0A88C5694C6479D16
DB1537BFE29E4FDC6E6E8AFD1B0EB7EA0124723C333179BF19E93F10658B2F776E829E8
7DAEDA9C94A8B3382199A350C077977C97AFF08FD11310AC950A72C3CA5002EF513FCCC
286E646E3C5387535D509514B3B326E1234F9CB48C36DDD44B416D23654034A66F403BA
511C5EFA3</Key>
<Hash>A69AC7603DAF566E972DEDC2CB433E07E8B01A9A</Hash>
<ExpiryDate>000000</ExpiryDate></CapKey>
</CapKeys>
The MVT.txt can be configured to set the CDA mode. The short RFU1 field of
default record of MVT is used to configure the required mode. The 2nd and 3rd bit
of the short RFU1 from LSB are used together to indicate the required mode.
Following are the values to set the appropriate mode:
• 00 - Indicates Mode 3
• 01 - Indicates the default mode that is Mode 1
• 10 - Indicates Mode 2
• 11 - Indicates Mode 4
NOTE
Only the default record from MVT.txt should be used to indicate the bit settings
for CDA mode.
All invalid mode values i.e., other than those mentioned in the above list is ignored
and the DEFAULT mode (Mode 3) will be considered for transactions.
The EMV Module will read the 2nd and 3rd bit from LSB of short RFU1 from the
default record of the MVT in inVXEMVAPSCInit() function during the
initialization of the module. It will then invoke usEMVSetCDAMode() kernel API to
set the required mode in the EMV kernel.
This appendix is not applicable for Vx UPT EMV Modules. The EMV kernel
supports the POS/External Device initiated PIN Bypass and PIN Cancel during a
secure PIN Entry. To activate this feature, the application needs to register a
function pointer with the EMV kernel, which is an application callback. Once the
callback is registered, during secure PIN processing the EMV kernel creates a
thread, which invokes the callback that the application has registered to check for
PIN bypass or PIN cancel. If the application needs to cancel or bypass the PIN
CVM then they can return either EXT_PIN_CNCL or EXT_PIN_BYPASS from the
call back function to the thread.
The behavior of the EMV kernel for the POS/External Device initiated PIN
Bypass/PIN Cancel is identical to the cardholder initiated PIN Bypass and PIN
Cancel. The EMV kernel will terminate the transaction upon receiving the value
EXT_PIN_CNCL from the callback function. Upon receiving the
EXT_PIN_BYPASS value from the callback function, the EMV kernel decides
whether the current PIN CVM alone should be bypassed or subsequent PIN
CVMs should also be bypassed along with the current CVM. This decision will be
taken by the EMV kernel based on the subsequent PIN Bypass flag value
provided by the application in the srPINParams structure.
Once the PIN session is initiated, the EMV kernel invokes the callback function for
POS/External Device initiated PIN Bypass and PIN Cancel. Hence the return
value EXT_PIN_CNCL or EXT_PIN_BYPASS from the application will be
processed only after the PIN session is started.
EMV kernel invokes the callback in a thread that is created by the kernel. If the
application is blocking the callback by not returning the control back to the EMV
kernel, then the EMV kernel will not return the control back to the application from
the CVM processing method.
NOTE The secure PIN processing function considers the PIN processing decision that it
receives first and will discard the other. For example, if the cardholder bypass
decision is obtained before the POS initiated PIN cancel decision, then cardholder
bypass will be processed and the POS initiated PIN cancel decision will be
discarded by the kernel.
By default, the EMV kernel assigns 1K stack memory for the thread that is getting
created. If the application requires to increase the stack allocated for the thread,
then it can set an environment variable POSDECSNSTK in the terminal. For
example, if the value of the environment variable is 3, then 3K stack will be
allocated to the thread created.
NOTE
It is the application's responsibility to allocate adequate stack space for the
application based on the value it configures for POSDECSNSTK.
Application can register the function pointer by using the existing EMV kernel API
inVxEMVAPSetFunctionality() by passing the first function argument as
GET_POS_CVM_DECISION.
This appendix is not applicable for Vx UPT EMV Modules. This feature is
supported only for secure PIN. The double PIN bypass is supported only for the
PIN bypass through internal keypad. During the PIN entry, when the user presses
the key for PIN bypass for the first time, the terminal will not allow the PIN to be
bypassed and displays a warning message like “Mandatory PIN” and continues
with the PIN entry.
If user presses the key for PIN bypass, for the second time, then the PIN bypass is
allowed and the transaction continues.
The kernel will invoke a callback function in the application when the O/S indicates
that a PIN bypass key is pressed. The application can display the required
message in the callback function and returns a specific value PIN_MANDATORY
to the kernel to indicate if the PIN session to be continued.
Application can register a function pointer using the EMV kernel API
inVXEMVAPSetFunctionality() and passing the first function argument as
GET_BYPASS_DECISION.
NOTE • EMV kernel will invoke the callback function only when the function pointer is
set and the PIN is bypassed for the first time for a specific CVM. For any
subsequent cardholder PIN bypass for the current CVM, the callback function
will not be invoked and the kernel will consider it as a cardholder PIN bypass,
and will continue with the PIN bypass transaction flow.
• The double PIN bypass is supported only for the PIN bypass done through the
internal keypad. It is not supported for PIN bypass through the external device/
POS as the external device/POS can handle the double PIN bypass by itself.
• The secure PIN processing function will process the PIN bypass/cancel
decision in the order that it receives.
For example, if the usGetBypassDecsn() callback has been set in the
application and the cardholder PIN bypass decision is obtained before the
POS/external device initiated PIN cancel decision, then the cardholder PIN
bypass will be processed, and the POS/external device initiated PIN cancel
decision will be discarded by the kernel. In such a scenario, if the application
has returned PIN_MANDATORY from usGetBypassDecsn() callback, the
application needs to resend the POS/external device PIN decision as the
previous decision has not been processed by the kernel.
Backward Compatibility
Applications that do not want this feature do not have to make any changes.
There are no backward compatibility issues.