# MTSCRA Events

#### OnDeviceList

This event occurs when device information is available.

public event DeviceListHandler OnDeviceList

public delegate void DeviceListHandler(object sender, MTConnectionType connectionType, List\<MTDeviceInformation> deviceList)

<table data-header-hidden><thead><tr><th width="152.66668701171875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">Sender</td><td valign="top">Object representing the publisher of the event</td></tr><tr><td valign="top"><p> </p><p>connectionType</p></td><td valign="top">MTConnectionType value: MTConnectionType.Audio, MTConnectionType.USB</td></tr><tr><td valign="top">deviceList</td><td valign="top">A list of MTDeviceInformation objects</td></tr></tbody></table>

#### OnDeviceConnectionStateChanged <a href="#id-5.2_ondeviceconnectionstatechanged" id="id-5.2_ondeviceconnectionstatechanged"></a>

This event occurs when the connection state of the device is changed.

public event DeviceConnectionStateHandler&#x20;

OnDeviceConnectionStateChanged

public delegate void DeviceConnectionStateHandler(object sender, MTConnectionState state)

<table data-header-hidden><thead><tr><th width="128.66668701171875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">sender</td><td valign="top">Object representing the publisher of the event</td></tr><tr><td valign="top"><p> </p><p> </p><p>state</p></td><td valign="top"><p>MTDeviceState value indicating the state of the device:</p><p>Disconnected Connecting Error Connected Disconneting</p></td></tr></tbody></table>

#### OnCardDataState <a href="#id-5.3_oncarddatastate" id="id-5.3_oncarddatastate"></a>

This event occurs when the state of the card information is changed.

public event CardDataStateHandler OnCardDataState

public delegate void CardDataStateHandler(object sender, MTCardDataState state)

<table data-header-hidden><thead><tr><th width="152.66668701171875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">sender</td><td valign="top">Object representing the publisher of the event</td></tr><tr><td valign="top"><p> </p><p>state</p></td><td valign="top"><p>MTCardDataState value indicating the state of the card data:</p><p>DataNotReady DataReady DataError</p></td></tr></tbody></table>

#### OnDataReceived <a href="#id-5.4_ondatareceived" id="id-5.4_ondatareceived"></a>

This event occurs when card information is received from the device.

public event DataReceivedHandler OnDataReceived

public delegate void DataReceivedHandler(object sender, IMTCardData cardData)

<table data-header-hidden><thead><tr><th width="152.66668701171875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">sender</td><td valign="top">Object representing the publisher of the event</td></tr><tr><td valign="top">cardData</td><td valign="top">IMTCardData object containing the card information received</td></tr></tbody></table>

#### OnDeviceResponse <a href="#id-5.5_ondeviceresponse" id="id-5.5_ondeviceresponse"></a>

This event occurs when a response is received from the device.

public event DeviceResponseHandler OnDeviceResponse

public delegate void DeviceResponseHandler(object sender, string data)

<table data-header-hidden><thead><tr><th width="146.66668701171875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">sender</td><td valign="top">Object representing the publisher of the event</td></tr><tr><td valign="top">data</td><td valign="top">String representing data received</td></tr></tbody></table>

#### OnTransactionStatus (EMV Device Only) <a href="#id-5.6_ontransactionstatus_-emv_device_only" id="id-5.6_ontransactionstatus_-emv_device_only"></a>

This message occurs when transaction status update is received from the EMV device.

