# Display (/global/en/docs/Terminal/DeviceServices/Display)

## Display

A display request lets you show information on the display of the payment terminal outside of a payment flow. You can:

- Show a QR code that the shopper can scan with their mobile device. For example, a QR code with the URL to join your loyalty program or to download an app.
- Let the shopper preview a virtual receipt of the items they are purchasing. You can also show a QR code next to the receipt lines.
- Engage shoppers by showing an image, such as an advertisement or an offer generated by the POS app.
- Force the terminal to show the regular standby or idle screen.
- Show a XHTML document which includes a subset of the XHTML output tag.

> **WARN**
>
> Abort a previous Display only when it is still shown and the next operation presents its own terminal UI, such as a financial operation or NFC Tag. Wait for the Abort to complete before starting that operation. Print, Transmit, and further Display updates do not require this step. See [Device Display & Interaction](doc-id:afad6b34) for details.

#### Display Request

**DisplayParam**

**displayContents** *array of dictionaries* — Required

Content or reference of the message.

**ActionMessageParam** *dictionary*

Information to display, print or store.

**Child attributes** of `ActionMessageParam`

**format** *enum* — Required

Message format.

**Possible enum values**

- `BARC` — "Barcode to output in several possible."
- `MENT` — "A text to display as a menu before requesting an input."
- `MREF` — "Predefined configured messages identified by a reference."
- `SREF` — "Screen to display identified by a reference."
- `TEXT` — "Text without format attributes."
- `HTML` — "XHTML document which includes a subset of the XHTML output tag."

**messageContent** *string* — Required

Content or reference of the message.

**messageDestination** *enum* — Required

Destination of the message.

**Possible enum values**

- `CDSP` — "CardholderDisplay: Cardholder display or interface."
- `CRCP` — "CardholderReceipt: Cardholder receipt."
- `MDSP` — "MerchantDisplay: Merchant display or interface."
- `MRCP` — "MerchantReceipt: Merchant receipt."
- `CRDO` — "OtherCardholderInterface: Other interface of the cardholder, for instance e-mail or smartphone message."

**minimumDisplayTime** *integer*

Number of seconds the message has to be displayed.

**responseRequiredFlag** *boolean / string*

Flag to request a message response. Android and C# use a Boolean; iOS uses a string.

#### Display Response

**DisplayResult**

**recipientPartyIdentification** *string* — Required

Unique identification of the partner that is the recipient of the message exchange.\
For example, the POS SN

**response** *enum* — Required

Result of the requested transaction.

**Possible enum values**

- `SUCC` — "Success.\nProcessing OK. Information related to the result of the processing is contained in other parts of the response message."
- `FAIL` — "Failure.\nProcessing of the request fails for various reasons."
- `PART` — "Partial Approved.\nThe service was partially completed. Use the Message Status service to query the final transaction status."

**responseReason** *string*

Detail of the response.

**Possible enum values**

- `ABRT` — "Aborted.\nThe initiator of the request has sent an abort message request, which was accepted and processed."
- `BUSY` — "Busy.\nThe system is busy, try later."
- `CANC` — "Cancel.\nThe user has aborted the transaction on the PED keyboard, for instance during PIN entering."
- `DEVO` — "DeviceOut.\nDevice out of order."
- `WPIN` — "WrongPIN.\nThe user has entered the PIN on the PED keyboard and the verification fails."
- `NHOS` — "UnreachableHost.\nAcquirer or any host is unreachable or has not answered to an online request, so is considered as temporary unavailable.\nDepending on the Sale context, the request could be repeated(to be compared with \\"Refusal\\")"
- `UNVS` — "UnavailableService.\nThe service is not available (not implemented, not configured, protocol version too old…)."
- `UNVD` — "UnavailableDevice.\nThe hardware is not available (absent, not configured…)"
- `REFU` — "Refusal.\nThe transaction is refused by the host or by the local rules associated to the card or the POI."
- `TNFD` — "NotFound.\nThe transaction is not found (e.g. for a reversal or a repeat)."
- `WIPG` — "InProgress.\nThe transaction is still in progress and then the command cannot be processed."

