Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Get a specific tag value for a given candiate within the list of mutually supported applications. This may be called to complete the selection process. Available tags depend on FCI’s contents but are genrally within {4F, 50, 87, 5F20, 9F11, 9F12, BF0C}. This primitives parses into BF0C to look for proprietary. Use this call to support regional selection mechanism such as Interac (Canada), DNA (US), …

ola_contact

See ola_contact.h

#include

Code Block
languagec
#include "ola_emv.h"
#include <stdint.h>

--

tOlaModeContactTransaction

Code Block
languagec
typedef enum
{
    metUndef = 0,
    metFull,
    metExtractPAN,
    metUnknown
} tOlaModeContactTransaction;

ola_contact_flush_aid_supported

Code Block
languagec
void ola_contact_flush_aid_supported(void);

Flush all AID from the L2 stack. This call must be performed before initiatigni a transaction

ola_contact_answer_to_reset

Code Block
languagec
tOLAError ola_contact_answer_to_reset(const char* reader);

Send an ATR to the card. This may lead to a fallback to magstripe depending on regional rules

ola_contact_add_aid_supported

Code Block
tOLAError  ola_contact_add_aid_supported(
		const uint8_t *aid,
	    uint8_t aidLength,
		int partial
);

Add an AID participating to the EMV Application Selection process. Maxim length is 16 bytes

ola_contact_build_candidate_list

Code Block
tOLAError ola_contact_build_candidate_list(
		uint8_t *nb_candidates,
	    int *pse
);

Build candidate list mutually supported by the terminal and the card. If PSE selection has been performed then *pse is set to 1

ola_contact_get_tag_from_candidate

Code Block
languagec
tOLAError ola_contact_get_tag_from_candidate(
		uint8_t candidate,
	    uint32_t tag,
		uint8_t *value,
	    uint16_t *length
);

ola_contact_final_select_candidate

Code Block
languagec

.ola_contact_final_select_candidate

Code Block
languagec
tOLAError ola_contact_final_select_candidate(uint8_t candidate);

Select a specific candiate within the list of mutually supported applications

ola_contact_initiate_transaction

Code Block
languagec
tOLAError ola_contact_initiate_transaction(
		tOlaModeContactTransaction mode
);

Initiate an EMV transaction. Prior to that call, use ola_set_emv_tag to initialize the L2 stack (amount, date, time, EMV parameters for risk management, …).

If using OLA for Agnos, following mandatory tags must be set:

  • 9C: Transaction Type

  • 9F1A: Terminal Country Code

  • 9F35: Terminal Type

  • 9F33: Terminal Capabilities

  • 9F40: Additional Terminal Capabilities

ola_contact_complete_transaction

Code Block
languagec
tOLAError ola_contact_complete_transaction(
		const uint8_t *authorResponseCode,
	    const uint8_t *issuerAuthenticationData,
	    uint8_t issuerAuthenticationData_length
);

Complete an EMV transaction

ola_contact_clean

Code Block
languagec
void  ola_contact_clean(void);

Clean up L2 stack

ola_contactless

See ola_contactless.h

#include

Code Block
languagec
#include "ola_emv.h"
#include <stdint.h>

--

#define

Code Block
#define OLA_KERNEL_ID_MASTERCARD                    2
#define OLA_KERNEL_ID_VISA                          3
#define OLA_KERNEL_ID_AMEX                          4
#define OLA_KERNEL_ID_JCB                           5
#define OLA_KERNEL_ID_DISCOVER                      6
#define OLA_KERNEL_ID_CUP                           7

#define OLA_MSD_ID_APPROVED                         0x03
#define OLA_MSD_ID_NOT_AUTHORISED                   0x07
#define OLA_MSD_ID_PLEASE_INSERT_OR_SWIPE_CARD      0x18
#define OLA_MSD_ID_AUTHORISING_PLEASE_WAIT          0x1B
#define OLA_MSD_ID_INSERT_SWIPE_OR_TRY_ANOTHER_CARD 0x1C
#define OLA_MSD_ID_SEE_PHONE_FOR_INSTRUCTIONS       0x20

--

tOlaContactlessTransactionStep

Code Block
languagec
typedef enum
{
	ctsNone,
	ctsPreprocess,
	ctsBuildCandidate,
	ctsFinalSelect,
	ctsActivate
} tOlaContactlessTransactionStep;

tOlaOutcome

Code Block
languagec
typedef enum
{
	outcNone,
	outcSelectNext,
	outcTryAgain,
	outcApproved,
	outcDeclined,
	outcOnlineRequest,
	outcTryAnotherInterface,
	outcEndApplication
} tOlaOutcome;

