> ## 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.

# doPinpadTransaction

`doPinpadTransaction` 方法用于在 PinPad 流程中，在初始读卡之后继续进行中的 EMV 交易。此操作主要用于提示持卡人输入 PIN，或与支付终端交换额外的 EMV 数据（标签），以推进 EMV 状态机的运行。

> [!WARNING]
>
> 仅限接触式交易
>
> 此方法适用于接触式交易（插卡），需要终端与 PIN 密码键盘之间进行受控的多步骤 EMV 交互。

## 要求

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

请在请求中确保配置以下内容：

* `method` 字段必须设置为 `doPinpadTransaction`。
* params 中的 `service` 必须设置为 `engine`。

该请求包含服务名称，以及主机系统必须返回给终端/卡片以继续交易对话的 EMV 标签字典。

```json theme={null}
{
   "jsonrpc": "2.0",
   "method": "doPinpadTransaction",
   "id": "123454352",
   "params": [
       "engine",
       {
           "tags": {
               "95": "tag value",
               "9F02": "tag value"
           }
       }
   ]
}
```

### 请求参数

下表描述了此方法的请求参数。

| 姓名 | 类型 | 描述 |
| :- | :- | :- |
| `tags` | 字符串的 JSON | 包含主机系统必须返回给卡片/终端以继续 EMV 对话所需的 EMV 标签-值对的字典。 |

## 回复

成功的响应表示 PinPad 交易状态已推进，即已成功从持卡人处采集 PIN，或已完成一轮 EMV 数据交换。

```json theme={null}
{
   "jsonrpc": "2.0",
   "id": "123454352",
   "result": {
       "statusCode": 0,
       "statusMessage": "ok",
       "pem": EMVMANAGER_CONTACT,
       "tags": {
           "95": "tag value",
           "9F02": "tag value",
           "5A": "tag value",
           "5F34": "tag value",
           "5F2A": "tag value",
           "9F02": "tag value",
           "9F03": "tag value",
           "9A": "tag value",
           "9C": "tag value",
           "9F1A": "tag value",
           "9F21": "tag value",
           "9F37": "tag value",
           "9F36": "tag value",
           "9F26": "tag value",
           "9F27": "tag value"
       }
   }
}
```

### 响应参数

下面是一个包含所有可能的响应参数及其描述的表格：

| 姓名 | 类型 | 描述 |
| :- | :- | :- |
| `statusCode` | 整数 | PinPad 交易状态。值为 `0` 表示成功。 |
| `statusMessage` | string | 交易消息（例如 `ok`）。 |
| `pem` | 整数 | POS 输入方式（POS Entry Mode），表示读卡方式（例如 `EMVMANAGER_CONTACT`）。 |
| `tags` | 字符串的 JSON | 包含来自卡片/终端的更新或新增 EMV 标签-值对的字典，包括掩码 PAN（`5A`）或更新后的密文（cryptogram）等信息。 |


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