> For the complete documentation index, see [llms.txt](https://developer.magtek.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.magtek.com/sdks-and-tools/universal-sdk-documentation/linux/appendices/appendix-b-emv-transaction-flow.md).

# Appendix B - EMV Transaction Flow

## Flow Chart: Selections + Quick Chip

<figure><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2F7SR8cRYCigos10iabpNP%2Fimage.png?alt=media&amp;token=a54a6ee0-4201-4311-996b-7e5216fcd188" alt=""><figcaption></figcaption></figure>

## Sample Code: QuickChip <a href="#b.2_sample_code-_quickchip" id="b.2_sample_code-_quickchip"></a>

The following breaks out the EMV flow chart into code. When enabling QuickChip mode, host does not send the ARPC to the device to complete the transaction. Events are shown separately and in the order received.

{% code overflow="wrap" %}

```
// Assign parameters. ITransaction transaction; transaction.Amount = “1.00”;
transaction.CashBack = “0.00”;
transaction.EMVOnly = true;
int PaymentMethodes = = PAYMENT_METHOD_MSR | PAYMENT_METHOD_CONTACT | PAYMENT_METHOD_CONTACTLESS;
transaction.PaymentMethods = PaymentMethods; transaction.QuickChip = true;
transaction.QuickChip = true; // QuickChip mode enabled.

// Start transaction.
bool result = device->startTransaction(transaction);
```

{% endcode %}

<pre data-overflow="wrap"><code>virtual void OnEvent(EventType eventType, IData data)
{
<strong>        string message 
</strong><strong>        switch (eventType);
</strong>                {
                        case EVENT_TYPE_DisplayMessasge:
                        // Get the message.
                        message = data.StringValue; // “Present Card”
        }
}
</code></pre>

{% code overflow="wrap" %}

```
virtual void OnEvent(EventType eventType, IData data)
{
        vector<unsigned car> ARQC; 
        switch (eventType);
                {
                        case EVENT_TYPE_AuthorizationRequest:
                                // Forward ARQC to processor.
                                /* data.ByteArray[0..1] – ARQC length
                                data.ByteArray [2..n] – remainder contains the ARQC TLV object */
                }
}
```

{% endcode %}

<pre data-overflow="wrap"><code>public void OnEvent(EventType eventType, IData data)
{
    string message; 
    switch (eventType);
        {
<strong>    case EVENT_TYPE_DisplayMessage:
</strong>        // Display approval message. 
        message = data.StringValue;
        // A data size of 0 is an instruction to clear the display. 
        if (data.StringValue.length() == 0)
        {
            // Clear the UI display.
        }
    }
}
</code></pre>

{% code overflow="wrap" %}

```
virtual void OnEvent(EventType eventType, IData data)
{
        string message; 
        switch (eventType);
                {
                        case EVENT_TYPE_TransactionResult:
                        /* data.ByteArray[0]	– Signature Required 
                        data.ByteArray [1..2] – Batch Data length
                        data.ByteArray [3..n] – 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].
        }
}
```

{% endcode %}

## Transaction Sequence: Contact/Contactless <a href="#b.3_transaction_sequence-_contact-contac" id="b.3_transaction_sequence-_contact-contac"></a>

<figure><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2FrtxQ056U6nJ1dioD5g3W%2Fimage.png?alt=media&amp;token=db709dfb-440f-4355-8751-7a1fd1d3be8d" alt=""><figcaption></figcaption></figure>

## Transaction Sequence: Contact/Contactless + MPPG <a href="#b.4_transaction_sequence-_contact-contac" id="b.4_transaction_sequence-_contact-contac"></a>

<figure><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2F0FerzY43HrnPkdQUEehD%2Fimage.png?alt=media&amp;token=6798ae7d-ef63-4fe8-ab69-013f4f25942f" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.magtek.com/sdks-and-tools/universal-sdk-documentation/linux/appendices/appendix-b-emv-transaction-flow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
