> For the complete documentation index, see [llms.txt](https://resources.atriptech.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://resources.atriptech.com/api-wen-dang/support-and-reference/troubleshooting-and-support/errors-handing/402-vs-404-vs-406-vs-615.md).

# 402 vs 404 vs 406 vs 615

{% hint style="info" %}
💬 **需要帮助？** 如果遇到问题，请在帮助中心咨询 Eva，快速获取诊断建议。

<a href="https://www.atriptech.com/" class="button primary" data-icon="comments">咨询 Eva</a>
{% endhint %}

当支付状态不明确时使用本页面，判断再次调用 `pay.do` 是否安全。

### 简要回答

`402` 表示当前订单状态不支持支付。

`404` 表示订单已支付。

`406` 表示支付仍在进行中。

`615` 表示支付已完成但航空公司 PNR 仍待处理。

在这四种情况下，都不要盲目重试支付。

### 常见问题

#### `402` 后应重试 `pay.do` 吗？

不。

首先查询订单。

#### `404` 后应重试 `pay.do` 吗？

不。

订单已支付。

#### `406` 后应重试 `pay.do` 吗？

还不行。

等待并轮询订单，直到进行中的支付完成。

#### `615` 后应重试 `pay.do` 吗？

不。

支付已完成。

改为监控订单。

### 核心区别

#### `402` — 订单状态不支持支付

**通常含义**

订单不处于可支付状态。

它可能已经在出票或已出票。

**下一步操作**

查询订单。

使用当前订单状态作为真实来源。

#### `404` — 订单已支付

**通常含义**

先前的支付已成功。

**下一步操作**

不要再次调用 `pay.do`。

继续订单跟进。

#### `406` — 支付操作正在进行中

**通常含义**

先前的支付请求仍在运行。

**下一步操作**

等待。

轮询 `queryOrderDetails.do` 直到状态明确。

#### `615` — 支付已完成但 PNR 仍待处理

**通常含义**

Atlas 已完成支付，但最终的航空公司 PNR 检索仍未解决。

**下一步操作**

不要重试支付。

继续监控订单。

### 快速决策规则

在生产中使用此规则：

* `402` — 首先查询订单
* `404` — 停止支付重试
* `406` — 等待并轮询
* `615` — 监控订单，绝不重复支付

### 这些代码的共同点

所有四个代码都是订单状态问题，而不是简单的支付输入问题。

它们告诉你在任何新的支付尝试前检查现有订单状态。

### 接下来检查什么

在任何这些代码之后，检查：

* `orderStatus`
* `ticketStatus`
* 航空公司 PNR 详情（如果可用）
* 支付是否已完成或仍在处理中

### 常见错误

#### 将 `406` 视为普通失败

不要这样做。

这意味着第一次支付仍在运行。

#### 将 `615` 视为未支付订单

不要这样做。

支付已成功。

#### 在未检查订单的情况下重试 `402` 或 `404`

不要这样做。

这会产生重复支付风险。

### 最佳实践

在 `pay.do` 之后，遵循一个恢复规则：

如果订单可能已支付、正在出票或等待航空公司确认，在进行任何进一步的支付操作前切换到订单查询。

### 相关页面

* [支付错误](/api-wen-dang/support-and-reference/troubleshooting-and-support/errors-handing/payment-errors.md)
* [支付与出票](/api-wen-dang/product-guides/booking/booking-step-guides/payment-and-ticketing.md)
* [轮询和出票时机](/api-wen-dang/product-guides/booking/booking-step-guides/query-order/post-payment-polling.md)
* [查询订单](/api-wen-dang/product-guides/booking/booking-step-guides/query-order.md)
* [混合支付指南](/api-wen-dang/product-guides/booking/booking-step-guides/payment-and-ticketing/hybrid-payment-guide.md)
* [错误代码](/api-wen-dang/support-and-reference/troubleshooting-and-support/errors-handing.md)
