Skip to content

Commit

Permalink
添加微信转账到银行卡API 相关的接口 (#54)
Browse files Browse the repository at this point in the history
* add 企业转账到银行卡API相关接口

* 整理 Readme 和 release_note,调整方法说明
  • Loading branch information
iGoogle-ink authored Jul 9, 2020
1 parent a9346e3 commit 8ba9607
Show file tree
Hide file tree
Showing 12 changed files with 386 additions and 166 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ func main() {
* 完结分账(正式):client.ProfitSharingFinish()
* 分账回退(正式):client.ProfitSharingReturn()
* 分账回退结果查询(正式):client.ProfitSharingReturnQuery()
* 自定义方法请求微信API接口:client.PostRequest()
* 企业付款到银行卡API(正式):client.PayBank()
* 查询企业付款到银行卡API(正式):client.QueryBank()
* 获取RSA加密公钥API(正式):client.GetRSAPublicKey()
* 自定义方法请求微信API接口:client.PostWeChatAPISelf()

### 微信公共API

Expand Down Expand Up @@ -102,7 +105,7 @@ func main() {
* 退款查询:client.RefundQuery()
* 交易账单:client.StatementDown()
* 资金账单:client.AccRoll()
* 自定义方法请求微信API接口:client.PostRequest()
* 自定义方法请求微信API接口:client.PostQQAPISelf()

### QQ公共API

Expand Down
2 changes: 1 addition & 1 deletion constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ const (
SUCCESS = "SUCCESS"
FAIL = "FAIL"
OK = "OK"
Version = "1.5.14"
Version = "1.5.15"
)
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/iGoogle-ink/gopay

go 1.13

require github.com/iGoogle-ink/gotil v1.0.2
require github.com/iGoogle-ink/gotil v1.0.3
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0U
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/iGoogle-ink/gotil v1.0.2 h1:z58bvmhq31twxecMkyWU5Mh8H7T9SGPOTvUuAw9vB7M=
github.com/iGoogle-ink/gotil v1.0.2/go.mod h1:HOeCIcJkJLAsQ+cAPdozZS3huVDT4YUKN/F7tmvvrbM=
github.com/iGoogle-ink/gotil v1.0.3 h1:iTT+Jjm2v5idaxE7q/DU2rGm9zi+bvZJLKtaFiVQefk=
github.com/iGoogle-ink/gotil v1.0.3/go.mod h1:HOeCIcJkJLAsQ+cAPdozZS3huVDT4YUKN/F7tmvvrbM=
github.com/jinzhu/gorm v1.9.14/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
Expand Down
8 changes: 8 additions & 0 deletions qq/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ func NewClient(mchId, apiKey string) (client *Client) {
return nil
}

// 向QQ发送Post请求,对于本库未提供的QQ API,可自行实现,通过此方法发送请求
// bm:请求参数的BodyMap
// url:完整url地址,例如:https://qpay.qq.com/cgi-bin/pay/qpay_unified_order.cgi
// tlsConfig:tls配置,如无需证书请求,传nil
func (q *Client) PostQQAPISelf(bm gopay.BodyMap, url string, tlsConfig *tls.Config) (bs []byte, err error) {
return q.doQQ(bm, url, tlsConfig)
}

// 提交付款码支付
// 文档地址:https://qpay.qq.com/buss/wiki/1/1122
func (q *Client) MicroPay(bm gopay.BodyMap) (qqRsp *MicroPayResponse, err error) {
Expand Down
9 changes: 0 additions & 9 deletions qq/service_api.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package qq

import (
"crypto/tls"
"encoding/json"
"encoding/xml"
"errors"
Expand All @@ -16,14 +15,6 @@ import (
"github.com/iGoogle-ink/gotil"
)

// 向QQ发送Post请求,对于本库未提供的微信API,可自行实现,通过此方法发送请求
// bm:请求参数的BodyMap
// url:完整url地址,例如:https://qpay.qq.com/cgi-bin/pay/qpay_unified_order.cgi
// tlsConfig:tls配置,如无需证书请求,传nil
func (q *Client) PostRequest(bm gopay.BodyMap, url string, tlsConfig *tls.Config) (bs []byte, err error) {
return q.doQQ(bm, url, tlsConfig)
}

// 解析QQ支付异步通知的结果到BodyMap
// req:*http.Request
// 返回参数bm:Notify请求的参数
Expand Down
18 changes: 18 additions & 0 deletions release_note.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
版本号:Release 1.5.15
发布时间:2020/07/09 18:30
修改记录:
(1) 微信:新增client方法:client.ProfitSharing()
(2) 微信:新增client方法:client.MultiProfitSharing()
(3) 微信:新增client方法:client.ProfitSharingQuery()
(4) 微信:新增client方法:client.ProfitSharingAddReceiver()
(5) 微信:新增client方法:client.ProfitSharingRemoveReceiver()
(6) 微信:新增client方法:client.ProfitSharingFinish()
(7) 微信:新增client方法:client.ProfitSharingReturn()
(8) 微信:新增client方法:client.ProfitSharingReturnQuery()
(9) 微信:新增client方法:client.PayBank()
(10) 微信:新增client方法:client.QueryBank()
(11) 微信:新增client方法:client.GetRSAPublicKey()
(12) 微信:修改client方法名:client.PostRequest() -> client.PostWeChatAPISelf()
(13) QQ:修改client方法名:client.PostRequest() -> client.PostQQAPISelf()
(14) 说明:方法未经严格测试,还请开发者在开始使用时确认是否正常使用,有问题请提 issue

版本号:Release 1.5.14
发布时间:2020/06/27 3:30
修改记录:
Expand Down
Loading

0 comments on commit 8ba9607

Please sign in to comment.