From b65467d2367877ca8b40c1b555c4b73f1786488e Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 17 Aug 2022 10:15:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=81=E4=B9=A6=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/alipayapi/pay_for_user.go | 16 ++++++++-------- platformapi/alipayapi/utils.go | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/platformapi/alipayapi/pay_for_user.go b/platformapi/alipayapi/pay_for_user.go index ed70a2a9..442dc687 100644 --- a/platformapi/alipayapi/pay_for_user.go +++ b/platformapi/alipayapi/pay_for_user.go @@ -14,8 +14,8 @@ import ( const ( AliPayPublicCertPath = "./config/alipayCertPublicKey_RSA2.crt" // 支付宝公钥证书文件路径 - aliPayRootCertPath = "./config/alipayRootCert.crt" // 支付宝根证书文件路径 - appCertPath = "./config/appCertPublicKey_2019110769024042.crt" // 应用公钥证书路径 + AliPayRootCertPath = "./config/alipayRootCert.crt" // 支付宝根证书文件路径 + AppCertPath = "./config/appCertPublicKey_2019110769024042.crt" // 应用公钥证书路径 MinWithdrawalMoney = 50 // 最小提现金额,不用审核 ) @@ -71,7 +71,7 @@ func (a *API) Withdrawal4AliPay(param *WithdrawalParam) (*Withdrawal4AliPayRes, param.PayeeInfo.IdentityType = "ALIPAY_LOGON_ID" // 获取证书 - appCertSN, aliPayRootCertSN, aliPayPublicCertSN, err := SetCertSnByPath(appCertPath, aliPayRootCertPath, AliPayPublicCertPath) + appCertSN, aliPayRootCertSN, aliPayPublicCertSN, err := SetCertSnByPath(AppCertPath, AliPayRootCertPath, AliPayPublicCertPath) if err != nil { return nil, err } @@ -94,15 +94,15 @@ func (a *API) Withdrawal4AliPay(param *WithdrawalParam) (*Withdrawal4AliPayRes, } // SetCertSnByPath 通过应用公钥证书路径设置 app_cert_sn、alipay_root_cert_sn、alipay_cert_sn -// appCertPath:应用公钥证书路径 -// aliPayRootCertPath:支付宝根证书文件路径 +// AppCertPath:应用公钥证书路径 +// AliPayRootCertPath:支付宝根证书文件路径 // aliPayPublicCertPath:支付宝公钥证书文件路径 -func SetCertSnByPath(appCertPath, aliPayRootCertPath, aliPayPublicCertPath string) (string, string, string, error) { - appCertSn, err := GetCertSN(appCertPath) +func SetCertSnByPath(AppCertPath, AliPayRootCertPath, aliPayPublicCertPath string) (string, string, string, error) { + appCertSn, err := GetCertSN(AppCertPath) if err != nil { return "", "", "", fmt.Errorf("get app_cert_sn return err, but alse return alipay client. err: %w", err) } - rootCertSn, err := GetRootCertSN(aliPayRootCertPath) + rootCertSn, err := GetRootCertSN(AliPayRootCertPath) if err != nil { return "", "", "", fmt.Errorf("get alipay_root_cert_sn return err, but alse return alipay client. err: %w", err) } diff --git a/platformapi/alipayapi/utils.go b/platformapi/alipayapi/utils.go index 53d07f46..fc86368e 100644 --- a/platformapi/alipayapi/utils.go +++ b/platformapi/alipayapi/utils.go @@ -44,7 +44,7 @@ func (a *API) SystemAuthToken(grantType, code, refreshToken string) (tokenInfo * params["refresh_token"] = refreshToken } // 获取证书 - appCertSN, aliPayRootCertSN, aliPayPublicCertSN, err := SetCertSnByPath(appCertPath, aliPayRootCertPath, AliPayPublicCertPath) + appCertSN, aliPayRootCertSN, aliPayPublicCertSN, err := SetCertSnByPath(AppCertPath, AliPayRootCertPath, AliPayPublicCertPath) if err != nil { return nil, err }