<table data-header-hidden><thead><tr><th width="124" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">sender</td><td valign="top">Object representing the publisher of the event</td></tr><tr><td valign="top">data</td><td valign="top">Byte array containing the data received from the device. See table below for descriptions of the data.</td></tr><tr><td valign="top">0 Event</td><td valign="top"><p>Indicates the event that triggered this notification:</p><p>·       0x00 = No events since start of transaction</p><p>·       0x01 = Card Inserted (Contact Only)</p><p>·       0x02 = Payment method communication or data error</p><p>·       0x03 = Transaction Progress Change</p><p>·       0x04 = Waiting for User Response</p><p>·       0x05 = Timed Out</p><p>·       0x06 = End of Transaction</p><p>·       0x07 = Host Cancelled Transaction</p><p>·       0x08 = Card Removed (Contact Only)</p></td></tr><tr><td valign="top">1 Current Transaction Time remaining</td><td valign="top">Indicates the remaining time available, in seconds, for the transaction to complete. If the transaction does not complete within this time, it will be aborted.</td></tr><tr><td valign="top">2 Current Transaction Progress Indicator</td><td valign="top"><p>This one-byte field indicates the current processing stage for the transaction:</p><p>·       0x00 = No transaction in progress</p><p>·       0x01 = Waiting for cardholder to present payment</p><p>·       0x02 = Powering up the card</p><p>·       0x03 = Selecting the application</p><p>·       0x04 = Waiting for user language selection (Contact Only)</p><p>·       0x05 = Waiting for user application selection (Contact Only)</p><p>·       0x06 = Initiating application (Contact Only)</p><p>·       0x07 = Reading application data (Contact Only)</p><p>·       0x08 = Offline data authentication (Contact Only)</p><p>·       0x09 = Process restrictions (Contact Only)</p><p>·       0x0A = Cardholder verification (Contact Only)</p><p>·       0x0B = Terminal risk management (Contact Only)</p><p>·       0x0C = Terminal action analysis (Contact Only)</p><p>·       0x0D = Generating first application cryptogram (Contact Only)</p><p>·       0x0E = Card action analysis (Contact Only)</p><p>·       0x0F = Online processing</p><p>·       0x10 = Waiting online processing response</p><p>·       0x11 = Transaction Complete</p><p>·       0x12 = Transaction Error</p><p>·       0x13 = Transaction Approved</p><p>·       0x14 = Transaction Declined</p><p>·       0x15 = Transaction Cancelled by MSR Swipe (MSR Only)</p><p>·       0x16 = EMV error - Conditions Not Satisfied (Contact Only)</p><p>·       0x17 = EMV error - Card Blocked (Contact Only)</p><p>·       0x18 = Application selection failed (Contact Only)</p><p>·       0x19 = EMV error - Card Not Accepted (Contact Only)</p><p>·       0x1A = Empty Candidate List</p><p>·       0x1B = Application Blocked</p></td></tr><tr><td valign="top">3-4 Final Status</td><td valign="top">TBD</td></tr></tbody></table>

#### OnDisplayMessageRequest (EMV Device Only) <a href="#id-5.7_ondisplaymessagerequest_-emv_device" id="id-5.7_ondisplaymessagerequest_-emv_device"></a>

This message occurs when the EMV device has a display message to present to the user.

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">sender</td><td valign="top">Object representing the publisher of the event</td></tr><tr><td valign="top">data</td><td valign="top">Byte array containing the display message. If the length is zero, the request to clear the display.</td></tr></tbody></table>

#### OnUserSelectionRequest (EMV Device Only) <a href="#id-5.8_onuserselectionrequest_-emv_device_o" id="id-5.8_onuserselectionrequest_-emv_device_o"></a>

This message occurs when the EMV device has a user selection message to present to the user.

