> For the complete documentation index, see [llms.txt](https://asiabill.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asiabill.gitbook.io/docs/zhi-fu/geng-duo-zhi-fu-chang-jing/xun-huan-kou-kuan/zhan-nei-zhi-fu.md).

# 站内支付

## 交互流程

![循环扣款，首次支付交互图](https://4182117768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcSYgMg71VCxeEVhWhVFp%2Fuploads%2FeSX7jWnRZbUBkDgYyKyQ%2FInitRecurring%EF%BC%88%E6%97%A0PCI%E8%B5%84%E8%B4%A8%EF%BC%89.png?alt=media\&token=e1a14ab8-1b39-463b-bf3e-053b51229c26)

![循环扣款，非首次支付交互图](https://4182117768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcSYgMg71VCxeEVhWhVFp%2Fuploads%2FdCtUVfHTUlS8Q8UotK5W%2FRecurring.png?alt=media\&token=5669f620-a361-4be7-b3d4-665b9ee4f41c)

## 循环扣款对接流程（首次支付）:

&#x20;       首次支付流程请参考[站内支付接入流程](/docs/zhi-fu/zai-xian-zhi-fu/zhan-nei-zhi-fu.md)

{% hint style="info" %}
首次支付应该传入创建的customerId和customerPaymentMethodId，并指定字段tokenType="InitRecurring"，如下图所示：
{% endhint %}

![](https://4182117768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcSYgMg71VCxeEVhWhVFp%2Fuploads%2FjhTUF3Crl0aMSduTwzg1%2FInitRecurring%E8%AF%B7%E6%B1%82%E4%BB%A3%E7%A0%81%E6%A1%88%E4%BE%8B.png?alt=media\&token=2f6ff13c-306f-421f-9210-b5464cfda898)

## 循环扣款对接流程（非首次支付）:

### 1. 扣款请求 <mark style="color:blue;">**`server`**</mark>

&#x20;        商户服务端调用[/confirmCharge](https://asiabill.gitbook.io/api-explorer/api-reference/jiao-yi/confirm-charge)发起扣款业务

{% hint style="info" %}

1. 如果首次支付失败了，则需要重新创建并发起首次扣款成功后，才能发起后续循环扣款。
2. 如果首次支付成功，可以使用第一笔订单返回的customerId,paymentMethodId来发起循环扣款，并指定字段tokenType="Recurring"，如下图所示：
3. 为降低拒付风险，建议尽可能清楚地告知客户收取费用的频率和金额。我们建议在非首次扣款前几天通知客户，例如通过向他们发送电子邮件。
   {% endhint %}

![](https://4182117768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcSYgMg71VCxeEVhWhVFp%2Fuploads%2FzSSqSBWQZcmsdlHN99Ly%2FRecurring%E8%AF%B7%E6%B1%82%E4%BB%A3%E7%A0%81%E6%A1%88%E4%BE%8B.png?alt=media\&token=5836f659-538f-4227-bc85-c4c34208482d)

### 2. 验证签名

&#x20;          根据 [数据签名过程](https://asiabill.gitbook.io/api-explorer/fu-lu/shu-ju-qian-ming-guo-cheng) 验证返回信息

### 3. 解析返回信息

&#x20;          不需要进行3DS验证，直接解析交易结果

### 4. webhook 通知处理

在订单完成后，AsiaBill系统会触发webhook，调用商户交易时给定的callbackUrl，来通知商户交易结果状态，详情请参阅 [webhook](https://asiabill.gitbook.io/api-explorer/webhook/gai-shu)
