From cd69af4ac4f6a1cf0474cc3f4e43287bc6314c96 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Tue, 16 Aug 2022 17:49:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E7=AD=BE=E5=90=8D?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/alipayapi/utils.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/platformapi/alipayapi/utils.go b/platformapi/alipayapi/utils.go index 50eb0c23..a81b2a77 100644 --- a/platformapi/alipayapi/utils.go +++ b/platformapi/alipayapi/utils.go @@ -41,6 +41,17 @@ func (a *API) SystemAuthToken(grantType, code, refreshToken string) (tokenInfo * if refreshToken != "" { params["refresh_token"] = refreshToken } + + // 获取证书 + appCertSN, aliPayRootCertSN, aliPayPublicCertSN, err := SetCertSnByPath(appCertPath, aliPayRootCertPath, AliPayPublicCertPath) + if err != nil { + return nil, err + } + + params["app_cert_sn"] = appCertSN + params["alipay_public_cert_sn"] = aliPayPublicCertSN + params["alipay_root_cert_sn"] = aliPayRootCertSN + retVal, err := a.AccessAPI("alipay.system.oauth.token", params, nil, false) if err == nil { err = utils.Map2StructByJson(retVal, &tokenInfo, false)