com.bankframe.services.devices.MTPinPad
Class MagTekIntelliPINDeviceProtocol

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended byjava.io.DataOutputStream
              extended bycom.bankframe.services.devices.MCADeviceProtocol
                  extended bycom.bankframe.services.devices.MTPinPad.MagTekIntelliPINDeviceProtocol
All Implemented Interfaces:
java.io.DataOutput, MagTekIntelliPINDeviceCodes, java.io.Serializable

public class MagTekIntelliPINDeviceProtocol
extends MCADeviceProtocol
implements MagTekIntelliPINDeviceCodes, java.io.Serializable

This class produces messages and codes for sending to a MagTek IntelliPIN card swiper using the serial port output stream

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.bankframe.services.devices.MTPinPad.MagTekIntelliPINDeviceCodes
ACK, BadParityLRC, CancelSessionRequest, CardDataEntryRequest, CardDataEntryResponse, CardDataEntryResponseValue, CD, DisplaySingleStringMessage, EnableDefaultDisplay, EOT, ETX, FS, LoadMasterKey, LoadMasterKeyResponse, LoadMasterKeyResponseValue, MasterKeyBadKeyData, MasterKeyNoError, MasterKeyParityBad, NAK, PinEntryBadAcct, PinEntryBadAmount, PinEntryKeyNotReady, PinEntryMissingFS, PinEntryMissKey, PinEntryNoError, PinEntryRequest, PinEntryResponse, PinEntryResponseValue, ReplaceDefaultDisplay, SetRequestSoftSwitch, SetRequestSoftSwitchResponseValue, SetSwitchFailure, SetSwitchSuccess, STX, SuccessfulRead, TIMEOUT, TracksDisabled, UseMasterKey, UseSessionKey
 
Constructor Summary
MagTekIntelliPINDeviceProtocol(java.io.ByteArrayOutputStream buffer)
          MagTekIntelliPINDeviceProtocol constructor
 
Method Summary
static byte[] asciiArrayToByteArray(byte[] bytes)
          This method converts an array of ascii characters into the actual values that the ascii characters represent.
static byte[] byteArrayToCharArray(byte[] bytes)
          This method converts an array of actual values into their ascii character representation.
static byte[] cancelSessionRequest()
          This method generates cancel Session Request message
static byte[] cardDataEntryRequest(byte[] firstMessage, byte[] secondMessage)
          This method generates card data entry request message
static java.lang.String dataToAsciiData(java.lang.String theRawData)
          This method converts the raw IntelliPIN message data into ascii string.
static byte[] displaySingleString(java.lang.String firstMessage, java.lang.String secondMessage)
          This method generates a display string message
static byte[] enableDefaultDisplay()
          This method generates enable default display message
static java.lang.String getControlChars(byte messageByte)
          Converts the byte into a the PinPad text equivalent message If the byte value isn't a PinPad code it is shown as hex text.
static byte[] loadMasterKey(byte[] masterKey)
          This method generates the message to load the PinPad with the Master Encryption Key This is always the first request sent to IntelliPIN pinpad.
static byte[] pinEntryRequest(byte[] accountNumber, char keyNumber, byte[] transactionAmount)
          This method generates pin entry request
static byte[] replaceDefaultDisplay(java.lang.String displayNumber, java.lang.String lineOneText, java.lang.String lineTwoText)
          This method generates replace default display message
static byte[] requestSoftSwitch(char switchNumber)
          This method generates the Request Soft Switch message
static byte[] setSoftSwitch(char switchNumber, byte theSettingData)
          This method generates Set Soft Switch message
 
Methods inherited from class com.bankframe.services.devices.MCADeviceProtocol
dataToHexData, getHexString, internalbuffer
 
Methods inherited from class java.io.DataOutputStream
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.io.FilterOutputStream
close, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataOutput
write
 

Constructor Detail

MagTekIntelliPINDeviceProtocol

public MagTekIntelliPINDeviceProtocol(java.io.ByteArrayOutputStream buffer)
MagTekIntelliPINDeviceProtocol constructor

Parameters:
buffer - The byte array buffer
Method Detail

cancelSessionRequest

public static byte[] cancelSessionRequest()
                                   throws java.io.IOException
This method generates cancel Session Request message

Returns:
Response data to cancel request
Throws:
java.io.IOException - if an error occurs

