1
This commit is contained in:
@@ -100,8 +100,7 @@ func (a *API) signParams(params map[string]interface{}) (sign string) {
|
|||||||
finalStr := strings.Join(strList, "&")
|
finalStr := strings.Join(strList, "&")
|
||||||
d := sha256.Sum256([]byte(finalStr))
|
d := sha256.Sum256([]byte(finalStr))
|
||||||
signature, _ := rsa.SignPKCS1v15(rand.Reader, a.privateKey, crypto.SHA256, d[:])
|
signature, _ := rsa.SignPKCS1v15(rand.Reader, a.privateKey, crypto.SHA256, d[:])
|
||||||
sign = base64.StdEncoding.EncodeToString(signature)
|
return base64.StdEncoding.EncodeToString(signature)
|
||||||
return sign
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func method2ResponseKey(method string) (responseKey string) {
|
func method2ResponseKey(method string) (responseKey string) {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package alipayapi
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -55,8 +54,6 @@ func (a *API) SystemAuthToken(grantType, code, refreshToken string) (tokenInfo *
|
|||||||
params["alipay_root_cert_sn"] = aliPayRootCertSN
|
params["alipay_root_cert_sn"] = aliPayRootCertSN
|
||||||
|
|
||||||
retVal, err := a.AccessAPI("alipay.system.oauth.token", params, nil, false)
|
retVal, err := a.AccessAPI("alipay.system.oauth.token", params, nil, false)
|
||||||
globals.SugarLogger.Debugf("======retVal := %v", retVal)
|
|
||||||
globals.SugarLogger.Debugf("======err := %v", err)
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err = utils.Map2StructByJson(retVal, &tokenInfo, false)
|
err = utils.Map2StructByJson(retVal, &tokenInfo, false)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user