Agnos provides a set of EMV core primitives which support EMV transaction flow. These primitives are used by:
CT payment applications (see emvco.c as example)
CL card processing applications (alias CL kernels)
Table of Contents |
---|
C Structures
tTransactionalContext (agnos.h)
Code Block |
---|
typedef struct {
/** If bTRUE, TAC/IAC default processing is skipped if unable to go online*/
tBoolean mSkipTACIACDefault;
/** If bTRUE, TAC processing is performed*/
tBoolean mTAC;
/** If bTRUE, Floor Limit Checking is performed*/
tBoolean mFloorLimitChecking;
/** If bTRUE, RTS is performed*/
tBoolean mRandomTransactionSelection;
/** If bTRUE, Velocity Checking is performed*/
tBoolean mVelocityChecking;
/** If bTRUE, Default TDOL is supported*/
tBoolean mDefaultTDOL;
/** TDOL length*/
tByte mDefaultTDOLLen;
/**Tag 0x97*/
tByte mDefaultTDOLValue[TDOL_MAX_LENGTH];
/** If bTRUE, Default DDOL is supported*/
tBoolean mDefaultDDOL;
/** DDOL length*/
tByte mDefaultDDOLLen;
/**Tag 0x9F49 or 0x9F69 (UDOL for contactless)*/
tByte mDefaultDDOLValue[DDOL_MAX_LENGTH];
/**Terminal Action Code - Denial*/
tTVR mTACDenial;
/**Terminal Action Code - Online*/
tTVR mTACOnline;
/**Terminal Action Code - Default*/
tTVR mTACDefault;
/**Tag 0x9F1B*/
tAmount mTerminalFloorLimit;
/**See EMV Book III, TRM section - Random Transaction Selection*/
tPercentage mTargetPercentage;
/**See EMV Book III, TRM section - Random Transaction Selection. Same transaction currency exponent as 0x9F02*/
tAmount mThresholdValue;
/**See EMV Book III, TRM section - Random Transaction Selection*/
tPercentage mMaxTargetPercentage;
/**if bTRUE, pin may be bypassed when requested*/
tBoolean mPINByPass;
/**bTRUE when merchant manually requested transaction to go online*/
tBoolean mForcedOnline;
/**Tag 0x9A*/
tNumericDate mTransactionDate[3];
/**Tag 0x9F21*/
tNumericDate mTransactionTime[3];
/**Tag 0x9F35*/
tTerminalType mTerminalType;
/** Transaction language*/
tByte mLanguage;
/** PIN entry delay in second*/
tCounter mPinTimeOut;
/** CDAMode1, CDAMode2 and CDAMode3 only*/
tCDAType mCDAType;
/**if bTRUE, Terminal Risk Management is performed even if ICC doesn't request it*/
tBoolean mForceTRM;
/**Tag 0x5F57*/
tByte mAccountType;
/**Tag 0x9F39*/
tByte mPOSEntryMode;
/**Tag 0x9F41*/
tCounter mTransactionSequenceCounter;
/**Tag 0x9F1D*/
tByte mTerminalRiskManagementData[8];
/**Tag 0x9F3A*/
tAmount mAmountReferenceCurrency;
/**Tag 0x9F3C*/
tByte mTransactionReferenceCurrencyCode[2];
/**Tag 0x9F3D*/
tByte mTransactionReferenceCurrencyExponent;
/**Tag 0x9F1A*/
tByte mTerminalCountryCode[2];
/**Tag 0x5F2A*/
tByte mTransactionCurrencyCode[2];
/**Tag 0x5F36*/
tByte mTransactionCurrencyExponent;
/**Tag 0x9F33*/
tByte mTerminalCapabilities[3];
/**Tag 0x9F40*/
tByte mAdditionalTerminalCapabilities[5];
/**Tag 0x9F09*/
tByte mApplicationVersionNumber[2];
/**Tag 0x9C*/
tByte mTxnType;
/**Tag 0x9F1C*/
tByte mTerminalIdentification[8];
/**Tag 0x9F1E*/
tByte mIFDSerialNumber[8];
/**Tag 0x9F01*/
tByte mAcquirerIdentifier[6];
} tTransactionalContext; |
tADFList (selection.h)
Code Block | ||
---|---|---|
| ||
typedef struct {
tByte mNumberOfADF;
tADF mList[MAX_SUPPORTED_ADF];
tBoolean mEliminatedADF[MAX_SUPPORTED_ADF];
tBoolean mCardBlocked;
tBoolean mAnyBlockedApplication;
tByte mSelectionIndex;
} tADFList; |
tADF (selection.h)
Code Block |
---|
typedef struct {
tByte mADFName[MAX_AID_LENGTH];//0x4F
tByte mADFLen;
tByte mLabel[MAX_AID_LENGTH];//0x50
tByte mLabelLen;
tByte mPreferredName[MAX_AID_LENGTH];//0x9F12
tByte mPreferredNameLen;
tByte mPriorityIndicator;//0x87
tByte mLangagePreference[8];//0x5F2D
tByte mLangagePreferenceLen;
tByte mIssuerCodeTableIndex;//0x9F11
tByte mRemainingFCI[200];//0xBF0C. May contain Issuer Country Code 5F56 AND/OR Application Selection Flag DF62
tByte mRemainingFCILen;
tByte mBlocked;
tByte mCorrespondingAIDOrderNumber;// Order of the ADF in the AID list (application supported by terminal)
// Extension to support PPSE
tByte mKernelIdentifier[8];//0x9F2A
tByte mKernelIdentifierLen;
tByte mRequestedKernelId;
tByte mExtendedSelection[MAX_AID_LENGTH];//0x9F29
tByte mExtendedSelectionLen;
} tADF; |
tPSE (selection.h)
Code Block | ||
---|---|---|
| ||
typedef struct {
tByte mPSEName[MAX_AID_LENGTH];//0x84
tByte mPSELen;
tByte mSFI;//0x88
tByte mLangagePreference[8];//0x5F2D
tByte mLangagePreferenceLen;
tByte mIssuerCodeTableIndex;//0x9F11
tByte mRemainingFCI[MAX_REMAINING_FCI_LENGTH];//0xBF0C. May contain Issuer Country Code 5F56 AND/OR Application Selection Flag DF62
tByte mRemainingFCILen;
} tPSE; |
Callbacks
typedef void (*tGetDataCallback)(tBoolean lastRead, tBoolean *next)
typedef void (*tBuildDOLCallback)(tWord tag, tByte length, tByte *DOLData)
typedef void (*tStateCallback)(tAgnosState currentState, tBoolean *stop, tBoolean *bypass)
Primitives
...
Names
...
Comments
...
agnGetVersionNumber
...
Provide EMV core engine version
...
agnOpenSession
...
Open a CT session to initiate an EMV transaction flow
...
agnOpenSessionCL
...
Open a CL session to initiate an EMV transaction flow
...
agnInititateEMVTransaction
...
Initiate/Resume an EMV transaction
...
agnCompleteEMVTransaction
...
Complete a transaction as per EMVCo definition
...
agnCloseSession
...
Close a transaction flow
...
agnSetAgnosDatabase
...
agnSetKernelStatus
...
agnSetEMVTag
...
agnOverwriteTag
...
agnRemoveTag
...
agnGetEMVTag
...
agnGetAllTags
...
agnGetDatabase
...
agnIsEMVTagKnown
...
agnIsEMVTagPresent
...
agnIsEMVTagEmpty
...
agnIsEMVTagNotEmpty
...
agnSetExitState
...
agnSetParsingCallback
...
agnSetStateCallback
...
agnSetBuilDOLCallback
...
agnORTVR
...
OR a specific TVR’s bit to 1
...
agnORAgnosTVR
...
OR a specific Agnos TVR’s bit to 1
...
agnSetAgnosTVR
...
Table of Contents | ||
---|---|---|
|
API _Version _Revision | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
_Agnos _version 3.5.20 _revision 23770 | Agnos Interface is an abstraction of EMVCo Book I, II, and III. It relies on 3 components:
Pre-contions setup
Important:
Execution There are 3 ways to execute an EMVCo CT transaction. However, they follow the same pattern initiate/complete
Documentation under development…
Documentation under development… Post-conditions setup Use different primitives such as agnGetEMVTag() to fetch any EMV information |
EMV Engine | |||||||
---|---|---|---|---|---|---|---|
See agnos..h | |||||||
|
| -- | |||||
|
| ||||||
|
| Get EMV core engine version. | |||||
|
| Open a CT session to initiate an EMV transaction flow. | |||||
|
| Initiate/Resume an EMV transaction | |||||
|
| Complete a transaction as per EMVCo definition | |||||
|
| ||||||
|
| Return bTRUE is tag statically known. | |||||
|
| Return bTRUE if tag is present whatever its length. | |||||
|
| Return bTRUE if tag’s length is 0. | |||||
|
| Return bTRUE if tag’s length is not 0. | |||||
|
| Get a specific tag from Agnos database. | |||||
|
| Add a tag into Agnos database without checking tag’s update condition. | |||||
|
| Overwrite an existing tag. If it doesn’t exist, create it (no garbage collection if sizes don’t match). | |||||
|
| Remove a tag from Agnos database (no garbage collection). | |||||
|
| OR a specific TVR’s bit to 1. | |||||
|
| OR a specific Agnos TVR’s bit to 1. | |||||
|
| Set a specific Agnos TVR byte value. | |||||
|
| Open a CL session to initiate an EMV transaction flow | |||||
|
| Close a transaction flow. | |||||
agnSetAgnosDatabase | Add a series of tags. Each tag is statically indexed and ruled by an update condition. Use an appropriate update condition to store tags directly into Agnos database | ||||||
agnSetKernelStatus | Set core engine to a specific state. Use this primitive to skip a state in State Machine mode | ||||||
agnGetAllTags | Get all tags from Agnos database |
Application Selection Routines | |||||||
---|---|---|---|---|---|---|---|
See selection..h | |||||||
|
| -- | |||||
|
| ||||||
|
| ||||||
|
|
EMV Tags Database | ||||
---|---|---|---|---|
See emvtag.h, agnosdatabase.h | ||||
-- | ||||
adbGetVersionNumber | Provide Agnos database version. Get all pointers on shared RAM spaces provided by SAL/HAL and set adbAddTag strategy to STANDARD (i.e. EMVCo rule where update conditions are not checked) | |||
adbResetDataBase | Reserved to Agnos core engine. Reset database structure | |||
adbSetStrategy | Reserved to Agnos core engine and contactless card processing. By default, Agnos databse uses EMVco tags storage strategy where no check is performed on tags' update conditions. If a storage strategy is defined (by a contactless card processing) then:
| |||
adbAddTag | Reserved to Agnos core engine. Check whether a tag may be added into EMV tags database. In order to store EMV tags directly into Agnos database, use agnSetAgnosDataBase primitive instead | |||
adbAddUnknownTag | Add any tags into EMV tags database in “UnknowTag” bucket | |||
adbGetUnknowTags | Get all tags stored into unknown tags bucket | |||
adbGetUnknownTagsLength | Get the bucket’s length | |||
adbGetUnknownTagsCount | Get tags count from the bucket | |||
adbGetAllTLV | Get all TLV stored in AgnosDB.
|
Code Example |
---|
See emvco.c. and selectionlogic.h. They provide good examples on agnos.h and selection.h integration in the scope of contact card processing. |