Skip to content

Commit

Permalink
docs: update docs (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmetZC authored Dec 13, 2022
1 parent cbada63 commit af7cd03
Show file tree
Hide file tree
Showing 29 changed files with 683 additions and 38 deletions.
4 changes: 2 additions & 2 deletions docs/transferbatch/CloseReasonType.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# CloseReasonType

MERCHANT_REVOCATION - 商户主动撤销,商户主动撤销(页面方式) OVERDUE_CLOSE - 系统超时关闭,系统超时关闭,可能原因账户余额不足或其他错误

## 枚举


* `MERCHANT_REVOCATION` (value: `"MERCHANT_REVOCATION"`)

* `OVERDUE_CLOSE` (value: `"OVERDUE_CLOSE"`)

* `TRANSFER_SCENE_INVALID` (value: `"TRANSFER_SCENE_INVALID"`)


[\[返回类型列表\]](README.md#类型列表)
[\[返回接口列表\]](README.md#接口列表)
Expand Down
22 changes: 20 additions & 2 deletions docs/transferbatch/FailReasonType.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# FailReasonType

ACCOUNT_FROZEN - 账户冻结,该用户账户被冻结 REAL_NAME_CHECK_FAIL - 用户未实名,收款人未实名认证,需要用户完成微信实名认证 NAME_NOT_CORRECT - 用户姓名校验失败,收款人姓名校验不通过,请核实信息 OPENID_INVALID - Openid校验失败,Openid格式错误或者不属于商家公众账号 TRANSFER_QUOTA_EXCEED - 超过用户单笔收款额度,超过用户单笔收款额度,核实产品设置是否准确 DAY_RECEIVED_QUOTA_EXCEED - 超过用户单日收款额度,超过用户单日收款额度,核实产品设置是否准确 MONTH_RECEIVED_QUOTA_EXCEED - 超过用户单月收款额度,超过用户单月收款额度,核实产品设置是否准确 DAY_RECEIVED_COUNT_EXCEED - 超过用户单日收款次数,超过用户单日收款次数,核实产品设置是否准确 PRODUCT_AUTH_CHECK_FAIL - 产品权限校验失败,未开通该权限或权限被冻结,请核实产品权限状态 OVERDUE_CLOSE - 转账关闭,超过系统重试期,系统自动关闭 ID_CARD_NOT_CORRECT - 用户身份证校验失败,收款人身份证校验不通过,请核实信息 ACCOUNT_NOT_EXIST - 用户账户不存在,该用户账户不存在 TRANSFER_RISK - 转账存在风险,该笔转账可能存在风险,已被微信拦截 REALNAME_ACCOUNT_RECEIVED_QUOTA_EXCEED - 用户账户收款受限,请引导用户在微信支付查看详情

## 枚举


Expand Down Expand Up @@ -31,8 +29,28 @@

* `TRANSFER_RISK` (value: `"TRANSFER_RISK"`)

* `OTHER_FAIL_REASON_TYPE` (value: `"OTHER_FAIL_REASON_TYPE"`)

* `REALNAME_ACCOUNT_RECEIVED_QUOTA_EXCEED` (value: `"REALNAME_ACCOUNT_RECEIVED_QUOTA_EXCEED"`)

* `RECEIVE_ACCOUNT_NOT_PERMMIT` (value: `"RECEIVE_ACCOUNT_NOT_PERMMIT"`)

* `PAYEE_ACCOUNT_ABNORMAL` (value: `"PAYEE_ACCOUNT_ABNORMAL"`)

* `PAYER_ACCOUNT_ABNORMAL` (value: `"PAYER_ACCOUNT_ABNORMAL"`)

* `TRANSFER_SCENE_UNAVAILABLE` (value: `"TRANSFER_SCENE_UNAVAILABLE"`)

* `TRANSFER_SCENE_INVALID` (value: `"TRANSFER_SCENE_INVALID"`)

* `TRANSFER_REMARK_SET_FAIL` (value: `"TRANSFER_REMARK_SET_FAIL"`)

* `RECEIVE_ACCOUNT_NOT_CONFIGURE` (value: `"RECEIVE_ACCOUNT_NOT_CONFIGURE"`)

* `BLOCK_B2_C_USERLIMITAMOUNT_BSRULE_MONTH` (value: `"BLOCK_B2C_USERLIMITAMOUNT_BSRULE_MONTH"`)

* `BLOCK_B2_C_USERLIMITAMOUNT_MONTH` (value: `"BLOCK_B2C_USERLIMITAMOUNT_MONTH"`)


[\[返回类型列表\]](README.md#类型列表)
[\[返回接口列表\]](README.md#接口列表)
Expand Down
7 changes: 4 additions & 3 deletions docs/transferbatch/InitiateBatchTransferRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
名称 | 类型 | 描述 | 补充说明
------------ | ------------- | ------------- | -------------
**Appid** | **string** | 申请商户号的appid或商户号绑定的appid(企业号corpid即为此appid) |
**OutBatchNo** | **string** | 商户系统内部的商家批次单号,在商户系统内部唯一 |
**OutBatchNo** | **string** | 商户系统内部的商家批次单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 |
**BatchName** | **string** | 该笔批量转账的名称 |
**BatchRemark** | **string** | 转账说明,UTF8编码,最多允许32个字符 |
**TotalAmount** | **int64** | 转账金额单位为“分”。转账总金额必须与批次内所有明细转账金额之和保持一致,否则无法发起转账操作 |
**TotalNum** | **int64** | 一个转账批次单最多发起三千笔转账。转账总笔数必须与批次内所有明细之和保持一致,否则无法发起转账操作 |
**TransferDetailList** | [**[]TransferDetailInput**](TransferDetailInput.md) | 发起批量转账的明细列表,最多三千笔 | [可选]
**TotalNum** | **int64** | 一个转账批次单最多发起一千笔转账。转账总笔数必须与批次内所有明细之和保持一致,否则无法发起转账操作 |
**TransferDetailList** | [**[]TransferDetailInput**](TransferDetailInput.md) | 发起批量转账的明细列表,最多一千笔 | [可选]
**TransferSceneId** | **string** | 必填,指定该笔转账使用的转账场景ID | [可选]

[\[返回类型列表\]](README.md#类型列表)
[\[返回接口列表\]](README.md#接口列表)
Expand Down
20 changes: 10 additions & 10 deletions docs/transferbatch/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# 微信支付 API v3 Go SDK - transferbatch

- 场景及业务流程:
商户可通过该产品实现同时向多个用户微信零钱进行转账的操作,可用于发放奖金补贴、佣金货款结算、员工报销等场景。
[https://pay.weixin.qq.com/index.php/public/product/detail?pid=108&productType=0](https://pay.weixin.qq.com/index.php/public/product/detail?pid=108&productType=0)
- 接入步骤:
- 商户在微信支付商户平台开通“批量转账到零钱”产品权限,并勾选“使用API方式发起转账”。
- 调用批量转账接口,对多个用户微信零钱发起转账。
- 调用查询批次接口,可获取到转账批次详情及当前状态。
- 调用查询明细接口,可获取到单条转账明细详情及当前状态。
* 场景及业务流程:
商户可通过该产品实现同时向多个用户微信零钱进行转账的操作,可用于发放奖金补贴、佣金货款结算、员工报销等场景。
[https://pay.weixin.qq.com/index.php/public/product/detail?pid=108&productType=0](https://pay.weixin.qq.com/index.php/public/product/detail?pid=108&productType=0)
* 接入步骤:
* 商户在微信支付商户平台开通“批量转账到零钱”产品权限,并勾选“使用API方式发起转账”。
* 调用批量转账接口,对多个用户微信零钱发起转账。
* 调用查询批次接口,可获取到转账批次详情及当前状态。
* 调用查询明细接口,可获取到单条转账明细详情及当前状态。

## 总览
本 SDK 由 WechatPay APIv3 SDK 生成器生成。生成器基于 [OpenAPI Generator](https://openapi-generator.tech) 构建。

- API 版本: 1.0.1
- API 版本: 1.0.3

## 接口列表

Expand All @@ -22,7 +22,7 @@
------------ | ------------- | ------------- | -------------
*TransferBatchApi* | [**GetTransferBatchByNo**](TransferBatchApi.md#gettransferbatchbyno) | **Get** /v3/transfer/batches/batch-id/{batch_id} | 通过微信批次单号查询批次单
*TransferBatchApi* | [**GetTransferBatchByOutNo**](TransferBatchApi.md#gettransferbatchbyoutno) | **Get** /v3/transfer/batches/out-batch-no/{out_batch_no} | 通过商家批次单号查询批次单
*TransferBatchApi* | [**InitiateBatchTransfer**](TransferBatchApi.md#initiatebatchtransfer) | **Post** /v3/transfer/batches | 发起批量转账
*TransferBatchApi* | [**InitiateBatchTransfer**](TransferBatchApi.md#initiatebatchtransfer) | **Post** /v3/transfer/batches | 发起商家转账
*TransferDetailApi* | [**GetTransferDetailByNo**](TransferDetailApi.md#gettransferdetailbyno) | **Get** /v3/transfer/batches/batch-id/{batch_id}/details/detail-id/{detail_id} | 通过微信明细单号查询明细单
*TransferDetailApi* | [**GetTransferDetailByOutNo**](TransferDetailApi.md#gettransferdetailbyoutno) | **Get** /v3/transfer/batches/out-batch-no/{out_batch_no}/details/out-detail-no/{out_detail_no} | 通过商家明细单号查询明细单

Expand Down
28 changes: 16 additions & 12 deletions docs/transferbatch/TransferBatchApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
------------- | ------------- | -------------
[**GetTransferBatchByNo**](#gettransferbatchbyno) | **Get** /v3/transfer/batches/batch-id/{batch_id} | 通过微信批次单号查询批次单
[**GetTransferBatchByOutNo**](#gettransferbatchbyoutno) | **Get** /v3/transfer/batches/out-batch-no/{out_batch_no} | 通过商家批次单号查询批次单
[**InitiateBatchTransfer**](#initiatebatchtransfer) | **Post** /v3/transfer/batches | 发起批量转账
[**InitiateBatchTransfer**](#initiatebatchtransfer) | **Post** /v3/transfer/batches | 发起商家转账



Expand All @@ -28,7 +28,6 @@ import (
"log"

"github.com/wechatpay-apiv3/wechatpay-go/core"
"github.com/wechatpay-apiv3/wechatpay-go/core/option"
"github.com/wechatpay-apiv3/wechatpay-go/services/transferbatch"
"github.com/wechatpay-apiv3/wechatpay-go/utils"
)
Expand All @@ -43,7 +42,8 @@ func main() {
// 使用 utils 提供的函数从本地文件中加载商户私钥,商户私钥会用来生成请求的签名
mchPrivateKey, err := utils.LoadPrivateKeyWithPath("/path/to/merchant/apiclient_key.pem")
if err != nil {
log.Print("load merchant private key error")
log.Printf("load merchant private key error:%s", err)
return
}

ctx := context.Background()
Expand All @@ -54,6 +54,7 @@ func main() {
client, err := core.NewClient(ctx, opts...)
if err != nil {
log.Printf("new wechat pay client err:%s", err)
return
}

svc := transferbatch.TransferBatchApiService{Client: client}
Expand Down Expand Up @@ -114,7 +115,6 @@ import (
"log"

"github.com/wechatpay-apiv3/wechatpay-go/core"
"github.com/wechatpay-apiv3/wechatpay-go/core/option"
"github.com/wechatpay-apiv3/wechatpay-go/services/transferbatch"
"github.com/wechatpay-apiv3/wechatpay-go/utils"
)
Expand All @@ -129,7 +129,8 @@ func main() {
// 使用 utils 提供的函数从本地文件中加载商户私钥,商户私钥会用来生成请求的签名
mchPrivateKey, err := utils.LoadPrivateKeyWithPath("/path/to/merchant/apiclient_key.pem")
if err != nil {
log.Print("load merchant private key error")
log.Printf("load merchant private key error:%s", err)
return
}

ctx := context.Background()
Expand All @@ -140,6 +141,7 @@ func main() {
client, err := core.NewClient(ctx, opts...)
if err != nil {
log.Printf("new wechat pay client err:%s", err)
return
}

svc := transferbatch.TransferBatchApiService{Client: client}
Expand Down Expand Up @@ -186,7 +188,7 @@ Name | Type | Description

> InitiateBatchTransferResponse InitiateBatchTransfer(InitiateBatchTransferRequest)
发起批量转账
发起商家转账



Expand All @@ -200,7 +202,6 @@ import (
"log"

"github.com/wechatpay-apiv3/wechatpay-go/core"
"github.com/wechatpay-apiv3/wechatpay-go/core/option"
"github.com/wechatpay-apiv3/wechatpay-go/services/transferbatch"
"github.com/wechatpay-apiv3/wechatpay-go/utils"
)
Expand All @@ -215,7 +216,8 @@ func main() {
// 使用 utils 提供的函数从本地文件中加载商户私钥,商户私钥会用来生成请求的签名
mchPrivateKey, err := utils.LoadPrivateKeyWithPath("/path/to/merchant/apiclient_key.pem")
if err != nil {
log.Print("load merchant private key error")
log.Printf("load merchant private key error:%s", err)
return
}

ctx := context.Background()
Expand All @@ -226,25 +228,27 @@ func main() {
client, err := core.NewClient(ctx, opts...)
if err != nil {
log.Printf("new wechat pay client err:%s", err)
return
}

svc := transferbatch.TransferBatchApiService{Client: client}
resp, result, err := svc.InitiateBatchTransfer(ctx,
transferbatch.InitiateBatchTransferRequest{
Appid: core.String("wxf636efh567hg4356"),
OutBatchNo: core.String("plfk2020042013"),
BatchName: core.String("2019年1月深圳分部报销单"),
BatchRemark: core.String("2019年1月深圳分部报销单"),
OutBatchNo: core.String("plfk2020042013"),
TotalAmount: core.Int64(4000000),
TotalNum: core.Int64(200),
TransferDetailList: []transferbatch.TransferDetailInput{transferbatch.TransferDetailInput{
TransferAmount: core.Int64(200000),
UserName: core.String("757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45"),
OutDetailNo: core.String("x23zy545Bd5436"),
UserIdCard: core.String("8609cb22e1774a50a930e414cc71eca06121bcd266335cda230d24a7886a8d9f"),
TransferAmount: core.Int64(200000),
TransferRemark: core.String("2020年4月报销"),
Openid: core.String("o-MYE42l80oelYMDE34nYD456Xoy"),
UserName: core.String("757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45"),
UserIdCard: core.String("8609cb22e1774a50a930e414cc71eca06121bcd266335cda230d24a7886a8d9f"),
}},
TransferSceneId: core.String("1000"),
},
)

Expand Down
2 changes: 1 addition & 1 deletion docs/transferbatch/TransferBatchEntity.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

名称 | 类型 | 描述 | 补充说明
------------ | ------------- | ------------- | -------------
**TransferDetailList** | [**[]TransferDetailCompact**](TransferDetailCompact.md) | 当批次状态为“FINISHED”(已完成),且成功查询到转账明细单时返回。包括微信明细单号、明细状态信息 |
**TransferBatch** | [**TransferBatchGet**](TransferBatchGet.md) | 转账批次单基本信息 |
**TransferDetailList** | [**[]TransferDetailCompact**](TransferDetailCompact.md) | 当批次状态为“FINISHED”(已完成),且成功查询到转账明细单时返回。包括微信明细单号、明细状态信息 | [可选]

[\[返回类型列表\]](README.md#类型列表)
[\[返回接口列表\]](README.md#接口列表)
Expand Down
3 changes: 2 additions & 1 deletion docs/transferbatch/TransferBatchGet.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
**BatchType** | **string** | API:API方式发起 WEB:页面方式发起 |
**BatchName** | **string** | 该笔批量转账的名称 |
**BatchRemark** | **string** | 转账说明,UTF8编码,最多允许32个字符 |
**CloseReason** | [**CloseReasonType**](CloseReasonType.md) | 如果批次单状态为“CLOSED”(已关闭),则有关闭原因 | [可选]
**TotalAmount** | **int64** | 转账金额单位为“分” |
**TotalNum** | **int64** | 一个转账批次单最多发起三千笔转账 |
**CreateTime** | **time.Time** | 批次受理成功时返回,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE | [可选]
Expand All @@ -20,7 +21,7 @@
**SuccessNum** | **int64** | 转账成功的笔数。当批次状态为“PROCESSING”(转账中)时,转账成功笔数随时可能变化 | [可选]
**FailAmount** | **int64** | 转账失败的金额,单位为“分” | [可选]
**FailNum** | **int64** | 转账失败的笔数 | [可选]
**CloseReason** | [**CloseReasonType**](CloseReasonType.md) | 如果批次单状态为“CLOSED”(已关闭),则有关闭原因 | [可选]
**TransferSceneId** | **string** | 指定的转账场景ID | [可选]

[\[返回类型列表\]](README.md#类型列表)
[\[返回接口列表\]](README.md#接口列表)
Expand Down
10 changes: 6 additions & 4 deletions docs/transferbatch/TransferDetailApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"log"

"github.com/wechatpay-apiv3/wechatpay-go/core"
"github.com/wechatpay-apiv3/wechatpay-go/core/option"
"github.com/wechatpay-apiv3/wechatpay-go/services/transferbatch"
"github.com/wechatpay-apiv3/wechatpay-go/utils"
)
Expand All @@ -42,7 +41,8 @@ func main() {
// 使用 utils 提供的函数从本地文件中加载商户私钥,商户私钥会用来生成请求的签名
mchPrivateKey, err := utils.LoadPrivateKeyWithPath("/path/to/merchant/apiclient_key.pem")
if err != nil {
log.Print("load merchant private key error")
log.Printf("load merchant private key error:%s", err)
return
}

ctx := context.Background()
Expand All @@ -53,6 +53,7 @@ func main() {
client, err := core.NewClient(ctx, opts...)
if err != nil {
log.Printf("new wechat pay client err:%s", err)
return
}

svc := transferbatch.TransferDetailApiService{Client: client}
Expand Down Expand Up @@ -110,7 +111,6 @@ import (
"log"

"github.com/wechatpay-apiv3/wechatpay-go/core"
"github.com/wechatpay-apiv3/wechatpay-go/core/option"
"github.com/wechatpay-apiv3/wechatpay-go/services/transferbatch"
"github.com/wechatpay-apiv3/wechatpay-go/utils"
)
Expand All @@ -125,7 +125,8 @@ func main() {
// 使用 utils 提供的函数从本地文件中加载商户私钥,商户私钥会用来生成请求的签名
mchPrivateKey, err := utils.LoadPrivateKeyWithPath("/path/to/merchant/apiclient_key.pem")
if err != nil {
log.Print("load merchant private key error")
log.Printf("load merchant private key error:%s", err)
return
}

ctx := context.Background()
Expand All @@ -136,6 +137,7 @@ func main() {
client, err := core.NewClient(ctx, opts...)
if err != nil {
log.Printf("new wechat pay client err:%s", err)
return
}

svc := transferbatch.TransferDetailApiService{Client: client}
Expand Down
2 changes: 1 addition & 1 deletion docs/transferbatch/TransferDetailEntity.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
**DetailStatus** | **string** | PROCESSING:转账中。正在处理中,转账结果尚未明确 SUCCESS:转账成功 FAIL:转账失败。需要确认失败原因后,再决定是否重新发起对该笔明细单的转账(并非整个转账批次单) |
**TransferAmount** | **int64** | 转账金额单位为“分” |
**TransferRemark** | **string** | 单条转账备注(微信用户会收到该备注),UTF8编码,最多允许32个字符 |
**FailReason** | [**FailReasonType**](FailReasonType.md) | 如果转账失败则有失败原因 | [可选]
**Openid** | **string** | 商户appid下,某用户的openid |
**UserName** | **string** | 收款方姓名。采用标准RSA算法,公钥由微信侧提供 商户转账时传入了收款用户姓名、查询时会返回收款用户姓名 | [可选]
**InitiateTime** | **time.Time** | 转账发起的时间,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE |
**UpdateTime** | **time.Time** | 明细最后一次状态变更的时间,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE |
**FailReason** | [**FailReasonType**](FailReasonType.md) | 如果转账失败则有失败原因 | [可选]

[\[返回类型列表\]](README.md#类型列表)
[\[返回接口列表\]](README.md#接口列表)
Expand Down
4 changes: 2 additions & 2 deletions docs/transferbatch/TransferDetailInput.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

名称 | 类型 | 描述 | 补充说明
------------ | ------------- | ------------- | -------------
**OutDetailNo** | **string** | 商户系统内部区分转账批次单下不同转账明细单的唯一标识 |
**OutDetailNo** | **string** | 商户系统内部区分转账批次单下不同转账明细单的唯一标识,要求此参数只能由数字、大小写字母组成 |
**TransferAmount** | **int64** | 转账金额单位为“分” |
**TransferRemark** | **string** | 单条转账备注(微信用户会收到该备注),UTF8编码,最多允许32个字符 |
**Openid** | **string** | 商户appid下,某用户的openid |
**UserName** | **string** | 收款方姓名。采用标准RSA算法,公钥由微信侧提供 明细转账金额 >= 2,000时,该笔明细必须填写收款用户姓名 同一批次转账明细中的姓名字段传入规则需保持一致,也即全部填写、或全部不填写 若商户传入收款用户姓名,微信支付会校验用户openID与姓名是否一致,并提供电子回单 | [可选]
**UserName** | **string** | 收款方姓名。支持标准RSA算法和国密算法,公钥由微信侧提供 明细转账金额<0.3元时,不允许填写收款用户姓名 明细转账金额 >= 2,000元时,该笔明细必须填写收款用户姓名 同一批次转账明细中的姓名字段传入规则需保持一致,也即全部填写、或全部不填写 若商户传入收款用户姓名,微信支付会校验用户openID与姓名是否一致,并提供电子回单 | [可选]
**UserIdCard** | **string** | 收款方身份证号,可不用填(采用标准RSA算法,公钥由微信侧提供) 当填入收款方身份证号时,姓名字段必须填入。 | [可选]

[\[返回类型列表\]](README.md#类型列表)
Expand Down
17 changes: 17 additions & 0 deletions docs/weixinpayscanandride/BlockReasonEnum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# BlockReasonEnum

## 枚举


* `DELETED` (value: `"DELETED"`)

* `ACCOUNT_FROZEN` (value: `"ACCOUNT_FROZEN"`)

* `OVERDUE` (value: `"OVERDUE"`)


[\[返回类型列表\]](README.md#类型列表)
[\[返回接口列表\]](README.md#接口列表)
[\[返回服务README\]](README.md)


Loading

0 comments on commit af7cd03

Please sign in to comment.