# MTSCRA Callback Messages 1 - 10

#### OnDeviceConnectionStateChanged

This message occurs when the state of the device is changed.

<table data-header-hidden><thead><tr><th width="149.45458984375" 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>MTConnectionState value indicating the state of the device:</p><p>Disconnected Connecting Connected Disconneting</p></td></tr></tbody></table>

#### OnCardDataStateChanged <a href="#id-5.2_oncarddatastatechanged" id="id-5.2_oncarddatastatechanged"></a>

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

<table data-header-hidden><thead><tr><th width="138.54547119140625" 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>obj</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.3_ondatareceived" id="id-5.3_ondatareceived"></a>

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

<table data-header-hidden><thead><tr><th width="141.27276611328125" 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">obj</td><td valign="top">IMTCardData value containing the card data received.</td></tr></tbody></table>

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

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

<table data-header-hidden><thead><tr><th width="134" 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">obj</td><td valign="top">String containing the response data received from the device.</td></tr></tbody></table>

#### OnTransactionStatus (EMV Device Only) <a href="#id-5.5_ontransactionstatus_-emv_device_only" id="id-5.5_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="111.27276611328125" 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">obj</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="96.27276611328125" valign="top"></th><th width="131.36370849609375" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Offset</td><td valign="top">Field Name</td><td valign="top">Value</td></tr><tr><td valign="top"><p> </p><p> </p><p> </p><p> </p><p>0</p></td><td valign="top"><p> </p><p> </p><p> </p><p> </p><p>Event</p></td><td valign="top"><p>Indicates the event that triggered this notification: 0x00 = No events since start of transaction</p><p>0x01 = Card Inserted 0x02 = Card Error</p><p>0x03 = Transaction Progress Change 0x04 = Waiting for User Response 0x05 = Timed Out</p><p>0x06 = Transaction Terminated 0x07 = Host Cancelled Transaction 0x08 = Card Removed</p></td></tr><tr><td valign="top"><p> </p><p>1</p></td><td valign="top">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"><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p>2</p></td><td valign="top"><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p>Current Transaction Progress Indicator</p></td><td valign="top"><p>This one byte field indicates the current processing stage for the transaction: 0x00 = No transaction in progress</p><p>0x01 = waiting for user to insert card 0x02 = powering up the card</p><p>0x03 = selecting the application</p><p>0x04 = waiting user language selection 0x05 = waiting user application selection 0x06 = initiating application</p><p>0x07 = reading application data 0x08 = offline data authentication 0x09 = process restrictions</p><p>0x0A = card holder verification 0x0B = terminal risk management 0x0C = terminal action analysis</p><p>0x0D = generating first application cryptogram 0x0E = card action analysis</p><p>0x0F = online processing</p><p>0x10 = waiting online processing response 0x11 = transaction completion</p><p>0x12 = transaction error 0x13 = transaction approved 0x14 = transaction declined</p></td></tr><tr><td valign="top">3-4</td><td valign="top">Final Status</td><td valign="top">TBD</td></tr></tbody></table>

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

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

<table data-header-hidden><thead><tr><th width="109.45458984375" 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">obj</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.7_onuserselectionrequest_-emv_device_o" id="id-5.7_onuserselectionrequest_-emv_device_o"></a>

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

<table data-header-hidden><thead><tr><th width="117.63641357421875" 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">obj</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="79" valign="top"></th><th width="146.72723388671875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Offset</td><td valign="top">Field Name</td><td valign="top">Value</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: 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.8_onarqcreceived_-emv_device_only" id="id-5.8_onarqcreceived_-emv_device_only"></a>

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

<table data-header-hidden><thead><tr><th width="131.272705078125" 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">Obj</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="87.18182373046875" valign="top"></th><th width="160.90911865234375" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Offset</td><td valign="top">Field Name</td><td valign="top">Value</td></tr><tr><td valign="top">0</td><td valign="top">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"><p> </p><p>2</p></td><td valign="top"><p>ARQC</p><p>Message</p></td><td valign="top">Byte array containing the ARQC Message. For details about the ARQC format, see the <em>Programmer's Manual (COMMANDS)</em> for the specific device you are communicating with.</td></tr></tbody></table>

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

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

<table data-header-hidden><thead><tr><th width="131.27276611328125" 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">Obj</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="84.45452880859375" valign="top"></th><th width="185.54547119140625" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Offset</td><td valign="top">Field Name</td><td valign="top">Value</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 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 Batch Data that follows.</td></tr><tr><td valign="top"><p> </p><p>3</p></td><td valign="top"><p> </p><p>Batch Data</p></td><td valign="top">Byte array containing the Batch Data. For details about the batch data format, see the <em>Programmer's Manual (COMMANDS)</em> for the specific device you are communicating with..</td></tr></tbody></table>

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

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

**Result Code Description**

* 0x0000 = Success 0x0001 = Failure
* 0x0381 = Failure, DUKPT scheme is not loaded
* 0x0382 = Failure, DUKPT scheme is loaded but all of its keys have been used&#x20;
* 0x0383 = Failure, DUKPT scheme is not loaded (Security Level not 3 or 4)&#x20;
* 0x0384 = Invalid Total Transaction Time field
* 0x0385 = Invalid Card Type field 0x0386 = Invalid Options field
* 0x0387 = Invalid Amount Authorized field&#x20;
* 0x0388 = Invalid Transaction Type field&#x20;
* 0x0389 = Invalid Cash Back field
* 0x038A = Invalid Transaction Currency Code field&#x20;
* 0x038B = Invalid Selection Status
* 0x038C = Invalid Selection Result
* 0x038D = Failure, no transaction currently in progress&#x20;
* 0x038E = Invalid Reporting Option
* 0x038F = Failure, transaction already in progress 0x0390 = Device Has No Keys
* 0x0391 = Invalid Device Serial Number&#x20;
* 0x0392 = Invalid Type of MAC field&#x20;
* 0x0393 = Invalid Slot Number field&#x20;
* 0x0394 = Invalid Operation field&#x20;
* 0x0395 = Invalid Database Selector field&#x20;
* 0x0396 = Invalid System Date and Time&#x20;
* 0x0396 = Invalid Objects to Write field&#x20;
* 0x0396 = Invalid Tags to Read field
* 0x0396 = Invalid Date / Time data (Date / Time has not been set yet)&#x20;
* 0x0397 = Invalid MAC
* 0x0398 = No Slots Available&#x20;
* 0x0399 = Object Write Protected&#x20;
* 0x039B = Invalid CAPK Checksum
* 0x039C = Invalid Configuration Identifier


---

# 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-android/mtscra-callback-messages/mtscra-callback-messages-1-10.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.
