# Device Display & Interaction (/global/en/docs/Terminal/CodeDevelopment/Device-Display-Interaction)

## Device Display & Interaction (Optional)

### Order Information Synchronization

**API reference**
[DisplayParam Object](doc-id:8d04a5ed)

The SDK provides interfaces to push order details (such as item lists and total amount) to the payment terminal for display, improving the overall user experience.\
This is typically achieved by calling the Display API, and the data format must comply with the terminal requirements.

The Display Request allows you to present content on the payment terminal screen outside of the payment flow.

You can use this feature to:

- Display a QR code for customers to scan (e.g., for membership enrollment or app download).
- Show a digital receipt preview (virtual receipt), optionally with QR codes for each item.
- Display images or promotional content (e.g., advertisements or special offers).
- Force the terminal to show a default idle or standby screen.
- Render a subset of XHTML content (only supported XHTML tags are allowed).

```java
ActionMessageParam displayContentParam = ActionMessageParam.newBuilder()
        .format(OutputFormat3Code.SREF)
        .messageContent("{\"refId\":\"shoppingCart\",\"data\":{\"received\":\"$1.00\",\"discount\":\"$2.00\",\"change\":\"$0.00\",\"actualHarvest\":\"$1.00\",\"details\":[{\"number\":\"1\",\"name\":\"Strawberry Cheese Cake\",\"price\":\"$1.00\",\"qty\":\"1\",\"subTotal\":\"$1.00\"},{\"number\":\"2\",\"name\":\"Chocolate Mousse Cake\",\"price\":\"$1.00\",\"qty\":\"1\",\"subTotal\":\"$1.00\"}]}}")
        .messageDestination(UserInterface4Code.MDSP) //Merchant display
        .minimumDisplayTime(15L) // 15 seconds
        .responseRequiredFlag(true)
        .build();
DisplayParam displayParam = DisplayParam.newBuilder()
        .addDisplayContent(displayContentParam)
        .build();
RetailerManager.getInstance()
        .provideDeviceService()
        .newDisplayExchange(displayParam)
        .startAsyncExchange(new Exchange.RetailerSDKCallback<DisplayResult>() {
            @Override
            public void onError(int code, String msg) {
                Log.e(TAG, "failed: " + code + ", " + msg);
            }
            @Override
            public void onResult(DisplayResult result) {
                Log.i(TAG, "result: " + GsonUtils.toJson(result));
            }
        });
```

### When to Abort a Previous Display

A successful Display callback confirms that the display request was processed; the content remains on the terminal screen. Retain its exchange ID after the callback. When updating Display repeatedly, keep the latest Display exchange ID for each terminal.

If Display content is still shown, before starting an operation that presents its own terminal UI, such as a financial operation or NFC Tag, pass that terminal's latest Display exchange ID as `AbortParam.orgExchangeIdentification` and call Abort. Start the next operation after Abort succeeds.

Operations without a terminal UI, such as Print and Transmit, and further Display updates do not require aborting the previous Display.

### Interaction & Display Guidelines

#### Recommended User Flow

To ensure a smooth user experience, follow this recommended interaction flow:

1. Confirm the amount on the EPOS and tap \*\*"Pay"\*\*.
2. Display a prompt on the EPOS such as \*\*"Please proceed on the payment terminal"\*\*, while the terminal screen guides the user.
3. Display the **final payment result clearly on the EPOS main screen**.

#### Responsibility Boundaries

Clearly separating responsibilities between the EPOS and the payment terminal helps ensure a clean integration design:

**EPOS Responsibilities**

- Business logic processing (pricing, discounts, etc.)
- Initiating payment requests
- Displaying final transaction results
- Printing receipts

**Payment Terminal Responsibilities**

- Secure payment operations (e.g., PIN entry, card authentication)
- Financial message processing
- Printing transaction slips (if a printer is available)