IDTech iOS/OSX SDK Guide  1.1.052
API reference for BTPay 200
 All Data Structures Functions Variables Properties Pages
IDTechEMV Class Reference

#import <IDTechEMV.h>

Inheritance diagram for IDTechEMV:

Instance Methods

(void) - completeOnlineEMVTransaction:resultCode:issuerAuthenticationData:issuerScripts:
 
(void) - confirmApplication:
 
(void) - confirmApplicationCancel
 
(NSDictionary *) - getAllTags
 
(NSString *) - getEMVKernelVersion
 
(NSData *) - getTag:
 
(void) - removeApplicationData:
 
(NSArray *) - retrieveAIDList
 
(IDTech_ApplicationID- retrieveApplicationData:
 
(IDTech_TerminalData- retrieveTerminalData
 
(void) - setApplicationData:
 
(void) - setTag:tagData:
 
(void) - preloadEMVCardData
 
(void) - setTerminalData:
 
(void) - cancelTransaction
 
(void) - startEMVTransaction:timeout:transactionType:additionalTags:
 
(void) - accelerateRead:
 
(void) - sendSystemError
 

Class Methods

(IDTechEMV *) + sharedController
 

Properties

id< IDTechEMV_Delegatedelegate
 

Detailed Description

Class to drive the IDTechEMV device

Method Documentation

- (void) accelerateRead: (BOOL)  enabled

Accelerate Read Data

Enables multi-record reading from ICC to accellerate EMV transaction time. Enabled by default.

Parameters
enabledTRUE = use accelerated reading, FALSE = use standard reading
- (void) cancelTransaction

Cancel Transaction

Cancels the current transaction

- (void) completeOnlineEMVTransaction: (EMV_COMPLETION_RESULT)  result
resultCode: (NSString *)  rc
issuerAuthenticationData: (NSString *)  iad
issuerScripts: (NSString *)  scripts 

Complete EMV Transaction Online Request

Completes an online EMV transaction request by the card

The tags will be returned in the emvTransactionData delegate protocol.

Parameters
resultEMV_COMPLETION_RESULT: Used to specify if contacting online host was successful or other problem occurred
rcResult Code from host. Manditory. 2 characters ASCII value. Example "00"
iadIssuer Authentication Data. Optional. 10 bytes, 20 Hex Characters representing data. Example "11223344556677883030"
scriptsIssuer Scripts. Optional. Data represented by Hex Characters. TLV Format. Must start with 71 or 72, followed by length, followed by data. Example "711000112233445566778899AABBCCDDEEFF". Can string multiple scripts, both 71 and 72.

Results are returned on delegate protocol emvTransactionData.

- (void) confirmApplication: (int)  index

Set Application

During and EMV transaction flow, if there are multiple applications to chose from, or the terminal settings indicate cardholder confirmation for applicaiton selection, the delegate IDTechEMV_Delegate::confirmApplicationSelection:() will receive an array with all the available applications to choose from. The selected index of the application must be passed back to this method to continue the EMV transaction flow

Parameters
indexThe index of the selected app from the application array passed back from confirmApplicationSelection:()
- (void) confirmApplicationCancel

Cancel Set Application

During and EMV transaction flow, if there are multiple applications to chose from, or the terminal settings indicate cardholder confirmation for applicaiton selection, the delegate IDTechEMV_Delegate::confirmApplicationSelection:() will receive an array with all the available applications to choose from. If no application selection is performed, this routine must be called to cancel the transaction

- (NSDictionary*) getAllTags

Get All Tags

Retrieves all EMV tags from the inserted card. Only available after the card has been processed after executing IDTechEMV::startEMVTransaction:timeout:additionalTags:()

Return values
dataNSdictionary with all tag values. Key is NSString, Object is NSData.
- (NSString*) getEMVKernelVersion

Returns SDK EMV Kernel Version

Return values
responseResponse returned of Kernel Version
- (NSData*) getTag: (NSString *)  tagName

Get Tag

Retrieves an EMV tag from the inserted card. Only available after the card has been processed after executing IDTechEMV::startEMVTransaction:timeout:additionalTags:()

Parameters
tagNameName fo tag to retrieve
Return values
dataTag data
- (void) preloadEMVCardData

Preload EMV Card Data

This function will attempt to cache preliminary EMV card data. It is to be used in an envvironment where there will be a few seconds between inserting the card and executing the startEMV command. Example would be the idle time in collecting an amount before startEVM is executed.

- (void) removeApplicationData: (NSString *)  AID

Remove Application Data by AID

Removes the Application Data as specified by the AID name passed as a parameter

Parameters
AIDName of ApplicationID in ASCII, example "A0000000031020". Must be between 5 and 16 characters
- (NSArray*) retrieveAIDList

Retrieve AID list

Returns all the AID name/length on the inserted ICC. Populates response parameter with an dictionary with Keys of AID Names (NSData*), and values of AID Lengths (NSData*)

Return values
responseReturns a NSArray of NSString of AID Names
- (IDTech_ApplicationID) retrieveApplicationData: (NSString *)  AID

Retrieve Application Data by AID

Retrieves the Application Data as specified by the AID name passed as a parameter. The AID will be in the response parameter responseAID. If aidLen = 0, then requested AID was not found.

Parameters
AIDName of ApplicationID in ASCII, example "A0000000031020". Must be between 5 and 16 characters
Return values
responseAIDThe AID returned from the method
- (IDTech_TerminalData) retrieveTerminalData

Retrieve Terminal Data

Retrieves the Terminal Data. The data will be in the response parameter

Return values
responseResponse returned as a TerminalData
- (void) sendSystemError

Send Sytem Error

For Internal Use Only

- (void) setApplicationData: (IDTech_ApplicationID data

Set Application Data by AID

Sets the Application Data as specified by the ApplicationID structure passed as a parameter

Parameters
dataApplicationID configuration file
- (void) setTag: (NSString *)  tagName
tagData: (NSData *)  data 

Set Tag

Sets an EMV tag from the tags read into the terminal. Only available after the card has been processed after executing IDTechEMV::startEMVTransaction:timeout:additionalTags:()

Parameters
tagNameName of tag to set
dataTag data
- (void) setTerminalData: (IDTech_TerminalData data

Set Terminal Data

Sets the Terminal Data as specified by the IDTech_TerminalData structure passed as a parameter

Parameters
dataTerminalData configuration file
+ (IDTechEMV*) sharedController

Singleton Instance

Establishes an singleton instance of IDTechEMV class.

Return values
Instanceof IDTechEMV
- (void) startEMVTransaction: (float)  amount
timeout: (int)  timeout
transactionType: (int)  type
additionalTags: (NSMutableDictionary *)  tags 

Start EMV Transaction Request

Authorizes the EMV transaction amounts for an ICC card

The tags will be returned in the emvTransactionData delegate protocol.

Parameters
amountTransaction amount value (tag value 9F02)
timeoutTimeout value in seconds.
typeTransaction Type.
tagsAny other optional tags to be included in the request. Passed as a mutable dictionary.
Converting TLV to NSMutableDictionary

EMV data is received in TLV (Tag, Length, value) format: 950500000080009B02E8009F2701018A025A339F26080C552B9364D55CE5

This data contains the following EMV tags/values:

Tag Length Value
95 05 0000008000
9B 02 E800
9F27 01 01
8A 02 5A33
9F26 08 0C552B9364D55CE5

An example how to create an NSMutableDictionary with these values follows.

-(NSMutableDictionary*) createTLVDict{
NSMutableDictionary *emvTags = [[NSMutableDictionary alloc] initWithCapacity:0];
[emvTags setObject:@"0000008000" forKey:@"95"];
[emvTags setObject:@"E800" forKey:@"9B"];
[emvTags setObject:@"01" forKey:@"9F27"];
[emvTags setObject:@"5A33" forKey:@"8A"];
[emvTags setObject:@"0C552B9364D55CE5" forKey:@"9F26"];
return emvTags;
}

Property Documentation

- (id< IDTechEMV_Delegate >) delegate
readwriteatomicstrong

The documentation for this class was generated from the following file: