# 集成清单

{% hint style="success" %}
为了确保您集成 AsiaBill 完整的流程，请完成以下必要的清单
{% endhint %}

### 获取测试账号信息

1. 根据您当前需要的环境获取API[地址常量](https://asiabill.gitbook.io/api-explorer/#api-di-zhi-chang-liang)
2. 根据您的需求选择你的需要的[测试账号](https://app.gitbook.com/s/Mb9UzyxGUyxHylm4UJSJ/fu-lu/ce-shi-zhang-hao-xin-xi)
3. 您需要获得对应的 网关号 和 signKey，添加到代码中

### 进行付款

1. 你可以通过[站内支付](https://asiabill.gitbook.io/docs/zhi-fu/zai-xian-zhi-fu/zhan-nei-zhi-fu)，[跳转支付](https://asiabill.gitbook.io/docs/zhi-fu/zai-xian-zhi-fu/tuo-guan-zhi-fu)的方式集成
2. 如果出现异常可以查询[常见错误码](https://app.gitbook.com/s/Mb9UzyxGUyxHylm4UJSJ/fu-lu/chang-jian-cuo-wu-ma)或者[常见问题](https://app.gitbook.com/s/Mb9UzyxGUyxHylm4UJSJ/fu-lu/chang-jian-wen-ti)
3. 测试支付：成功交易，失败交易，3D交易
4. 检查特定参数的必要性
   * callbackUrl：接收异步回调
   * goodsDetails：商品信息
   * customerIp：客户ip（非跳转支付时必须）
5. 不同交易结果的处理

### 支付结果跳转 <a href="#notification-webhooks" id="notification-webhooks"></a>

跳转支付，本地支付，3D交易完成交易后，重定向到的returnUrl。

1. 处理url中的交易信息
2. 验证返回结果中的签名信息，并正确获取支付结果，更新您的网站订单状态
3. 成功交易：重定向到成功页面
4. 失败交易：展示失败原因信息

### 上传物流

您的订单发货后需[上传物流信息](https://app.gitbook.com/s/Mb9UzyxGUyxHylm4UJSJ/api-reference/wu-liu)到 AsiaBill 系统进行结算审核。

### 通知Webhook <a href="#notification-webhooks" id="notification-webhooks"></a>

AsiaBill 依靠[交易通知webhook](https://app.gitbook.com/s/Mb9UzyxGUyxHylm4UJSJ/webhook/jiao-yi-shi-jian)来通知您的系统支付结果，在某些情况下还有其他的事件，例如[退款结果事件](https://app.gitbook.com/s/Mb9UzyxGUyxHylm4UJSJ/webhook/tui-kuan-shi-jian)，[拒付事件](https://app.gitbook.com/s/Mb9UzyxGUyxHylm4UJSJ/webhook/ju-fu-shi-jian)等。

1. 确保您的callbackUrl能接收我们的webhook
2. 接收并处理通知，验证返回结果中的签名信息，并正确获取支付结果，更新您的网站订单状态
3. 输出success报文表示处理成功

### 上线

您需要一个正式的账号开始 AsiaBill 的付款。

把接口地址切换为[生产环境](https://asiabill.gitbook.io/api-explorer/#sheng-chan-huan-jing)

站内支付同时还需要把加载的js脚本切换为生产环境

{% hint style="info" %}
除了必要的集成，您还可以选择以下需要的清单

如您的系统不集成以下清单，可在AsiaBill商户后台进行操作
{% endhint %}

### 授权交易完成/撤销

需要[预授权交易](https://asiabill.gitbook.io/docs/zhi-fu/geng-duo-zhi-fu-chang-jing/yu-shou-quan-zhi-fu)。

1. 预授权完成，交易成功。
2. 预授权撤销，交易失败。

### 交易查询

如需要获订单的交易信息或者核对订单状态，可以进行[交易查询](https://app.gitbook.com/s/Mb9UzyxGUyxHylm4UJSJ/api-reference/jiao-yi-cha-xun)。

1. 交易流水查询，批量查询交易信息
2. 订单信息查询，根据orderId查询交易信息

### 进行退款

如需要在您的系统中完成[退款](https://app.gitbook.com/s/Mb9UzyxGUyxHylm4UJSJ/api-reference/tui-kuan)操作。

1. 退款申请
   * 申请成功，退款结果由webhook通知
   * 申请失败
2. 退款查询


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://asiabill.gitbook.io/docs/zhi-fu/zai-xian-zhi-fu/ji-cheng-qing-dan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