**additionalResponseInformation** *string*

Additional information to be logged for further examination.

**Transaction parameters**

When you receive the terminal result through the SDK callback interface and **DisplayResult.response = SUCC**, you can obtain additional details to support your business requirements.

The following fields are defined, and the availability of each field depends on the capabilities provided by the payment application.

**outputResultList** *array of dictionaries*

The outputResultList is a collection or array that stores multiple results generated by a process, function, or operation.

**OutputResult1** *dictionary*

Information to display, print or store.

**Child attributes** of `OutputResult1`

**response** *dictionaries*

Gives reponse for each peripheral.

**response** *enum*

Result of the requested transaction.

**Possible enum values**

- `SUCC` — "Success.\nProcessing OK. Information related to the result of the processing is contained in other parts of the response message."
- `FAIL` — "Failure.\nProcessing of the request fails for various reasons."
- `PART` — "Partial Approved.\nThe service was partially completed. Use the Message Status service to query the final transaction status."

**responseReason** *string*

Detail of the response.

**Possible enum values**

- `ABRT` — "Aborted.\nThe initiator of the request has sent an abort message request, which was accepted and processed."
- `BUSY` — "Busy.\nThe system is busy, try later."
- `CANC` — "Cancel.\nThe user has aborted the transaction on the PED keyboard, for instance during PIN entering."
- `DEVO` — "DeviceOut.\nDevice out of order."
- `WPIN` — "WrongPIN.\nThe user has entered the PIN on the PED keyboard and the verification fails."
- `NHOS` — "UnreachableHost.\nAcquirer or any host is unreachable or has not answered to an online request, so is considered as temporary unavailable.\nDepending on the Sale context, the request could be repeated(to be compared with \\"Refusal\\")"
- `UNVS` — "UnavailableService.\nThe service is not available (not implemented, not configured, protocol version too old…)."
- `UNVD` — "UnavailableDevice.\nThe hardware is not available (absent, not configured…)"
- `REFU` — "Refusal.\nThe transaction is refused by the host or by the local rules associated to the card or the POI."
- `TNFD` — "NotFound.\nThe transaction is not found (e.g. for a reversal or a repeat)."
- `WIPG` — "InProgress.\nThe transaction is still in progress and then the command cannot be processed."

**additionalResponseInformation** *string*

Additional information to be logged for further examination.

**deviceType** *enum*

Message format.

**Possible enum values**

- `CDSP` — "CardholderDisplay: Cardholder display or interface."
- `CRCP` — "CardholderReceipt: Cardholder receipt."
- `MDSP` — "MerchantDisplay: Merchant display or interface."
- `MRCP` — "MerchantReceipt: Merchant receipt."
- `CRDO` — "OtherCardholderInterface: Other interface of the cardholder, for instance e-mail or smartphone message."

**informationQualifier** *enum*

DISP: Standard display interface.

#### Display Examples

| Scenario      | Format | Content                                   |
| ------------- | ------ | ----------------------------------------- |
| Shopping cart | `SREF` | JSON data for the `shoppingCart` template |
| XHTML content | `HTML` | Supported XHTML content                   |

#### Shopping Cart Display (SREF)

Use `SREF` with the fixed `shoppingCart` template identifier. Replace the cart values while preserving the field names and JSON structure.

```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));
            }
        });
```

#### XHTML Content Display (HTML)

The following examples use `HTML` to display supported XHTML content.

```java
ActionMessageParam displayContentParam = ActionMessageParam.newBuilder()
        .format(OutputFormat3Code.HTML)
        .messageContent("<html><body><h1>Display test</h1></body></html>")
        .messageDestination(UserInterface4Code.CDSP) //Cardholder display
        .minimumDisplayTime(15L) // 15 seconds
        .responseRequiredFlag(true)
        .build();
DisplayParam displayParam = DisplayParam.newBuilder()
        .addDisplayContent(displayContentParam)
        .build();
RetailerManager.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));
            }
});
```