> 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/fu-hou-cun-ka.md).

# 付后存卡

{% hint style="info" %}
该功能受商户地区/行业/卡种等因素限制，需要向客户经理申请开通
{% endhint %}

Step 1. 商户通过 **customerId** 查询该客户绑定的所有卡支付信息，并在展示在支付区域。

![使用保存过的卡进行扣款](/files/wYMJy5eP6eJXfzoe9vGD)

Step 2.通过保存过的卡信息进行扣款。

![扣款成功](/files/JDCISAwPfUd4NagoaGOv)

## &#x20;接入流程

### 1. 创建customer <mark style="color:blue;">**`server`**</mark>

&#x20;         商户服务端调用 创建客户接口：[/customers](https://asiabill.gitbook.io/api-explorer/api-reference/jiao-yi/customer)，获取customerId

### 2. 创建paymentMethod <mark style="color:blue;">**`server`**</mark>

&#x20;         商户服务端调用 创建支付方式接口：[/payment\_methods](https://asiabill.gitbook.io/api-explorer/api-reference/jiao-yi/payment-methods)，获取customerPaymentMethodId

{% hint style="info" %}
站内支付模式请参考站内支付接入流程：[创建支付方式](https://asiabill.gitbook.io/docs/zhi-fu/geng-duo-zhi-fu-chang-jing/pages/PA7mltdpHYzwQKE6F8QT#4.-chuang-jian-zhi-fu-fang-shi-web)
{% endhint %}

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

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

{% hint style="info" %}
调用[/confirmCharge](https://asiabill.gitbook.io/api-explorer/api-reference/jiao-yi/confirm-charge) 接口时，传入customerId和customerPaymentMethodId即可将卡支付信息与customerId进行绑定。
{% endhint %}

### 4. 获取该用户绑定的卡支付信息 <mark style="color:blue;">**`server`**</mark>

&#x20;          商户通过[/payment\_methods/list/{customerId}](https://asiabill.gitbook.io/api-explorer/api-reference/jiao-yi/payment-methods#v2022-03-payment_methods-list-customerid) 接口，查询该客户绑定的所有卡支付信息，并在展示在支付区域

{% hint style="info" %}
站内支付模式请参考站内支付接入流程：[展示付款区域](https://asiabill.gitbook.io/docs/zhi-fu/geng-duo-zhi-fu-chang-jing/pages/PA7mltdpHYzwQKE6F8QT#2.-zhan-shi-fu-kuan-qu-yu-web)
{% endhint %}

### 5. 用户直接选择卡支付信息

&#x20;         商户前端将用户选择的卡支付信息对应的customerId和customerPaymentMethodId传入商户后端

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

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

{% hint style="info" %}
调用[/confirmCharge](https://asiabill.gitbook.io/api-explorer/api-reference/jiao-yi/confirm-charge) 接口时，传入用户选择的卡支付信息对应的customerId和customerPaymentMethodId
{% endhint %}
