6.7 Sample Project Tutorial
31
break
;
}
}
• Implement protocol delegate emvTransactionData:() to report EMV transaction results
- (void) emvTransactionData:(
*)emvData errorCode:(int)error{
NSLog(
@"EMV_RESULT_CODE_V2_response = %2X"
,error);
[
self
appendMessageToResults:[NSString stringWithFormat:
@"EMV_RESULT_CODE_V2_response = %2X"
,error]];
if
(emvData == nil) {
[
self
appendMessageToResults:[NSString stringWithFormat:
@"EMV TRANSACTION ERROR. Refer to
EMV_RESULT_CODE_V2_response = 0x%2X"
,error]];
return
;
}
if
(emvData.resultCodeV2 == EMV_RESULT_CODE_V2_GO_ONLINE) {
[
self
appendMessageToResults:
@"ONLINE REQUEST"
];
}
if
(emvData.resultCodeV2 == EMV_RESULT_CODE_V2_APPROVED || emvData.resultCodeV2 ==
EMV_RESULT_CODE_V2_APPROVED_OFFLINE ) {
[
self
appendMessageToResults:
@"APPROVED"
];
}
if
(emvData.resultCodeV2 == EMV_RESULT_CODE_V2_MSR_SUCCESS) {
[
self
appendMessageToResults:
@"MSR Data Captured"
];
}
if
(emvData.cardType == 0) {
[
self
appendMessageToResults:
@"CONTACT"
];
}
if
(emvData.cardType == 1) {
[
self
appendMessageToResults:
@"CONTACTLESS"
];
}
if
(emvData.unencryptedTags != nil) [
self
appendMessageToResults:[NSString stringWithFormat:
@"
Unencrytped Tags: %@"
, emvData.unencryptedTags.description]];
if
(emvData.encryptedTags != nil) [
self
appendMessageToResults:[NSString stringWithFormat:
@"Encrypted
Tags: %@"
, emvData.encryptedTags.description]];
if
(emvData.maskedTags != nil) [
self
appendMessageToResults:[NSString stringWithFormat:
@"Masked Tags:
%@"
, emvData.maskedTags.description]];
}
• Implement protocol delegate lcdDisplay:() to receive LCD messages, and automatically select 1st menu
item/language when presented with choices. Normal operation would require a choice be made by card
holder.
- (void) lcdDisplay:(
int
)mode
lines:(NSArray*)lines{
NSMutableString* str = [NSMutableString
new
];
if
(lines != nil) {
for
(NSString* s in lines) {
[str appendString:s];
[str appendString:
@"
\
n"
];
}
}
switch
(mode) {
case
0x10:
//clear screen
lcdTextView.text =
@""
;
break
;
case
0x03:
lcdTextView.text = str;
break
;
case
0x01:
case
0x02:
case
0x08:{
sharedController] emv_callbackResponseLCD:mode selection:(
unsigned
char)1];;
}
break
;
default
:
break
;
}
}
• Implement the button press methods
-(IBAction) getFirmware:(
id
)sender{
NSString *result;
logTextView.text =
@""
;
RETURN_CODE rt = [[
sharedController]
device_getFirmwareVersion:&result];
IDTech iOS SDK Guide for NEO2 #80152802-001