> ## Documentation Index
> Fetch the complete documentation index at: https://devzone.nayax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 显示QR

`displayQR` 方法用于在终端屏幕上显示二维码。它支持可选的标题、副标题和取消按钮。该二维码必须属于预定义的域。

## 要求

> [!NOTE]
>
> JSON-RPC 2.0
>
> TweezerComm 中的所有方法都遵循 JSON-RPC 2.0 结构。有关请求的结构和发送方式的更多详细信息，请参阅[“入门指南”](/docs/integrate-pos-device/tweezercomm/tweezercomm-get-started.md) 。

要调用此方法，请将 `method` 字段设置为 `displayQR`，并按下方所示包含服务名称和参数。

```json theme={null}
{
    "jsonrpc": "2.0",
    "method": "displayQR",
    "params": [
        "device",
        {
            "title": "displayQRtitle",
            "subtitle": "displayQRSubtitle",
            "isCancellable": false,
            "urlData": "https://stackoverflow.com",
            "timeout": 60
        }
    ],
    "id": "32323453"
}
```

### 请求参数

下表描述了该请求的参数：

| 姓名 | 类型 | 描述 |
| - | - | - |
| `title` | `string` | 显示在二维码上方的标题文本 |
| `subtitle` | `string` | 标题下方的副标题文本 |
| `isCancellable` | `boolean` | 是否显示取消按钮（默认值：true） |
| `urlData` | `string` | 编码为二维码的 URL（必填） |
| `timeout` | `integer` | 显示超时时间（秒）（默认值：30） |

## 回复

成功的请求将返回以下响应：

```json theme={null}
{
    "jsonrpc": "2.0",
    "id": "1",
    "result": {
        "statusCode": 0,
        "statusMessage": "ok"
    }
}
```

### 响应参数

下表说明了此方法的响应参数：

| 姓名 | 类型 | 描述 |
| - | - | - |
| `statusCode` | `integer` | 操作状态（0 = 成功） |
| `statusMessage` | `string` | 指示操作结果的消息 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.