From f40f4f1565f13fb2b536eca2a89f34dda83b01ed Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 7 Apr 2022 13:48:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9B=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wxpay.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wxpay.go b/wxpay.go index 5f50f72..013a59e 100644 --- a/wxpay.go +++ b/wxpay.go @@ -3,6 +3,7 @@ package pay import ( "context" "errors" + "fmt" "git.oa00.com/go/rsa" "github.com/wechatpay-apiv3/wechatpay-go/core" "github.com/wechatpay-apiv3/wechatpay-go/core/auth/verifiers" @@ -38,7 +39,7 @@ func InitWxpay(config WxpayConfig) error { } // 使用商户私钥等初始化 client,并使它具有自动定时获取微信支付平台证书的能力 opts := []core.ClientOption{ - option.WithWechatPayAutoAuthCipher(config.MchID, certificate.SerialNumber.String(), privateKey, config.MchAPIv3Key), + option.WithWechatPayAutoAuthCipher(config.MchID, fmt.Sprintf("%x", certificate.SerialNumber), privateKey, config.MchAPIv3Key), } Wxpay.Client, err = core.NewClient(context.Background(), opts...) if err != nil {