Page 1
MagTek Universal SDK For MMS Devices Programmer’s Manual ( Java ) September 2021 Manual Part Number: D998200385-10 REGISTERED TO ISO 9001:2015 MagTek I 1710 Apollo Court I Seal Beach, CA 90740 I Phone: (562) 546-6400 I Technical Support: (888) 624-8350 www.magtek.com...
Page 2
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.
Page 3
ATTENTION: CUSTOMER SUPPORT. TERMS, CONDITIONS, AND RESTRICTIONS MagTek, Incorporated (the "Licensor") owns and has the right to distribute the described software and documentation, collectively referred to as the "Software." LICENSE: Licensor grants you (the "Licensee") the right to use the Software in conjunction with MagTek products.
Page 4
Agreement and will not affect the enforceability of any of the remaining provisions. This Agreement shall be governed by the laws of the State of California and shall inure to the benefit of MagTek, Incorporated, its successors or assigns.
System Requirements ........................8 How to Set Up the MagTek Universal Project ..................9 How to Download and Set Up the MagTek Universal Java Project ........... 9 How to Set Up the Java Library With the JRE/JVM ..............9 How to Modify Manifest ........................9 How to Sign JAR ..........................
This document provides instructions for software developers who want to create Java software solutions that include MagTek devices connected to a Windows based host. This document is part of a larger library of documents designed to assist MagTek device implementers, which includes the following documents available from MagTek: ...
2) Download and install the latest version of the Java Runtime Environment (JRE) and Java Development Kit (JDK). 3) Follow the steps in section 2.1 How to Download and Set Up the MagTek Universal Java Project to download and install the latest MagTek Universal Windows SDK. You may download and install it directly on the target workstation where it will be used, or you may opt to install it on a master development workstation and copy the dependencies to the target workstation manually.
7) Sign your applet by using jarsigner to sign the JAR file, using the private key you saved in your keystore: jarsigner C:\mtusdk.jar MyCert 8) Verify the output of your signed JAR file by entering the following command: jarsigner -verify -verbose -certs C:\mtusdk.jar MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 10...
2) In Eclipse, click File New Java Project 3) Type the project name 4) In the library tab, click Add external jar, then point to the Lib folder of the root folder of MagTek Universal SDK for Java to add the MTUSDK.jar.
Use the CoreAPI to create an IDevice. IDevice is the bases for the MagTek Universal SDK. If accessing a device specific API outside of MagTek Universal SDK, use the various functions in this section to create an instance of that device’s API. Once a device specific API is referenced, the associated library will need to be added into the application’s development project.
Returns a string for a connection type. GetConnectionTypeFromString This function returns an enumerated connection type from a string. ConnectionType CoreAPI.GetConnectionTypeFromString(String connectionType); Parameter Description connectionType Enumerated connections type. Return Value: Returns a ConnectionType. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 13...
This function retrieves the device control interface to the device. IDeviceControl IDevice.getDeviceControl(); Return Value: Returns IDeviceControl getDeviceConfiguration This function retrieves a device configuration interface to the device. IDeviceConfiguration IDevice.getDeviceConfiguration(); MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 14...
ISO format for the PIN block. String The left most 12 digits of the Primary Account Number. Leave blank if not required by the ISO format for the PIN block. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 15...
Returns true if successful. Otherwise, returns false. 4.13 startTransaction This function starts a transaction. The transaction will be processed through multiple calls to the event OnEvent. boolean IDevice.startTransaction(ITransaction transaction); MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 16...
Page 17
By default, devices with a display signal the end of a transaction by briefly showing “THANK YOU,” then “WELCOME.” sage Usage: false – Do not suppress the thank you message. true – Suppress the thank you message. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 17...
Page 19
ISO 18245. The byte array is null by default. MerchantID byte[] EMV Tag 9F16 - Used to uniquely identify a given merchant. The byte array is null by default. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 19...
This function allows the host to no longer receive any events sent by the device. boolean IDevice.unsubscribeAll(IEventSubscriber eventCallback); Parameter Description eventCallback Name of a class that implements the IEventSubscriber Delegates event. Return Value: Returns true if successful. Otherwise, returns false. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 20...
Return Value: Returns true if device is equipped with a PIN Pad. Otherwise, returns false. Signature This property returns true if the device is equipped signature capture. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 21...
IDeviceControl.deviceReset(); Return Value: Returns true if successful. Otherwise, returns false. displayMessage This function sets a show message on the device’s display. boolean IDeviceControl.displayMessage(byte messageID, byte timeout); MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 23...
This function instructs the device to play a tone. boolean IDeviceControl.playSound(IData data); Parameter Description data Byte array or string data to send to the device. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 25...
EMV transactions to limit the possibility of the cardholder prematurely removing the card. The lock can also be enabled while the card is out of the system to block cardholders from inserting a card. boolean IDeviceControl.setLatch(boolean enableLock); MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 27...
0x03 – show the image at slot 3. 0x04 – show the image at slot 4. Return Value: Returns true if successful. Otherwise, returns false. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 28...
This function returns the type of connection interface for the device. ConnectionType ConnectionInfo.getConnectionType(); Return Value: Returns the ConnectionType getDeviceType This function returns the type for the device. DeviceType ConnectionInfo.getDeviceType(); Return Value: Returns the DeviceType MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 29...
Returns the address of the device. getSerial This function returns the serial number of the device. String DeviceInfo.getSerial(); Return Value: Returns the address of the device. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 30...
Byte array for the file ID. For DynaFlex, use a 4-byte file id. data File contents to be sent to the device. Name of a class or structure that implements the IConfigurationCallback callback Delegates events. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 32...
Returns 0 if the asynchronous update operation started. Otherwise, returns a non 0 value. setConfigInfo This function sets device configuration information. For an example, see appendix 12.9B.6 IDeviceConfiguration Walk Through. int IDeviceConfiguration.setConfigInfo( byte configType, byte[] data, IConfigurationCallback callback); MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 33...
Name of a class or structure that implements the IConfigurationCallback callback Delegates events. Return Value: Returns 0 if the asynchronous update operation started. Otherwise, returns a non 0 value. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 34...
Name of a class or structure that implements the IConfigurationCallback callback Delegates events. Return Value: Returns 0 if the asynchronous update operation started. Otherwise, returns a non 0 value. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 35...
10 - IEventSubscriber Delegates IEventSubscriber Delegates MagTeK Universal SDK will invoke the callback function in this chapter to provide the requested data and/or a detailed response. To delegate the event, call the subscribeAll function with the name of a class that implements the IEventSubscriber Delegates interface.
11 - IConfigurationCallback Delegates IConfigurationCallback Delegates MagTek Universal SDK will invoke the callback function in this chapter to provide the requested data and/or a detailed response. These events will be called in a class that implements the IConfigurationCallback Delegates interface.
12 - MTUSDK Enumerations MTUSDK Enumerations 12.1 DeviceType This enum refers to the type of MagTek reader which the SDK will control. Enum Description Reserved for future use. Secure Reader Authenticator devices. eDynamo mDynamo Dynamag SCRA ...
12 - MTUSDK Enumerations 12.2 ConnectionType This enum refers to the communication interface type of MagTek reader which the SDK will control. Enum Description Universal Serial Bus supported devices: DynaFlex DynaFlex Pro Reserved for future use. BLUETOOTH_LE Bluetooth Low Energy devices: ...
Bit 6 = Magnetic Stripe Reader Hardware problem present Bit 7 = Reserved 12.5 PaymentMethod This enum refers to card type for which the device will perform a transaction. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 40...
The transactions is in progress. TransactionError There is an error during the transaction. TransactionApproved The transactions is approved. TransactionDeclined The transactions is declined. TransactionCompleted The transaction is completed. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 41...
This enum refers to the type of user event reported by the device. These events are related to user interaction. Enum Description None No events yet to occur. ContactlessCardPresented Contactless card has been presented. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 42...
Page 43
Card is seated into the chip station. CardUnseated Card was removed from the chip station. CardSwiped Magnetic stripe card was swiped. TouchPresented Touch screen press detected. TouchRemoved Touch screen release detected. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 43...
CoreAPI.getDeviceList List<IDevice> These examples demonstrate methods for creating an IDevice to be used in the MagTek Universal SDK. This also shows how to establish a device specific API, which is not used with the MagTek Universal SDK. Here, a single IDevice is established.
Various events are separately shown below. case EventType.ConnectionState: // Parse for the ConnectionState ConnectionState value = ConnectionStateBuilder.GetValue(data.StringValue); break; case EventType.DeviceResponse: break; case EventType.DeviceExtendedResponse: break; case EventType.DeviceNotification: break; MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 47...
Page 48
– remainder contains the ARQC TLV object IData processorARPC; procARPC.byteArray = sendForAuthorization(data.ByteArray); // Send authorization to device when not in QuickChip mode. if (transaction.QuickChip == false) device.sendAuthorization(procARPC.ByteArray); break; MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 48...
Page 49
// Parse the TLV from data[]. // Abstract Approval status from TLV tag “DFDF1A”. // Abstract Signature Required status from TLV tag at data[0]. break; case EventType.PINBlock: break; case EventType.Signature: break; MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 49...
// Establish a deviceControl from device. IDeviceControl deviceControl = device.getDeviceControl(); // Open the device, then use the IDeviceControl functions. deviceControl.open(); . . . // Close the device. deviceControl.close(); MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 50...
Note: first digit of OID is ommited in the custruction and instead is passed as the configType. data = new byte[] {0xE2,0x09,0xE1,0x07,0xE1,0x05,0xE1,0x03,0xC1,0x01,0x00 }; result = devConfig.getConfigInfo(0x01, data); MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 53...
Page 57
// #2 @Override public void OnEvent(EventType eventType, IData data) String message; switch (eventType); case EventType.DisplayMessage: // Get the message. if (data != NULL) message = data.StringValue(); break; MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 57...
Page 58
// display/retrieve user selection..// set status and selection result. IData selectionData = new IData; selectionData[0] = status; selectionData[1] = selection; device.sendSelection(data); break; MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 58...
Page 59
– remainder contains the ARQC TLV object */ IData processorARPC; procARPC.byteArray = sendForAuthorization(data.ByteArray()); // #4b // Send authorization to device when not in QuickChip mode. if (transaction.QuickChip == false) device.sendAuthorization(procARPC.ByteArray()); break; MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 59...
Page 60
= data.StringValue(); // A data size of 0 is an instruction to clear the display. if (data.StringValue().Length == 0) // Clear the UI display. break; MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 60...
Page 61
– remainder contains the Batch Data TLV object // Parse the TLV from data[]. // Abstract Approval status from TLV tag “DFDF1A”. // Abstract Signature Required status from TLV tag data[0]. break; MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 61...
Host displays a message each time the transaction fails until successful or until Host decides to end the transaction. Device sends the transaction result. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 62...
Page 63
Appendix C - EMV Transaction Flow Begin initial transaction: startTransaction() MSR+Chip+Contactless OnEvent() ”PRESENT CARD” Card holder presents card. “NOT ACCEPTED” “REMOVE CARD” “FAILED" Transaction terminated with fallback type MSR. MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java ) Page 63...