This commit is contained in:
yangduo 2025-02-20 18:06:33 +08:00
parent c9e8367bb4
commit de8a2829d2
2 changed files with 2 additions and 3 deletions

View File

@ -494,7 +494,7 @@ func (this *MainServiceApi) WxPayNotify(c *gin.Context) {
} }
f5.GetSysLog().Debug("wx pay post data:%s", rawdata) f5.GetSysLog().Debug("wx pay post data:%s", rawdata)
rawstr := fmt.Sprintf("%s\n%s\n%s", paytimestamp, paynonce, rawdata) rawstr := fmt.Sprintf("%s\n%s\n%s\n", paytimestamp, paynonce, rawdata)
if !service.Wxpay.VerifyPaySign(rawstr, paysign) { if !service.Wxpay.VerifyPaySign(rawstr, paysign) {
c.JSON(501, failrspobj) c.JSON(501, failrspobj)
return return

View File

@ -38,7 +38,6 @@ func (wp *wxpay) initMch() {
wp.ctx = context.Background() wp.ctx = context.Background()
// 使用商户私钥等初始化 client并使它具有自动定时获取微信支付平台证书的能力 // 使用商户私钥等初始化 client并使它具有自动定时获取微信支付平台证书的能力
opts := []core.ClientOption{ opts := []core.ClientOption{
// option.WithWechatPayAutoAuthCipher(mchID, mchCertificateSerialNumber, mchPrivateKey, mchAPIv3Key),
option.WithWechatPayPublicKeyAuthCipher(mchID, mchCertificateSerialNumber, mchPrivateKey, mchPubKeyId, mchPublicKey), option.WithWechatPayPublicKeyAuthCipher(mchID, mchCertificateSerialNumber, mchPrivateKey, mchPubKeyId, mchPublicKey),
} }
wp.client, err = core.NewClient(wp.ctx, opts...) wp.client, err = core.NewClient(wp.ctx, opts...)