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 {