From ea0a6e4a3d113a9e4180576414b60b1cf8be25b4 Mon Sep 17 00:00:00 2001 From: Jerry <85411418@qq.com> Date: Tue, 17 May 2022 18:13:11 +0800 Subject: [PATCH] update comment doc url --- wechat/v3/bill.go | 2 +- wechat/v3/cert.go | 4 ++-- wechat/v3/merchant.go | 13 +++++-------- wechat/v3/transfer.go | 36 ++++++++++++++++++------------------ wechat/v3/withdraw.go | 6 +++--- 5 files changed, 29 insertions(+), 32 deletions(-) diff --git a/wechat/v3/bill.go b/wechat/v3/bill.go index ded27aa4..d810468d 100644 --- a/wechat/v3/bill.go +++ b/wechat/v3/bill.go @@ -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 { diff --git a/wechat/v3/cert.go b/wechat/v3/cert.go index 371602e2..1b2ca580 100644 --- a/wechat/v3/cert.go +++ b/wechat/v3/cert.go @@ -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) @@ -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) diff --git a/wechat/v3/merchant.go b/wechat/v3/merchant.go index af713c68..73380964 100644 --- a/wechat/v3/merchant.go +++ b/wechat/v3/merchant.go @@ -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() @@ -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) @@ -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 @@ -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) @@ -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) diff --git a/wechat/v3/transfer.go b/wechat/v3/transfer.go index bc9d9f86..0a69a682 100644 --- a/wechat/v3/transfer.go +++ b/wechat/v3/transfer.go @@ -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 { @@ -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 { @@ -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") @@ -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") @@ -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) @@ -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) @@ -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") @@ -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") @@ -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) @@ -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) @@ -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) @@ -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) @@ -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 { @@ -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) diff --git a/wechat/v3/withdraw.go b/wechat/v3/withdraw.go index 49ae8648..4ceeed48 100644 --- a/wechat/v3/withdraw.go +++ b/wechat/v3/withdraw.go @@ -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 @@ -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) @@ -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 {