<table data-header-hidden><thead><tr><th width="132.6666259765625" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">sender</td><td valign="top">Object representing the publisher of the event</td></tr><tr><td valign="top">data</td><td valign="top">Byte array containing the data received from the device. See table below for descriptions of the data.</td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="81.66668701171875" valign="top"></th><th width="156.3333740234375" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"> </td><td valign="top"> </td><td valign="top"> </td></tr><tr><td valign="top"><p> </p><p>0</p></td><td valign="top"><p> </p><p>Selection Type</p></td><td valign="top"><p>This field specifies what kind of selection request this is:</p><p>·       0x00 – Application Selection</p><p>·       0x01 – Language Selection</p></td></tr><tr><td valign="top"><p> </p><p>1</p></td><td valign="top"><p> </p><p>Timeout</p></td><td valign="top">Specifies the maximum time, in seconds, allowed to complete the selection process. If this time is exceeded, the host should send the User Selection Result command with transaction will be aborted and an appropriate Transaction Status will be available. Value 0 is not allowed.</td></tr><tr><td valign="top"><p> </p><p> </p><p> </p><p> </p><p>2</p></td><td valign="top"><p> </p><p> </p><p> </p><p> </p><p>Menu Items</p></td><td valign="top"><p>This field is variable length and is a collection of “C” style zero terminated strings (maximum 17 strings). The maximum length of each string is 20 characters, not including a Line Feed (0x0A) character that may be in the string. The last string may not have the Line Feed character.</p><p>The first string is a title and should not be considered for selection.</p><p>It is expected that the receiver of the notification will display the menu items and return (in the User Selection Result request) the number of the item the user selects. The minimum value of the Selection Result should be 1 (the first item, #0, was a title line only). The maximum value of the Selection Result is based on the number of items displayed.</p></td></tr></tbody></table>

#### OnARQCReceived (EMV Device Only) <a href="#id-5.9_onarqcreceived_-emv_device_only" id="id-5.9_onarqcreceived_-emv_device_only"></a>

This message occurs when ARQC is received from the EMV device.

<table data-header-hidden><thead><tr><th width="130" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">sender</td><td valign="top">Object representing the publisher of the event</td></tr><tr><td valign="top">data</td><td valign="top">Byte array containing the data received from the device. See table below for descriptions of the data.</td></tr><tr><td valign="top">0 Message Length</td><td valign="top">Two-byte binary, most significant byte first. This gives the total length of the ARQC message that follows.</td></tr><tr><td valign="top">2 ARQC Message</td><td valign="top">Byte array containing the ARQC Message. See Appendix B for ARQC Message Format.</td></tr></tbody></table>

#### OnTransactionResult (EMV Device Only) <a href="#id-5.10_ontransactionresult_-emv_device_onl" id="id-5.10_ontransactionresult_-emv_device_onl"></a>

This message occurs when transaction result is received from the EMV device.

<table data-header-hidden><thead><tr><th width="121.33331298828125" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">sender</td><td valign="top">Object representing the publisher of the event</td></tr><tr><td valign="top">data</td><td valign="top">Byte array containing the data received from the device. See table below for descriptions of the data.</td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="69" valign="top"></th><th width="190.33331298828125" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"> </td><td valign="top"> </td><td valign="top"> </td></tr><tr><td valign="top"><p> </p><p> </p><p> </p><p>0</p></td><td valign="top"><p> </p><p> </p><p>Signature Required</p></td><td valign="top"><p>This field indicates whether a card holder signature is required to complete the transaction:</p><p>·       0x00 – No signature required</p><p>·       0x01 – Signature required</p><p> </p><p>If a signature is required, it is expected that the host will acquire the signature from the card holder as part of the transaction data.</p></td></tr><tr><td valign="top">1</td><td valign="top">Batch Data Length</td><td valign="top">Two-byte binary, most significant byte first. This gives the total length of the ARQC message that follows.</td></tr><tr><td valign="top">3</td><td valign="top">Batch Data</td><td valign="top">Byte array containing the Batch Data. See Appendix D for Batch Data Format.</td></tr></tbody></table>

#### OnEMVCommandResult (EMV Device Only) <a href="#id-5.11_onemvcommandresult_-emv_device_only" id="id-5.11_onemvcommandresult_-emv_device_only"></a>

This message occurs when an EMV command result is received from the EMV device.

<table data-header-hidden><thead><tr><th width="118.66668701171875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">sender</td><td valign="top">Object representing the publisher of the event</td></tr><tr><td valign="top">data</td><td valign="top"><p>Byte array containing the result code received from the device. See table below for descriptions of the result code.</p><ul><li>0x0000 = Success, the transaction process has been started</li><li>0x0381 = Failure, DUKPT scheme is not loaded</li><li>0x0382 = Failure, DUKPT scheme is loaded but all of its keys have been used</li><li>0x0383 = Failure, DUKPT scheme is not loaded (Security Level not 3 or 4)</li><li>0x0384 = Invalid Total Transaction Time field</li><li>0x0385 = Invalid Card Type field</li><li>0x0386 = Invalid Options field</li><li>0x0387 = Invalid Amount Authorized field</li><li>0x0388 = Invalid Transaction Type field</li><li>0x0389 = Invalid Cash Back field</li><li>0x038A = Invalid Transaction Currency Code field </li><li>0x038B = Invalid Selection Status</li><li>0x038C = Invalid Selection Result</li><li>0x038D = Failure, no transaction currently in progress</li><li>0x038E = Invalid Reporting Option</li><li>0x038F = Failure, transaction in progress, card already inserted</li><li>0x0390 = Device Has No Keys</li><li>0x0391 = Invalid Device Serial Number</li><li>0x0396 = Invalid System Date and Time</li></ul></td></tr></tbody></table>

### OnDeviceExtendedResponse (EMV Device Only)

This message occurs when an extended response is received from the device.

<table data-header-hidden><thead><tr><th width="127.33331298828125" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p> </p><p>Obj</p></td><td valign="top"><p>Hexadecimal string containing the extended response data received from the device.</p><p> </p><p>The first two bytes represent the result codes for the extended command. The next two bytes (most significant byte first) indicate the total length of the following data in bytes.</p></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.magtek.com/hardware/card-readers/magnetic-stripe-readers/idynamo-5-gen-iii/documentation/developers-manuals/programmers-manual-.net-pcl/mtscra-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
