Skip to content

Commit

Permalink
update comment doc url
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoogle-ink committed May 17, 2022
1 parent d250854 commit ea0a6e4
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 32 deletions.
2 changes: 1 addition & 1 deletion wechat/v3/bill.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (c *ClientV3) V3BillFundFlowBill(ctx context.Context, bm gopay.BodyMap) (wx
// 申请特约商户资金账单API
// 注意:如 bill_date 为空,默认查前一天的
// Code = 0 is success
// 文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter7_2.shtml
// 文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_17.shtml
func (c *ClientV3) V3BillEcommerceFundFlowBill(ctx context.Context, bm gopay.BodyMap) (wxRsp *EcommerceFundFlowBillRsp, err error) {
if bm != nil {
if bm.GetString("bill_date") == util.NULL {
Expand Down
4 changes: 2 additions & 2 deletions wechat/v3/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
// - 程序实现定期更新平台证书的逻辑,不要硬编码验证应答消息签名的平台证书
// - 定期调用该接口,间隔时间小于12小时
// - 加密请求消息中的敏感信息时,使用最新的平台证书(即:证书启用时间较晚的证书)
// 文档说明:https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay5_1.shtml
// 文档说明:https://pay.weixin.qq.com/wiki/doc/apiv3/apis/wechatpay5_1.shtml
func GetPlatformCerts(ctx context.Context, mchid, apiV3Key, serialNo, privateKey string) (certs *PlatformCertRsp, err error) {
var (
eg = new(errgroup.Group)
Expand Down Expand Up @@ -191,7 +191,7 @@ func (c *ClientV3) GetAndSelectNewestCert() (cert, serialNo string, err error) {
// - 程序实现定期更新平台证书的逻辑,不要硬编码验证应答消息签名的平台证书
// - 定期调用该接口,间隔时间小于12小时
// - 加密请求消息中的敏感信息时,使用最新的平台证书(即:证书启用时间较晚的证书)
// 文档说明:https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay5_1.shtml
// 文档说明:https://pay.weixin.qq.com/wiki/doc/apiv3/apis/wechatpay5_1.shtml
func (c *ClientV3) getPlatformCerts() (certs *PlatformCertRsp, err error) {
var (
eg = new(errgroup.Group)
Expand Down
13 changes: 5 additions & 8 deletions wechat/v3/merchant.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
// 查询特约商户账户实时余额、查询二级商户账户实时余额
// Code = 0 is success
// 注意:服务商时,bm参数传 nil
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter5_1.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_11.shtml
// 电商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_7_1.shtml
func (c *ClientV3) V3EcommerceBalance(ctx context.Context, subMchid string, bm gopay.BodyMap) (*EcommerceBalanceRsp, error) {
url := fmt.Sprintf(v3EcommerceBalance, subMchid) + "?" + bm.EncodeURLParams()
Expand Down Expand Up @@ -68,8 +68,7 @@ func (c *ClientV3) V3EcommerceDayBalance(ctx context.Context, subMchid, date str

// 查询账户实时余额
// Code = 0 is success
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter5_1.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter5_2.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_12.shtml
// 电商平台:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_7_3.shtml
func (c *ClientV3) V3MerchantBalance(ctx context.Context, accountType string) (*MerchantBalanceRsp, error) {
url := fmt.Sprintf(v3MerchantBalance, accountType)
Expand Down Expand Up @@ -98,8 +97,7 @@ func (c *ClientV3) V3MerchantBalance(ctx context.Context, accountType string) (*
// 查询账户日终余额
// date示例值:2019-08-17
// Code = 0 is success
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter5_2.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter5_3.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_13.shtml
// 电商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_7_4.shtml
func (c *ClientV3) V3MerchantDayBalance(ctx context.Context, accountType, date string) (*MerchantBalanceRsp, error) {
uri := fmt.Sprintf(v3MerchantDayBalance, accountType) + "?date=" + date
Expand Down Expand Up @@ -127,7 +125,7 @@ func (c *ClientV3) V3MerchantDayBalance(ctx context.Context, accountType, date s

// 特约商户银行来账查询API
// Code = 0 is success
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter3_6.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_19.shtml
func (c *ClientV3) V3EcommerceIncomeRecord(ctx context.Context, bm gopay.BodyMap) (*PartnerIncomeRecordRsp, error) {
uri := v3EcommerceIncomeRecord + "?" + bm.EncodeURLParams()
authorization, err := c.authorization(MethodGet, uri, nil)
Expand All @@ -154,8 +152,7 @@ func (c *ClientV3) V3EcommerceIncomeRecord(ctx context.Context, bm gopay.BodyMap

// 商户/服务商银行来账查询API
// Code = 0 is success
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter3_7.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter3_7.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_20.shtml
func (c *ClientV3) V3MerchantIncomeRecord(ctx context.Context, bm gopay.BodyMap) (*MerchantIncomeRecordRsp, error) {
uri := v3MerchantIncomeRecord + "?" + bm.EncodeURLParams()
authorization, err := c.authorization(MethodGet, uri, nil)
Expand Down
36 changes: 18 additions & 18 deletions wechat/v3/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
// 发起批量转账API
// 注意:入参加密字段数据加密:client.V3EncryptText()
// Code = 0 is success
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter3_1.shtml
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter4_3_1.shtml
func (c *ClientV3) V3Transfer(ctx context.Context, bm gopay.BodyMap) (*TransferRsp, error) {
authorization, err := c.authorization(MethodPost, v3Transfer, bm)
if err != nil {
Expand All @@ -39,7 +39,7 @@ func (c *ClientV3) V3Transfer(ctx context.Context, bm gopay.BodyMap) (*TransferR
// 发起批量转账API(服务商)
// 注意:入参加密字段数据加密:client.V3EncryptText()
// Code = 0 is success
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter3_1.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_1.shtml
func (c *ClientV3) V3PartnerTransfer(ctx context.Context, bm gopay.BodyMap) (*TransferRsp, error) {
authorization, err := c.authorization(MethodPost, v3PartnerTransfer, bm)
if err != nil {
Expand All @@ -65,7 +65,7 @@ func (c *ClientV3) V3PartnerTransfer(ctx context.Context, bm gopay.BodyMap) (*Tr

// 微信批次单号查询批次单API
// Code = 0 is success
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter3_2.shtml
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter4_3_2.shtml
func (c *ClientV3) V3TransferQuery(ctx context.Context, batchId string, bm gopay.BodyMap) (*TransferQueryRsp, error) {
url := fmt.Sprintf(v3TransferQuery, batchId)
bm.Remove("batch_id")
Expand Down Expand Up @@ -94,7 +94,7 @@ func (c *ClientV3) V3TransferQuery(ctx context.Context, batchId string, bm gopay

// 微信批次单号查询批次单API(服务商)
// Code = 0 is success
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter3_2.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_2.shtml
func (c *ClientV3) V3PartnerTransferQuery(ctx context.Context, batchId string, bm gopay.BodyMap) (*PartnerTransferQueryRsp, error) {
url := fmt.Sprintf(v3PartnerTransferQuery, batchId)
bm.Remove("batch_id")
Expand Down Expand Up @@ -123,7 +123,7 @@ func (c *ClientV3) V3PartnerTransferQuery(ctx context.Context, batchId string, b

// 微信明细单号查询明细单API
// Code = 0 is success
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter3_3.shtml
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter4_3_3.shtml
func (c *ClientV3) V3TransferDetail(ctx context.Context, batchId, detailId string) (*TransferDetailRsp, error) {
url := fmt.Sprintf(v3TransferDetail, batchId, detailId)
authorization, err := c.authorization(MethodGet, url, nil)
Expand All @@ -150,7 +150,7 @@ func (c *ClientV3) V3TransferDetail(ctx context.Context, batchId, detailId strin

// 微信明细单号查询明细单API(服务商)
// Code = 0 is success
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter3_3.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_3.shtml
func (c *ClientV3) V3PartnerTransferDetail(ctx context.Context, batchId, detailId string) (*PartnerTransferDetailRsp, error) {
url := fmt.Sprintf(v3PartnerTransferDetail, batchId, detailId)
authorization, err := c.authorization(MethodGet, url, nil)
Expand Down Expand Up @@ -183,7 +183,7 @@ func (c *ClientV3) V3TransferDetailQuery(ctx context.Context, batchId, detailId

// 商家批次单号查询批次单API
// Code = 0 is success
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter3_4.shtml
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter4_3_5.shtml
func (c *ClientV3) V3TransferMerchantQuery(ctx context.Context, outBatchNo string, bm gopay.BodyMap) (*TransferMerchantQueryRsp, error) {
url := fmt.Sprintf(v3TransferMerchantQuery, outBatchNo)
bm.Remove("out_batch_no")
Expand Down Expand Up @@ -212,7 +212,7 @@ func (c *ClientV3) V3TransferMerchantQuery(ctx context.Context, outBatchNo strin

// 商家批次单号查询批次单API(服务商)
// Code = 0 is success
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter3_4.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_4.shtml
func (c *ClientV3) V3PartnerTransferMerchantQuery(ctx context.Context, outBatchNo string, bm gopay.BodyMap) (*PartnerTransferMerchantQueryRsp, error) {
url := fmt.Sprintf(v3PartnerTransferMerchantQuery, outBatchNo)
bm.Remove("out_batch_no")
Expand Down Expand Up @@ -241,7 +241,7 @@ func (c *ClientV3) V3PartnerTransferMerchantQuery(ctx context.Context, outBatchN

// 商家明细单号查询明细单API
// Code = 0 is success
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter3_5.shtml
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter4_3_6.shtml
func (c *ClientV3) V3TransferMerchantDetail(ctx context.Context, outBatchNo, outDetailNo string) (*TransferMerchantDetailRsp, error) {
url := fmt.Sprintf(v3TransferMerchantDetail, outBatchNo, outDetailNo)
authorization, err := c.authorization(MethodGet, url, nil)
Expand All @@ -268,7 +268,7 @@ func (c *ClientV3) V3TransferMerchantDetail(ctx context.Context, outBatchNo, out

// 商家明细单号查询明细单API(服务商)
// Code = 0 is success
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter3_5.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_5.shtml
func (c *ClientV3) V3PartnerTransferMerchantDetail(ctx context.Context, outBatchNo, outDetailNo string) (*PartnerTransferMerchantDetailRsp, error) {
url := fmt.Sprintf(v3PartnerTransferMerchantDetail, outBatchNo, outDetailNo)
authorization, err := c.authorization(MethodGet, url, nil)
Expand Down Expand Up @@ -301,8 +301,8 @@ func (c *ClientV3) V3TransferMerchantDetailQuery(ctx context.Context, outBatchNo

// 转账电子回单申请受理API
// Code = 0 is success
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter4_1.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter4_1.shtml
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter4_3_7.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_6.shtml
func (c *ClientV3) V3TransferReceipt(ctx context.Context, outBatchNo string) (*TransferReceiptRsp, error) {
bm := make(gopay.BodyMap)
bm.Set("out_batch_no", outBatchNo)
Expand Down Expand Up @@ -331,8 +331,8 @@ func (c *ClientV3) V3TransferReceipt(ctx context.Context, outBatchNo string) (*T

// 查询转账电子回单API
// Code = 0 is success
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter4_2.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter4_2.shtml
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter4_3_8.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_7.shtml
func (c *ClientV3) V3TransferReceiptQuery(ctx context.Context, outBatchNo string) (*TransferReceiptQueryRsp, error) {
url := fmt.Sprintf(v3TransferReceiptQuery, outBatchNo)
authorization, err := c.authorization(MethodGet, url, nil)
Expand All @@ -359,8 +359,8 @@ func (c *ClientV3) V3TransferReceiptQuery(ctx context.Context, outBatchNo string

// 转账明细电子回单受理API
// Code = 0 is success
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter4_4.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter4_4.shtml
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter4_3_9.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_8.shtml
func (c *ClientV3) V3TransferDetailReceipt(ctx context.Context, bm gopay.BodyMap) (*TransferDetailReceiptRsp, error) {
authorization, err := c.authorization(MethodPost, v3TransferDetailReceipt, bm)
if err != nil {
Expand All @@ -386,8 +386,8 @@ func (c *ClientV3) V3TransferDetailReceipt(ctx context.Context, bm gopay.BodyMap

// 查询转账明细电子回单受理结果API
// Code = 0 is success
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter4_5.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter4_5.shtml
// 商户文档:https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter4_3_10.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_9.shtml
func (c *ClientV3) V3TransferDetailReceiptQuery(ctx context.Context, bm gopay.BodyMap) (*TransferDetailReceiptQueryRsp, error) {
uri := v3TransferDetailReceiptQuery + "?" + bm.EncodeURLParams()
authorization, err := c.authorization(MethodGet, uri, nil)
Expand Down
6 changes: 3 additions & 3 deletions wechat/v3/withdraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

// 特约商户余额提现、二级商户预约提现
// Code = 0 is success
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter6_1.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_14.shtml
func (c *ClientV3) V3Withdraw(ctx context.Context, bm gopay.BodyMap) (*WithdrawRsp, error) {
if err := bm.CheckEmptyError("sub_mchid", "out_request_no", "amount"); err != nil {
return nil, err
Expand Down Expand Up @@ -43,7 +43,7 @@ func (c *ClientV3) V3Withdraw(ctx context.Context, bm gopay.BodyMap) (*WithdrawR
// 查询特约商户提现状态、二级商户查询预约提现状态
// 注意:withdrawId 和 outRequestNo 二选一
// Code = 0 is success
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter6_2.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_15.shtml
func (c *ClientV3) V3WithdrawStatus(ctx context.Context, withdrawId, outRequestNo string, bm gopay.BodyMap) (*WithdrawStatusRsp, error) {
if withdrawId == gopay.NULL && outRequestNo == gopay.NULL {
return nil, fmt.Errorf("[%w]: withdrawId[%s] and outRequestNo[%s] empty at the same time", gopay.MissParamErr, withdrawId, outRequestNo)
Expand Down Expand Up @@ -142,7 +142,7 @@ func (c *ClientV3) V3EcommerceWithdrawStatus(ctx context.Context, withdrawId, ou
// 按日下载提现异常文件
// 注意:如 bill_date 为空,默认查前一天的
// Code = 0 is success
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter6_3.shtml
// 服务商文档:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_16.shtml
func (c *ClientV3) V3WithdrawDownloadErrBill(ctx context.Context, bm gopay.BodyMap) (wxRsp *BillRsp, err error) {
if bm != nil {
if bm.GetString("bill_date") == util.NULL {
Expand Down

0 comments on commit ea0a6e4

Please sign in to comment.