requestSoftSwitch

public static byte[] requestSoftSwitch(char switchNumber)
                                throws java.io.IOException
This method generates the Request Soft Switch message

Parameters:
switchNumber - The switch number: 'A'-'G'
Returns:
The request soft switch bytes
Throws:
java.io.IOException - if an error occurs

setSoftSwitch

public static byte[] setSoftSwitch(char switchNumber,
                                   byte theSettingData)
                            throws java.io.IOException
This method generates Set Soft Switch message

Parameters:
switchNumber - The switch number: 'A'-'G'
theSettingData - the setting to set as described in the Magtek IntelliPIN Programming Reference Guide
Returns:
The byte encoding of the Set Soft Switch message
Throws:
java.io.IOException - if an error occurs

cardDataEntryRequest

public static byte[] cardDataEntryRequest(byte[] firstMessage,
                                          byte[] secondMessage)
                                   throws java.io.IOException
This method generates card data entry request message

Parameters:
firstMessage - The first message to display
secondMessage - The second message to display
Returns:
The encoded request
Throws:
java.io.IOException - if an error occurs

enableDefaultDisplay

public static byte[] enableDefaultDisplay()
                                   throws java.io.IOException
This method generates enable default display message

Returns:
the encoded request
Throws:
java.io.IOException - on erro

asciiArrayToByteArray

public static byte[] asciiArrayToByteArray(byte[] bytes)
                                    throws java.lang.NumberFormatException
This method converts an array of ascii characters into the actual values that the ascii characters represent.

Parameters:
bytes - The ascii characters.
Returns:
The actual characters values.
Throws:
java.lang.NumberFormatException - on error

byteArrayToCharArray

public static byte[] byteArrayToCharArray(byte[] bytes)
This method converts an array of actual values into their ascii character representation.

Parameters:
bytes - The actual values.
Returns:
Ascii character representation.

loadMasterKey

public static byte[] loadMasterKey(byte[] masterKey)
                            throws java.io.IOException
This method generates the message to load the PinPad with the Master Encryption Key This is always the first request sent to IntelliPIN pinpad.

Parameters:
masterKey - the master key
Returns:
the encoded request
Throws:
java.io.IOException - on error

pinEntryRequest

public static byte[] pinEntryRequest(byte[] accountNumber,
                                     char keyNumber,
                                     byte[] transactionAmount)
                              throws java.io.IOException
This method generates pin entry request

Parameters:
accountNumber - The account number used during encryption.(optional)
keyNumber - the key number:
'0' to '3' (0x30 to 0x33) = lower Working key
'4' (0x34) = Master key
'5' (0x35) = Session key
'A' to 'Z' (0x41 to 0x5A) = upper working key
'a' to 'z' (0x61 to 0x7A) = upper working key
transactionAmount - transaction decimal amount
(to two decimal places, e.g., 123 = 1.23,
omit the decimal point and commas) (optional)
Returns:
The encoded request
Throws:
java.io.IOException - on error

getControlChars

public static java.lang.String getControlChars(byte messageByte)
Converts the byte into a the PinPad text equivalent message If the byte value isn't a PinPad code it is shown as hex text.

Parameters:
messageByte - The byte to encode
Returns:
String message

dataToAsciiData

public static java.lang.String dataToAsciiData(java.lang.String theRawData)
This method converts the raw IntelliPIN message data into ascii string. If a byte of the string isn't a PinPad code it is shown as hex text.

Parameters:
theRawData - IntelliPIN raw message string
Returns:
An Ascii message

replaceDefaultDisplay

public static byte[] replaceDefaultDisplay(java.lang.String displayNumber,
                                           java.lang.String lineOneText,
                                           java.lang.String lineTwoText)
                                    throws java.io.IOException
This method generates replace default display message

Parameters:
displayNumber - The display number "00" - "11"
lineOneText - first message
lineTwoText - second message
Returns:
byte[] The encoded request
Throws:
java.io.IOException - on error

displaySingleString

public static byte[] displaySingleString(java.lang.String firstMessage,
                                         java.lang.String secondMessage)
                                  throws java.io.IOException
This method generates a display string message

Parameters:
firstMessage - The first message
secondMessage - The second message
Returns:
The encoded request
Throws:
java.io.IOException - on error


Copyright © 2005, 2007, Oracle. All rights reserved.