6.7 Sample Project Tutorial
break;
}
}
• Implement protocol delegate emvTransactionData:() to report EMV transaction results
- (void)
emvTransactionData:(IDTEMVData
NSLog(@"EMV_RESULT_CODE_V2_response =
[self
appendMessageToResults:[NSString
if
(emvData == nil) {
[self
appendMessageToResults:[NSString
EMV_RESULT_CODE_V2_response =
return;
}
if
(emvData.resultCodeV2 == EMV_RESULT_CODE_V2_GO_ONLINE) {
[self
appendMessageToResults:@"ONLINE
}
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
}
if
(emvData.cardType == 0) {
[self
appendMessageToResults:@"CONTACT"];
}
if
(emvData.cardType == 1) {
[self
appendMessageToResults:@"CONTACTLESS"];
}
if
(emvData.unencryptedTags != nil)
Unencrytped Tags:
if
(emvData.encryptedTags != nil)
Tags:
%@", emvData.encryptedTags.description]];
if
(emvData.maskedTags != nil)
%@", 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
NSMutableString * str = [NSMutableString new];
if
(lines != nil) {
for
(NSString * s in lines) {
[str appendString:s];
[str
appendString:@"
}
}
switch
(mode) {
case
0x10:
//clear screen
lcdTextView.text = @"";
break;
case
0x03:
lcdTextView.text = str;
break;
case
0x01:
case
0x02:
case
0x08:{
[[IDT_NEO2
}
break;
default:
break;
}
}
• Implement the button press methods
-(IBAction) getFirmware:(id)sender{
NSString * result;
logTextView.text = @"";
RETURN_CODE rt =
IDTech iOS SDK Guide for NEO2 #80152802-001
* )emvData errorCode:(int)error{
%2X",error);
stringWithFormat:@"EMV_RESULT_CODE_V2_response =
0x%2X",error]];
[self
%@", emvData.unencryptedTags.description]];
[self
appendMessageToResults:[NSString
[self
appendMessageToResults:[NSString
lines:(NSArray * )lines{
n"];
sharedController] emv_callbackResponseLCD:mode
[[IDT_NEO2
sharedController]
stringWithFormat:@"EMV TRANSACTION ERROR. Refer to
REQUEST"];
Captured"];
appendMessageToResults:[NSString
device_getFirmwareVersion:&result];
%2X",error]];
stringWithFormat:@"
stringWithFormat:@"Encrypted
stringWithFormat:@"Masked Tags:
selection:(unsigned
char)1];;
31
Need help?
Do you have a question about the NEO2 and is the answer not in the manual?