Skip to content

Commit

Permalink
v1.5.98
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoogle-ink committed Nov 16, 2023
1 parent 54e9be4 commit 59d755f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 35 deletions.
30 changes: 0 additions & 30 deletions alipay/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,36 +205,6 @@ func (a *Client) getRsaSign(bm gopay.BodyMap, signType string) (sign string, err
return
}

func (a *Client) getStrRsaSign(signParams string, signType string) (sign string, err error) {
var (
h hash.Hash
hashs crypto.Hash
encryptedBytes []byte
)
switch signType {
case RSA:
h = sha1.New()
hashs = crypto.SHA1
case RSA2:
h = sha256.New()
hashs = crypto.SHA256
default:
h = sha256.New()
hashs = crypto.SHA256
}
if a.DebugSwitch == gopay.DebugOn {
xlog.Debugf("Alipay_Request_SignStr: %s", signParams)
}
if _, err = h.Write([]byte(signParams)); err != nil {
return
}
if encryptedBytes, err = rsa.SignPKCS1v15(rand.Reader, a.privateKey, hashs, h.Sum(nil)); err != nil {
return util.NULL, fmt.Errorf("[%w]: %+v", gopay.SignatureErr, err)
}
sign = base64.StdEncoding.EncodeToString(encryptedBytes)
return
}

// =============================== 获取SignData ===============================

// 需注意的是,公钥签名模式和公钥证书签名模式的不同之处
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.97"
Version = "1.5.98"
)

type DebugSwitch int8
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/go-pay/gopay

go 1.18

require golang.org/x/crypto v0.14.0
require golang.org/x/crypto v0.15.0
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
2 changes: 1 addition & 1 deletion release_note.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
修改记录:
(1) 支付宝:PR新增 client.PostFileAliPayAPISelfV2(),文件上传自定义方法(未做验证,不知道是否好用)。
(2) Apple:更新部分结构体字段。
(3)
(3) PayPal:增加Token的自动刷新功能。

版本号:Release 1.5.97
修改记录:
Expand Down

0 comments on commit 59d755f

Please sign in to comment.