IDTech iOS/OSX SDK Guide  1.1.052
API reference for BTPay 200
 All Data Structures Functions Variables Properties Pages
IDTCommon.h
1 //
2 // IDTCommon.h
3 // IDT
4 //
5 // Created by Randy Palermo on 5/1/14.
6 // Copyright (c) 2014 IDTech Products. All rights reserved.
7 //
8 
9 
10 
11 
14 typedef struct {
15  bool iccPower;
16  bool cardSeated;
17  bool latchClosed;
18  bool cardPresent;
21 
22 
26 typedef struct {
27  BOOL sendIFS;
28  BOOL explicitPPS;
31  unsigned char* pps;
32  unsigned char ppsLength;
34 #ifndef UNIPAY_SHOULD_SKIP_THIS
35 
43 typedef struct {
44  unsigned char hashAlgorithm;
45  unsigned char encryptionAlgorithm;
46  unsigned char rid[5];
47  unsigned char index;
48  unsigned char exponentLength;
49  unsigned char keyLength;
50  unsigned char exponent[3];
51  unsigned char key[248];
52 
53 } CAKey;
54 
55 
59 typedef struct {
60  unsigned char aid[16];
61  unsigned char aidLen;
62 } AIDEntry;
63 
67 typedef struct {
68  unsigned char prePANClear;
69  unsigned char postPANClear;
70  unsigned char maskChar;
71  unsigned char displayExpDate;
72  unsigned char baseKeyType;
73  unsigned char encryptionType;
74  unsigned char encryptionOption;
75  unsigned char maskOption;
84 
85 
93 typedef struct {
94  unsigned char acquirerIdentifier[6];
95  unsigned char aid[16];
96  unsigned char aidLen;
98  unsigned char applicationVersionNumber[2];
99  unsigned char XAmount[3];
100  unsigned char YAmount[3];
101  unsigned char skipTACIACDefault;
102  unsigned char tac;
103  unsigned char floorlLimitChecking;
105  unsigned char velocitiyChecking;
106  unsigned char tACDenial[5];
107  unsigned char tACOnline[5];
108  unsigned char tACDefault[5];
109  unsigned char terminalFloorLimit[3];
110  unsigned char targetPercentage;
111  unsigned char thresholdValue[3];
112  unsigned char maxTargetPercentage;
113  unsigned char defaultTDOL;
114  unsigned char tdolValue[252];
115  unsigned char tdolLen;
116  unsigned char defaultDDOL;
117  unsigned char ddolValue[252];
118  unsigned char ddolLen;
119  unsigned char transactionCurrencyCode[2];
121 
122 } ApplicationID;
123 
124 
132 typedef struct {
133  unsigned char terminalCountryCode[2];
135  unsigned char terminalType;
136  unsigned char emvContact;
137  unsigned char terminalCapabilities[3];
138  unsigned char additionalTerminalCapabilities[5];
139  unsigned char emvContactless;
140  unsigned char magstripe;
141  unsigned char pinTimeOut;
142  unsigned char batchManaged;
143  unsigned char adviceManaged;
144  unsigned char pse;
145  unsigned char autoRun;
146  unsigned char predefinedAmount[3];
147  unsigned char pinByPass;
148  unsigned char referalManaged;
149  unsigned char defaultTAC;
150  unsigned char defaultTACDenial[5];
151  unsigned char defaultTACOnline[5];
152  unsigned char defaultTACDefault[5];
153  unsigned char notRTS;
154  unsigned char notVelocity;
155  unsigned char cdaType;
156 } TerminalData;
157 
164 typedef struct {
165  unsigned char rid[5];
166  unsigned char index;
167  unsigned char serialNumber[3];
168 } CRLEntry;
169 
170 #endif
171 //Versioning
172 
173 
174 typedef enum{
175  POWER_ON_OPTION_IFS_FLAG=1,
176  POWER_ON_OPTION_EXPLICIT_PPS_FLAG=2,
177  POWER_ON_OPTION_AUTO_PPS_FLAG=64,
178  POWER_ON_OPTION_IFS_RESPONSE_CHECK_FLAG=128
179 }POWER_ON_OPTION;
180 
181 typedef enum{
182  LANGUAGE_TYPE_ENGLISH=1,
183  LANGUAGE_TYPE_PORTUGUESE,
184  LANGUAGE_TYPE_SPANISH,
185  LANGUAGE_TYPE_FRENCH
186 }LANGUAGE_TYPE;
187 
188 typedef enum{
189  PIN_KEY_TDES_MKSK_extp=0x00, //external plain text
190  PIN_KEY_TDES_DUKPT_extp=0x01, //external plain text
191  PIN_KEY_TDES_MKSK_intl=0x10, //internal BTPay
192  PIN_KEY_TDES_DUKPT_intl=0x11, //internal BTPay
193  PIN_KEY_TDES_MKSK2_intl=0x20, //internal UniPayII
194  PIN_KEY_TDES_DUKPT2_intl=0x21, //internal UniPayII
195 }PIN_KEY_Types;
196 
197 #define EVENT_IDLE 0
198 #define EVENT_ASYNC_DATA 0x0100
199 
200 typedef enum{
201  EVENT_PINPAD_UNKNOWN = 11,
202  EVENT_PINPAD_ENCRYPTED_PIN,
203  EVENT_PINPAD_NUMERIC,
204  EVENT_PINPAD_AMOUNT,
205  EVENT_PINPAD_ACCOUNT,
206  EVENT_PINPAD_ENCRYPTED_DATA,
207  EVENT_PINPAD_CANCEL,
208  EVENT_PINPAD_TIMEOUT,
209  EVENT_PINPAD_FUNCTION_KEY,
210  EVENT_PINPAD_DATA_ERROR
211 }EVENT_PINPAD_Types;
212 
213 typedef enum{
214  IDT_DEVICE_BTPAY_IOS = 0,
215  IDT_DEVICE_BTPAY_OSX_BT,
216  IDT_DEVICE_BTPAY_OSX_USB,
217  IDT_DEVICE_UNIPAY_IOS,
218  IDT_DEVICE_UNIPAY_OSX_USB,
219  IDT_DEVICE_UNIPAYII_IOS,
220  IDT_DEVICE_UNIPAYII_OSX_USB,
221  IDT_DEVICE_IMAG_IOS,
222  IDT_DEVICE_VENDI_MOBILE,
223  IDT_DEVICE_VENDI_MOBILEII,
224  IDT_DEVICE_UNIMAG
225 }IDT_DEVICE_Types;
226 
227 
228 
229 typedef enum{
230  EVENT_MSR_UNKNOWN = 31,
231  EVENT_MSR_CARD_DATA,
232  EVENT_MSR_CANCEL_KEY,
233  EVENT_MSR_BACKSPACE_KEY,
234  EVENT_MSR_ENTER_KEY,
235  EVENT_MSR_DATA_ERROR,
236  EVENT_MSR_ICC_START,
237  EVENT_BTPAY_CARD_DATA,
238  EVENT_UNIPAYII_EMV_NO_ICC_MSR_DATA,
239  EVENT_UNIPAYII_EMV_FALLBACK_DATA
240 }EVENT_MSR_Types;
241 
242 typedef enum{
243  EVENT_ACTIVE_TRANSACTION = 51
244 }EVENT_CTLS_Types;
245 
246 typedef enum{
247  UNIMAG_COMMAND_DEFAULT_GENERAL_SETTINGS,
248  UNIMAG_COMMAND_ENABLE_ERR_NOTIFICATION,
249  UNIMAG_COMMAND_DISABLE_ERR_NOTIFICATION,
250  UNIMAG_COMMAND_ENABLE_EXP_DATE,
251  UNIMAG_COMMAND_DISABLE_EXP_DATE,
252  UNIMAG_COMMAND_CLEAR_BUFFER,
253  UNIMAG_COMMAND_RESET_BAUD_RATE
254 }UNIMAG_COMMAND_Types;
255 
256 typedef enum {
257  RETURN_CODE_DO_SUCCESS = 0,
258  RETURN_CODE_ERR_DISCONNECT,
259  RETURN_CODE_ERR_CMD_RESPONSE,
260  RETURN_CODE_ERR_TIMEDOUT,
261  RETURN_CODE_ERR_INVALID_PARAMETER,
262  RETURN_CODE_SDK_BUSY_MSR,
263  RETURN_CODE_SDK_BUSY_PINPAD,
264  RETURN_CODE_SDK_BUSY_CTLS,
265  RETURN_CODE_ERR_OTHER,
266  RETURN_CODE_FAILED,
267  RETURN_CODE_NOT_ATTACHED,
268  RETURN_CODE_MONO_AUDIO,
269  RETURN_CODE_CONNECTED,
270  RETURN_CODE_LOW_VOLUME,
271  RETURN_CODE_CANCELED,
272  RETURN_CODE_INVALID_STR,
273  RETURN_CODE_NO_FILE,
274  RETURN_CODE_INVALID_FILE,
275 
276 
277  RETURN_CODE_EMV_AUTHORIZATION_ACCEPTED = 0x0E00,
278  RETURN_CODE_EMV_AUTHORIZATION_UNABLE_TO_GO_ONLINE = 0x0E01,
279  RETURN_CODE_EMV_AUTHORIZATION_TECHNICAL_ISSUE = 0x0E02,
280  RETURN_CODE_EMV_AUTHORIZATION_DECLINED = 0x0E03,
281  RETURN_CODE_EMV_AUTHORIZATION_ISSUER_REFERRAL = 0x0E04,
282 
283  RETURN_CODE_EMV_APPROVED = 0x0F00,
284  RETURN_CODE_EMV_DECLINED = 0x0F01,
285  RETURN_CODE_EMV_GO_ONLINE = 0x0F02,
286  RETURN_CODE_EMV_FAILED = 0x0F03,
287  RETURN_CODE_EMV_SYSTEM_ERROR = 0x0F05,
288  RETURN_CODE_EMV_NOT_ACCEPTED = 0x0F07,
289  RETURN_CODE_EMV_FALLBACK = 0x0F0A,
290  RETURN_CODE_EMV_CANCEL = 0x0F0C,
291  RETURN_CODE_EMV_TIMEOUT = 0x0F0D,
292  RETURN_CODE_EMV_OTHER_ERROR = 0x0F0F,
293  RETURN_CODE_EMV_OFFLINE_APPROVED = 0x0F10,
294  RETURN_CODE_EMV_OFFLINE_DECLINED = 0x0F11,
295 
296 
297 
298  RETURN_CODE_EMV_NEW_SELECTION = 0x0F21,
299  RETURN_CODE_EMV_NO_AVAILABLE_APPS = 0x0F22,
300  RETURN_CODE_EMV_NO_TERMINAL_FILE = 0x0F23,
301  RETURN_CODE_EMV_NO_CAPK_FILE = 0x0F24,
302  RETURN_CODE_EMV_NO_CRL_ENTRY = 0x0F25,
303  RETURN_CODE_BLOCKING_DISABLED = 0x0FFE,
304  RETURN_CODE_COMMAND_UNAVAILABLE = 0x0FFF
305 
306 
307 } RETURN_CODE;
308 
309 typedef enum{
310  EMV_RESULT_CODE_APPROVED = 0X00,
311  EMV_RESULT_CODE_DECLINED = 0X01,
312  EMV_RESULT_CODE_GO_ONLINE = 0X02,
313  EMV_RESULT_CODE_FAILED = 0X03,
314  EMV_RESULT_CODE_SYSTEM_ERROR = 0X05,
315  EMV_RESULT_CODE_NOT_ACCEPT = 0X07,
316  EMV_RESULT_CODE_FALLBACK = 0X0A,
317  EMV_RESULT_CODE_CANCEL = 0X0C,
318  EMV_RESULT_CODE_OTHER_ERROR = 0X0F,
319  EMV_RESULT_CODE_TIME_OUT = 0X0D,
320  EMV_RESULT_CODE_OFFLINE_APPROVED = 0X10,
321  EMV_RESULT_CODE_OFFLINE_DECLINED = 0X11,
322  EMV_RESULT_CODE_REFERRAL_PROCESSING = 0X12,
323  EMV_RESULT_CODE_ERROR_APP_PROCESSING = 0X13,
324  EMV_RESULT_CODE_ERROR_APP_READING = 0X14,
325  EMV_RESULT_CODE_ERROR_DATA_AUTH = 0X15,
326  EMV_RESULT_CODE_ERROR_PROCESSING_RESTRICTIONS = 0X16,
327  EMV_RESULT_CODE_ERROR_CVM_PROCESSING = 0X17,
328  EMV_RESULT_CODE_ERROR_RISK_MGMT = 0X18,
329  EMV_RESULT_CODE_ERROR_TERM_ACTION_ANALYSIS = 0X19,
330  EMV_RESULT_CODE_ERROR_CARD_ACTION_ANALYSIS = 0X1A,
331  EMV_RESULT_CODE_ERROR_APP_SELECTION_TIMEOUT = 0X1B,
332  EMV_RESULT_CODE_ERROR_DATA_LEN_INCORRECT = 0X1C,
333  EMV_RESULT_CODE_CALL_YOUR_BANK = 0X1D,
334  EMV_RESULT_CODE_NO_ICC_ON_CARD = 0X1E,
335  EMV_RESULT_CODE_NEW_SELECTION = 0X1F,
336  EMV_RESULT_CODE_START_TRANSACTION_SUCCESS = 0X20
337 } EMV_RESULT_CODE_Types;
338 
339 typedef enum{
340  EMV_AUTHORIZATION_RESULT_ACCEPTED = 0X00,
341  EMV_AUTHORIZATION_RESULT_UNABLE_TO_GO_ONLINE = 0X01,
342  EMV_AUTHORIZATION_RESULT_TECHNICAL_ISSUE = 0X02,
343  EMV_AUTHORIZATION_RESULT_DECLINED = 0X03,
344  EMV_AUTHORIZATION_RESULT_ISSUER_REFERAL = 0X04
345 } EMV_AUTHORIZATION_RESULT;
346 
347 
348 
349 
352 @interface IDTCommon : NSObject
353 
354 
355 
356 
357 
358 @end
unsigned char displayExpDate
Mask or display expiration date. Values '0' = mask, '1' = don't mask. Default '1'.
Definition: IDTCommon.h:71
unsigned char cdaType
Supported CDA type. Value should be 0x02.
Definition: IDTCommon.h:155
unsigned char terminalType
Standard parameter. Tag 9F35 See EMVCo book IV.
Definition: IDTCommon.h:135
BOOL disableAutoPPS
No auto pps for negotiate mode.
Definition: IDTCommon.h:29
unsigned char exponentLength
Length of exponent. 0x01 or 0x03 as per EMV specs.
Definition: IDTCommon.h:48
unsigned char index
As per payment networks definition.
Definition: IDTCommon.h:166
Definition: IDTCommon.h:59
unsigned char floorlLimitChecking
Indicates whether or not terminal uses Floor Limit Checking. 0x00 or 0x01.
Definition: IDTCommon.h:103
unsigned char adviceManaged
Indicates whether or not Advice messages are supported by Terminal (only if needed by Level3 implemen...
Definition: IDTCommon.h:143
unsigned char pse
Indicates whether or not PSE Selection method is supported by Terminal. 0x00 or 0x01.
Definition: IDTCommon.h:144
unsigned char pinTimeOut
In seconds. Time allocated to cardholder to enter PIN. Binary value Example : 0x0F for 15s...
Definition: IDTCommon.h:141
unsigned char baseKeyType
BTPay Only. Key Type. Values '0' = Data Key, '1' = Pin Key. Default '0'.
Definition: IDTCommon.h:72
unsigned char maxTargetPercentage
EMV offline risk management parameter.
Definition: IDTCommon.h:112
unsigned char tac
Indicates whether or not terminal uses Terminal Action Code. 0x00 or 0x01.
Definition: IDTCommon.h:102
unsigned char defaultDDOL
Standard parameter.. Tag.
Definition: IDTCommon.h:116
unsigned char ppsLength
lenght of pps data
Definition: IDTCommon.h:32
unsigned char batchManaged
Indicates whether or not Batch messages are supported by Terminal. 0x00 or 0x01.
Definition: IDTCommon.h:142
unsigned char pinByPass
Indicates whether or not PIN bypass is supported by Terminal. 0x00 or 0x01.
Definition: IDTCommon.h:147
Definition: IDTCommon.h:164
unsigned char emvContact
Indicates whether terminal supports EMV contact. Tag 9F33, byte 1, bit 6 0x00 or 0x01.
Definition: IDTCommon.h:136
bool latchClosed
Determines if Card Latch is engaged. If device does not have a latch, value is always FALSE...
Definition: IDTCommon.h:17
unsigned char referalManaged
Indicates whether or not Referal managed are supported by Terminal (only if needed by Level3 implemen...
Definition: IDTCommon.h:148
unsigned char postPANClear
Last PAN digits to display. Values '0' - '4'. Default '4'.
Definition: IDTCommon.h:69
unsigned char aidLen
AID’s length.
Definition: IDTCommon.h:96
unsigned char index
As per payment networks definition.
Definition: IDTCommon.h:47
unsigned char hashAlgorithm
Hash Algorithm 0x01 = SHA-1.
Definition: IDTCommon.h:44
unsigned char ddolLen
Dynamic Data Object List length.
Definition: IDTCommon.h:118
Definition: IDTCommon.h:14
unsigned char targetPercentage
EMV offline risk management parameter.
Definition: IDTCommon.h:110
Definition: IDTCommon.h:43
unsigned char transactionCurrencyExponent
Transaction Currency Exponent. Example: Amount 4.53$ is managed as 453. Tag 5F36. ...
Definition: IDTCommon.h:120
unsigned char randomTransactionSelection
Indicates whether or not terminal uses Random Transaction Selection. 0x00 or 0x01.
Definition: IDTCommon.h:104
unsigned char encryptionAlgorithm
Encryption Algorithm 0x01 = RSA.
Definition: IDTCommon.h:45
unsigned char applicationSelectionIndicator
Standard parameter.
Definition: IDTCommon.h:97
unsigned char notVelocity
Indicates Velocity are not supported by Terminal or not. 0x00 or 0x01.
Definition: IDTCommon.h:154
unsigned char provideCardholderConfirmation
Indicates whether or not cardholder may confirm application selection at EMV Selection time...
Definition: IDTCommon.h:134
Definition: IDTCommon.h:352
bool iccPower
Determines if ICC has been powered up.
Definition: IDTCommon.h:15
BOOL sendIFS
Send S(IFS) request if T=1 protocolError: Reference source not found.
Definition: IDTCommon.h:27
Definition: IDTCommon.h:67
unsigned char encryptionType
BTPay Only. Key Type. Values '1' = TDES, '2' = AES. Default '1'.
Definition: IDTCommon.h:73
unsigned char autoRun
Indicates whether or not Terminal is configured in AutoRun. 0x00 or 0x01.
Definition: IDTCommon.h:145
Definition: IDTCommon.h:132
unsigned char defaultTAC
Indicates whether or not Default TAC are supported by Terminal. 0x00 or 0x01.
Definition: IDTCommon.h:149
unsigned char prePANClear
Leading PAN digits to display. Values '0' - '6'. Default '4'.
Definition: IDTCommon.h:68
Definition: IDTCommon.h:26
Definition: IDTCommon.h:93
unsigned char velocitiyChecking
Indicates whether or not terminal uses Velocity Checking. 0x00 or 0x01.
Definition: IDTCommon.h:105
unsigned char tdolLen
Transaction Data Object List length.
Definition: IDTCommon.h:115
BOOL disableResponseCheck
No check on response of S(IFS) request.
Definition: IDTCommon.h:30
BOOL explicitPPS
Explicit PPSError: Reference source not found.
Definition: IDTCommon.h:28
unsigned char notRTS
Indicates RTS are not supported by Terminal or not. 0x00 or 0x01.
Definition: IDTCommon.h:153
unsigned char defaultTDOL
Standard parameter.
Definition: IDTCommon.h:113
bool cardSeated
Determines if card is inserted.
Definition: IDTCommon.h:16
unsigned char * pps
pps is used to set the Protocol and Parameters Selection between card and reader, only Di <= 4 are su...
Definition: IDTCommon.h:31
unsigned char emvContactless
Indicates whether or not terminal support scontactless in EMV mode. 0x00 or 0x01. ...
Definition: IDTCommon.h:139
unsigned char keyLength
Length of key. max 248 bytes as per EMV specs.
Definition: IDTCommon.h:49
unsigned char skipTACIACDefault
Indicates whether or not terminal uses default values for risk management.
Definition: IDTCommon.h:101
unsigned char magstripe
Indicates whether terminal supports magstripe. 0x00 or 0x01.
Definition: IDTCommon.h:140
bool magneticDataPresent
True = Magnetic data present, False = No Magnetic Data.
Definition: IDTCommon.h:19
unsigned char encryptionOption
Definition: IDTCommon.h:74
bool cardPresent
If device has a latch, determines if the card is present in device. If the device does not have a lat...
Definition: IDTCommon.h:18
unsigned char aidLen
AID’s length.
Definition: IDTCommon.h:61
unsigned char maskChar
Last PAN digits to display. Values 0x20-0x7E. Default 0x2A '*'.
Definition: IDTCommon.h:70