Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoogle-ink committed Jan 16, 2025
1 parent 3866a7f commit 79cbfe0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
Binary file modified .github/wx_gopay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func main() {
* #### [支付宝支付(V3版)](https://github.com/go-pay/gopay/blob/main/doc/alipay_v3.md)
* #### [支付宝支付](https://github.com/go-pay/gopay/blob/main/doc/alipay.md)
* #### [微信支付(V3版)](https://github.com/go-pay/gopay/blob/main/doc/wechat_v3.md)
* 微信商家转账产品升级,目前了解下来老接口暂不受影响,后续gopay会尽快增加新版的商家转账接口,各位用到的关注一下:https://developers.weixin.qq.com/community/pay/doc/000a060bb4c13095b6b27cc1b6ac01
* #### [微信支付(V2版,不推荐)](https://github.com/go-pay/gopay/blob/main/doc/wechat_v2.md)
* #### [QQ支付](https://github.com/go-pay/gopay/blob/main/doc/qq.md)
* #### [通联支付](https://github.com/go-pay/gopay/blob/main/doc/allinpay.md)
Expand Down
43 changes: 22 additions & 21 deletions alipay/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,38 +165,39 @@ func (a *Client) pubParamsHandle(bm gopay.BodyMap, method, bizContent string, au
Set("version", "1.0").
Set("timestamp", time.Now().Format(xtime.TimeLayout))

// 前置参数校验赋值
if a.AppCertSN != gopay.NULL {
pubBody.Set("app_cert_sn", a.AppCertSN)
}
if a.AliPayRootCertSN != gopay.NULL {
pubBody.Set("alipay_root_cert_sn", a.AliPayRootCertSN)
}
// return_url
if a.ReturnUrl != gopay.NULL {
pubBody.Set("return_url", a.ReturnUrl)
}
// notify_url
if a.NotifyUrl != gopay.NULL {
pubBody.Set("notify_url", a.NotifyUrl)
}
// default use app_auth_token
if a.AppAuthToken != gopay.NULL {
pubBody.Set("app_auth_token", a.AppAuthToken)
}
if a.location != nil {
pubBody.Set("timestamp", time.Now().In(a.location).Format(xtime.TimeLayout))
}
if bm != nil {
// version
if version := bm.GetString("version"); version != gopay.NULL {
pubBody.Set("version", version)
}
if a.AppCertSN != gopay.NULL {
pubBody.Set("app_cert_sn", a.AppCertSN)
}
if a.AliPayRootCertSN != gopay.NULL {
pubBody.Set("alipay_root_cert_sn", a.AliPayRootCertSN)
}
// return_url
if a.ReturnUrl != gopay.NULL {
pubBody.Set("return_url", a.ReturnUrl)
}
if returnUrl := bm.GetString("return_url"); returnUrl != gopay.NULL {
pubBody.Set("return_url", returnUrl)
}
if a.location != nil {
pubBody.Set("timestamp", time.Now().In(a.location).Format(xtime.TimeLayout))
}
// notify_url
if a.NotifyUrl != gopay.NULL {
pubBody.Set("notify_url", a.NotifyUrl)
}
if notifyUrl := bm.GetString("notify_url"); notifyUrl != gopay.NULL {
pubBody.Set("notify_url", notifyUrl)
}
// default use app_auth_token
if a.AppAuthToken != gopay.NULL {
pubBody.Set("app_auth_token", a.AppAuthToken)
}
// if user set app_auth_token in body_map, use this
if aat := bm.GetString("app_auth_token"); aat != gopay.NULL {
pubBody.Set("app_auth_token", aat)
Expand Down
1 change: 1 addition & 0 deletions release_note.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
(2) 微信V3:支持设置代理 Host 地址,client.SetProxyHost(),wechat.SetProxyHost()。
(3) 支付宝V3:支持设置代理 Host 地址,client.SetProxyHost()。
(4) 补充部分支付宝V3接口。
(5) 支付宝V3:处理公共参数方法 a.pubParamsHandle() 内逻辑变更,优先判断非body map内的参数赋值。

版本号:v1.5.107
修改记录:
Expand Down

0 comments on commit 79cbfe0

Please sign in to comment.