SCRA Reader PROGRAMMING REFERENCE MANUAL PART NUMBER 99875568-1 APRIL 2012 Confidential This document contains the proprietary information of MagTek. Its receipt or possession does not convey any rights to reproduce or disclose its contents or to manufacture, use or sell anything it may describe. Reproduction, disclosure or use without specific written authorization of MagTek is strictly forbidden.
Copyright© 2001-2012 ® MagTek , Inc. Printed in the United States of America Information in this document is subject to change without notice. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of MagTek, Inc. MagTek is a registered trademark of MagTek, Inc. REVISIONS Rev Number 1.01 1.02 1.03 1.04 1.
SOFTWARE LICENSE AGREEMENT IMPORTANT: YOU SHOULD CAREFULLY READ ALL THE TERMS, CONDITIONS AND RESTRICTIONS OF THIS LICENSE AGREEMENT BEFORE INSTALLING THE SOFTWARE PACKAGE. YOUR INSTALLATION OF THE SOFTWARE PACKAGE PRESUMES YOUR ACCEPTANCE OF THE TERMS, CONDITIONS, AND RESTRICTIONS CONTAINED IN THIS AGREEMENT. IF YOU DO NOT AGREE WITH THESE TERMS, CONDITIONS, AND RESTRICTIONS, PROMPTLY RETURN THE SOFTWARE PACKAGE AND ASSOCIATED DOCUMENTATION TO THE ABOVE ADDRESS, ATTENTION: CUSTOMER SUPPORT.
Table of Contents Section 1. MagTekSCRA Class ......................................................................................... 1 Methods........................................................................................................................... 3 openDevice: ................................................................................................................ 3 closeDevice: ....................................................................................................
getTrackDecodeStatus .............................................................................................. 12 getResponseType ...................................................................................................... 12 setDeviceType........................................................................................................... 12 isDeviceOpened ........................................................................................................ 12 getBatteryLevel ........
vi
SECTION 1. MagTekSCRA CLASS Classes MagTekSCRA Description This class allows you to perform reader functions.
Notifications: trackDataReadyNotification devConnectionNotification getSDKVersion getOperationStatus Receieves notification when track data is available on reader Receieves notification when reader’s connection status is changed Retrieves SDK version Retrieves operation status Enum: MTSCRADeviceType MTSCRATransactionStatus MTSCRATransactionData MAGTEKAUDIOREADER TRANS_STATUS_OK TRANS_STATUS_START TRANS_STATUS_ERROR TLV_OPSTS TLV_CARDSTS TLV_TRACKSTS TLV_CARDNAME TLV_CARDIIN TLV_CARDLAST4 TLV_CARDEXPDATE
Methods openDevice: This function opens the reader. - (BOOL) openDevice Parameters Return Value YES if the device is opened successfully. Otherwise, return NO. closeDevice: This function close the reader. - (BOOL) closeDevice Parameters Return Value YES if the device is closed successfully. Otherwise, return NO. isDeviceConnected This function retrieves the connection status of the reader. - (BOOL) isDeviceConnected Parameters Return Value YES if the device is connected. Otherwise, return NO.
getMaskedTracks Retrieves existing stored Masked data, only supported for iDynamo, it will return a empty string in audio reader - (NSString *) getMaskedTracks Parameters Return Value Return stored masked tracks data string. getTrack1 Retrieve Encrypted Track1 if any - (NSString *) getTrack1 Parameters Return Value Return stored encrypted track1 data string. getTrack2 Retrieve Encrypted Track2 if any - (NSString *) getTrack2 Parameters Return Value Return stored encrypted track2 data string.
getTrack1Masked Retrieve Masked Track1 if any - (NSString *) getTrack1 Parameters Return Value Return stored masked track1 data string. getTrack2Masked Retrieve Masked Track2 if any - (NSString *) getTrack2 Parameters Return Value Return stored masked track2 data string. getTrack3Masked Retrieve Masked Track3 if any - (NSString *) getTrack3 Parameters Return Value Return stored masked track3 data string.
getMagnePrintStatus MagnePrint Status, only supported for iDynamo, it will return a empty string in audio reader - (NSString *) getMagnePrintStatus Parameters Return Value Return stored MagnePrintStatus string. getDeviceSerial Retrieve device serial number. - (NSString *) getDeviceSerial Parameters Return Value Return stored device serial number.
Parameters tag A MTSCRATransactionData Enum type. Return Value Return tag value. getDeviceSerial Retrieve Device Serial Number - (NSString *) getDeviceSerial Parameters Return Value Return stored key serial number. getMagTekDeviceSerial Retrieve Device Serial Number created by MagTek - (NSString *) getMagTekDeviceSerial Parameters Return Value Return stored key serial number created by MagTek. getFirmware Retrieve firmware version number.
getDeviceCaps Get device capabilities. - (NSString *) getDeviceCaps Parameters Return Value Return device capabilities. getDeviceStatus Get device status. - (NSString *) getDeviceStatus Parameters Return Value Return device status. getTLVVersion Get TLV Version of firmware. - (NSString *) getTLVVersion Parameters Return Value Return TLV version of firmware. getDevicePartNumber Get device part number. - (NSString *) getDevicePartNumber Parameters Return Value Return device part number.
Parameters Command string. Return Value Send command to device. Please refer to Section 2 for command list.
listenForEvents Setup the events to listen for - (void) setDeviceProtocolString: (UInt32 *)event Parameters Event Return Value getDeviceType Retrieves the Device Type - (int) getDeviceType Parameters Return Value Device Type getCardPANLength Retrieves the Length of teh PAN - (int) getCardPANLength Parameters Return Value Card PAN Length getResponseData Retrieves the whole Response from the reader - (NSString *) getResponseData Parameters Return Value Response Data getCardName Retrieves the Name in the C
getCardIIN Retrieves the IIN in the Card - (NSString *) getCardIIN Parameters Return Value IIN getCardLast4 Retrieves the Last 4 of the PAN - (NSString *) getCardLast4 Parameters Return Value Last 4 of the PAN getCardExpDate Retrieves the Expiration Date - (NSString *) getCardExpDate Parameters Return Value Expiration Date getCardServiceCode Retrieves the Service Code - (NSString *) getCardServiceCode Parameters Return Value Service Code getCardStatus Retrieves the Card Status - (NSString *) getCardStat
getTrackDecodeStatus Retrieves the Track Decode Status - (NSString *) getTrackDecodeStatus Parameters Return Value Track Decode Status getResponseType Retrieves the Response Type - (NSString *) getResponseType Parameters Return Value Response Type setDeviceType Sets the type of device to Open - (void) setDeviceType: (UInt32 *)deviceType Parameters Device Type Return Value isDeviceOpened Retrieves device opened status - (BOOL) isDeviceOpened Parameters Return Value Boolean whether device is opened or not
getBatteryLevel Retrieves device battery level - (long) getBatteryLevel Parameters Return Value Battery Level getSDKVersion Retrieves the SDK Version - (NSString *) getSDKVersion Parameters Return Value SDK Version getOperationStatus Retrieves the operation status - (NSString *) getOperationStatus Parameters Return Value Operation Status 13
Notification trackDataReadyNotification Notification received when tracks data is available on reader. devConnectionNotification Notification received when the connection status of the reader is changed.
Enum MTSCRADeviceType MAGTEKAUDIOREADER is used to open/close audio reader. MTSCRATransactionStatus TRANS_STATUS_OK is triggered when transaction succeed. TRANS_STATUS_START is triggered when reader starts sending data. TRANS_STATUS_ERROR is triggered when reader fails sending data.
Encrypted track 2 TLV_ENCTK3 Encrypted track 3 TLV_DEVSN Device serial number TLV_DEVSNMAGTEK Device serial number created by Magek TLV_DEVFW Device firmware version TLV_DEVNAME Device model name TLV_DEVCAPS Device capabilities TLV_DEVSTATUS Device status TLV_TLVVERSION Firmware TLV version TLV_DEVPARTNUMBER Device part number TLV_KSN KSN TLV_CMAC CMAC 16
SECTION 2. COMMANDS Discovery Send discovery command to device. - (Void *) sendCommandToDevice: (NSString *)command Parameters Command string: use “C10206C20503C30100” as command string. Return Value Following device information will can be retrieved. Device SN, internal Device serial number created by chip manufacturer. use getDeviceSerial method to retrieve data. Device SN, MagTek Device serial number created by MagTek. use getDeviceSerialMagTek method to retrieve data.
5 = Supported tracks: Track1, Track3. 6 = Supported tracks: Track2, Track3. 7 = Supported tracks: Track1, Track2, Track3. use getCapTracks method to retrieve data. Capability – MagStripe Encryption 0 = No Encryption, 1 = TripDES DUKPT use getCapMagStripeEncryption method to retrieve data.
SECTION 3. CODE EXAMPLES Open Device: self.mtSCRALib = [[MTSCRA alloc] init]; [self.mtSCRALib listenForEvents:(TRANS_EVENT_OK|TRANS_EVENT_START|TRANS_EVENT_ERROR)]; //iDynamo [self.mtSCRALib setDeviceType:(MAGTEKIDYNAMO)]; [self.mtSCRALib setDeviceProtocolString:(“com.magtek.idynamo”)]; [self.mtSCRALib setDeviceType:(MAGTEKIDYNAMO)]; //Audio //[self.mtSCRALib setDeviceType:(MAGTEKAUDIOREADER)]; [self.mtSCRALib openDevice]; Close Device: [self.
NSLog(@"TRANS_STATUS_ERROR"); break; } default: break; } Get Connection Status Of Reader: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(devConnStatusChange) name:@"devConnectionNotification" object:nil]; - (void)devConnStatusChange { BOOL isDeviceConnected = [self.mtSCRALib isDeviceConnected]; if (isDeviceConnected) { self.deviceStatus.text = @"Device Connected"; } else { self.deviceStatus.