tOlaStartPoint

Code Block
languagec
typedef enum
{
	spNoStart,
	spStartA,
	spStartB,
	spStartC,
	spStartD,
} tOlaStartPoint;

tOlaOnlineResponseData

Code Block
languagec
typedef enum
{
	ordNone,
	ordEmv,
	ordAny
} tOlaOnlineResponseData;

tOlaAlternateInterfacePreference

Code Block
languagec
typedef enum
{
	aipNone,
	aipContactChip,
	aipMagneticStripe
} tOlaAlternateInterfacePreference;

tOlaCVMethodContactless

Code Block
languagec
typedef enum
{
	cvmclNone,
	cvmclNoCvm,
	cvmclSignature,
	cvmclOnlinePin,
	cvmclConfirmationCodeVerified
} tOlaCVMethodContactless;

tOlaStatus

Code Block
languagec
typedef enum
{
	staNone,
	staNotReady,
	staIdle,
	staReadyToRead,
	staProcessing,
	staCardReadSuccessfully,
	staProcessingError
} tOlaStatus;

tOlaValueQualifier

Code Block
languagec
typedef enum
{
	vqNone,
	vqAmount,
	vqBalance
} tOlaValueQualifier;

tOlaOutcomeParameter

Code Block
languagec
typedef struct
{
	tOlaOutcome outCome;
	tOlaStartPoint startingPoint;
	tOlaOnlineResponseData onlineResponseData;
	tOlaCVMethodContactless cvm;
	int UIReqOnOutcomePresent;
	int UIReqOnRestartPresent;
	int receipt;
	int dataRecordPresent;
	int discretionaryDataPresent;
	tOlaAlternateInterfacePreference alternateInterfacePreference;
	uint32_t fieldOffReq;
	uint32_t removalTimeout;
} tOlaOutcomeParameter;

tOlaUIRequest

Code Block
languagec
typedef struct
{
	uint8_t messageIdentifier;
	tOlaStatus status;
	uint32_t holdTime;
	uint8_t languagePreference[8];  // List of languages, ISO 639-1 representation
	tOlaValueQualifier valueQualifier;
	uint8_t value[6];               // BCD
	uint8_t currencyCode[2];        // Numeric ISO 4217
} tOlaUIRequest;

ola_contactless_flush_aid_supported

Code Block
void ola_contactless_flush_aid_supported(void);

ola_contactless_add_aid_supported

Code Block
languagec
tOLAError ola_contactless_add_aid_supported(
        const uint8_t *aid,
        uint8_t aidLength,
        int partial,
        uint8_t kernelId,
        uint8_t *tlv,
        uint16_t tlvLength
);

ola_contactless_add_drl_supported

Code Block
languagec
uint16_t ola_contactless_add_drl_supported(
        const uint8_t *programId,
        uint8_t programIdLength,
        const uint8_t *transactionLimit,
        const uint8_t *floorLimit,
        const uint8_t *CVMLimit,
        int statusCheck,
        int isZeroAllowed,
        uint8_t kernelId
);

ola_contactless_commit_supported_aids

Code Block
void ola_contactless_commit_supported_aids(void);

ola_contactless_build_candidate_list

Code Block
uint16_t ola_contactless_build_candidate_list(
        uint8_t *nb_candidates
);

ola_contactless_get_tag_from_candidate

Code Block
languagec
uint16_t ola_contactless_get_tag_from_candidate(
        uint8_t candidate,
        uint32_t tag,
        uint8_t *value,
        uint16_t *length
);

ola_contactless_final_select_candidate

Code Block
languagec
tOLAError ola_contactless_final_select_candidate(
        uint8_t candidate,
        uint8_t *kernelId
);

ola_contactless_get_card_preferred_language

Code Block
tOLAError ola_contactless_get_card_preferred_language(
        char *language
);

ola_contactless_preprocess

Code Block
languagec
tOLAError ola_contactless_preprocess(void);

ola_contactless_do_transaction

Code Block
languagec
tOLAError ola_contactless_do_transaction(void);

ola_contactless_clean

Code Block
languagec
void  ola_contactless_clean(void);

ola_contactless_get_outcome

Code Block
tOLAError ola_contactless_get_outcome(
        tOlaOutcomeParameter *outcome
);

ola_contactless_get_UI_request_upon_outcome

Code Block
languagec
tOLAError ola_contactless_get_UI_request_upon_outcome(
        tOlaUIRequest *uiRequest
);

ola_contactless_get_UI_request_restart

Code Block
languagec
tOLAError ola_contactless_get_UI_request_restart(
        tOlaUIRequest *uiRequest
);

...