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)
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) {
c.JSON(501, failrspobj)
return

View File

@ -38,14 +38,13 @@ func (wp *wxpay) initMch() {
wp.ctx = context.Background()
// 使用商户私钥等初始化 client并使它具有自动定时获取微信支付平台证书的能力
opts := []core.ClientOption{
// option.WithWechatPayAutoAuthCipher(mchID, mchCertificateSerialNumber, mchPrivateKey, mchAPIv3Key),
option.WithWechatPayPublicKeyAuthCipher(mchID, mchCertificateSerialNumber, mchPrivateKey, mchPubKeyId, mchPublicKey),
}
wp.client, err = core.NewClient(wp.ctx, opts...)
if err != nil {
f5.GetSysLog().Alert("new wechat pay client err:%s", err)
}
go wp.checkGameMediaId()
wp.payhtmlstr, err = f5.ReadJsonFile("../config/payhtml.template")