From 24c0c6d36ad9ff0a6238bb31e34e49e7272d6efc Mon Sep 17 00:00:00 2001 From: wolter Date: Fri, 6 Dec 2024 21:57:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BE=AE=E4=BF=A1=E5=9B=9E=E8=B0=83fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/http/controllers/front/payment_controller.go | 2 +- app/services/thirdpay/wx.go | 1 - front/templates/index.html | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/http/controllers/front/payment_controller.go b/app/http/controllers/front/payment_controller.go index 04ca0ea..5ba2e89 100644 --- a/app/http/controllers/front/payment_controller.go +++ b/app/http/controllers/front/payment_controller.go @@ -42,7 +42,7 @@ func WxCallback(c *gin.Context) { c.String(http.StatusBadRequest, "%s", "fail") return } - if payChannelModel.ChannelType != common.PAY_CHANNEL_WECHAT_H5 { + if !(payChannelModel.ChannelType == common.PAY_CHANNEL_WECHAT_H5 || payChannelModel.ChannelType == common.PAY_CHANNEL_WECHAT_JSAPI) { logger.Error(c, "WxCallback-回调数据解析支付配置错误,查询的数据不是当前渠道") c.String(http.StatusBadRequest, "%s", "fail") return diff --git a/app/services/thirdpay/wx.go b/app/services/thirdpay/wx.go index 2db9e91..181a202 100644 --- a/app/services/thirdpay/wx.go +++ b/app/services/thirdpay/wx.go @@ -300,7 +300,6 @@ func WxJsApiPay(param front.WxJsApiPayRequest) (response front.WxJsApiPayRespons } // 4 签名 - // 4.1 签名数据 signValue, err := task.Sign(response.AppId, response.TimeStamp, response.NonceStr, response.Package) if err != nil { utils.Log(nil, "签名失败", err) diff --git a/front/templates/index.html b/front/templates/index.html index 2b5b0e7..3a936d1 100644 --- a/front/templates/index.html +++ b/front/templates/index.html @@ -3,7 +3,7 @@ - 微信授权登录 + 微信支付