Skip to content

Commit

Permalink
v1.5.86
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoogle-ink committed Oct 28, 2022
1 parent 9b8a909 commit 075024d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 5 additions & 2 deletions alipay/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,13 @@ func (a *Client) doAliPay(ctx context.Context, bm gopay.BodyMap, method string,
bodyBs []byte
)
if bm != nil {
aat := bm.GetString("app_auth_token")
bm.Remove("app_auth_token")
if bodyBs, err = json.Marshal(bm); err != nil {
return nil, fmt.Errorf("json.Marshal:%w", err)
}
bizContent = string(bodyBs)
bm.Set("app_auth_token", aat)
}
// 处理公共参数
param, err := a.pubParamsHandle(bm, method, bizContent, authToken...)
Expand Down Expand Up @@ -288,10 +290,11 @@ func (a *Client) pubParamsHandle(bm gopay.BodyMap, method, bizContent string, au
if notifyUrl := bm.GetString("notify_url"); notifyUrl != util.NULL {
pubBody.Set("notify_url", notifyUrl)
}
// app_auth_token
// default use app_auth_token
if a.AppAuthToken != util.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 != util.NULL {
pubBody.Set("app_auth_token", aat)
}
Expand All @@ -301,7 +304,7 @@ func (a *Client) pubParamsHandle(bm gopay.BodyMap, method, bizContent string, au
if bizContent != util.NULL {
pubBody.Set("biz_content", bizContent)
}
// 计算sign
// sign
sign, err := GetRsaSign(pubBody, pubBody.GetString("sign_type"), a.privateKey)
if err != nil {
return "", fmt.Errorf("GetRsaSign Error: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const (
OK = "OK"
DebugOff = 0
DebugOn = 1
Version = "1.5.85"
Version = "1.5.86"
)

type DebugSwitch int8
6 changes: 6 additions & 0 deletions release_note.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
版本号:Release 1.5.86
修改记录:
(1) 微信V3:新增优化异步验签方法,client.WxPublicKeyMap(),v3NotifyReq.VerifySignByPKMap()。
(2) 支付宝:修复 app_auth_token 的问题。
(3) apple:新增接口,Get Transaction History,GetAllSubscriptionStatuses,未真实场景测试。

版本号:Release 1.5.85
修改记录:
(1) 微信V3:修复自动验签的bug
Expand Down

0 comments on commit 075024d

Please sign in to comment.