From 888fb1816569668a6fa3e2a5f05e60ddfd0e50c5 Mon Sep 17 00:00:00 2001 From: wolter Date: Tue, 24 Dec 2024 15:58:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E4=BB=98=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E4=B8=8B=E6=B8=B8=E7=8A=B6=E6=80=81fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/http/controllers/front/payment_controller.go | 11 +++++------ app/third/paymentService/ali_service.go | 2 +- app/third/paymentService/wechat_service.go | 2 +- app/utils/util.go | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/http/controllers/front/payment_controller.go b/app/http/controllers/front/payment_controller.go index 25a4a93..c72f506 100644 --- a/app/http/controllers/front/payment_controller.go +++ b/app/http/controllers/front/payment_controller.go @@ -1,7 +1,6 @@ package front import ( - "PaymentCenter/app/constants/common" "PaymentCenter/app/constants/errorcode" "PaymentCenter/app/http/controllers" "PaymentCenter/app/http/entities/front" @@ -43,11 +42,11 @@ func WxCallback(c *gin.Context) { c.String(http.StatusBadRequest, "%s", "fail") return } - 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 - } + //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 + //} var wxConfig paymentService.WxPay err := json.Unmarshal([]byte(payChannelModel.ExtJson), &wxConfig) diff --git a/app/third/paymentService/ali_service.go b/app/third/paymentService/ali_service.go index 47075b0..1833174 100644 --- a/app/third/paymentService/ali_service.go +++ b/app/third/paymentService/ali_service.go @@ -179,7 +179,7 @@ func ALiCallBack(notifyReq gopay.BodyMap, aliConfig AliPay) error { return errors.New("订单状态异常,无法进行后续回调") } - res := thirdpay_notify.NewOrderNotifyWithHandle(int64(orderId), orderStatus, errCode, payerTotal, msg) + res := thirdpay_notify.NewOrderNotifyWithHandle(int64(orderId), errCode, orderStatus, payerTotal, msg) merchantCallback, _ := json.Marshal(res) // 记录日志 go func() { diff --git a/app/third/paymentService/wechat_service.go b/app/third/paymentService/wechat_service.go index dce18e7..fbc2d3e 100644 --- a/app/third/paymentService/wechat_service.go +++ b/app/third/paymentService/wechat_service.go @@ -201,7 +201,7 @@ func WxPayCallBack(notifyReq *wechat.V3NotifyReq, wxConfig WxPay) error { // 触发下游回调的格式 orderId, _ := strconv.Atoi(CallBackInfo.OutTradeNo) - res := thirdpay_notify.NewOrderNotifyWithHandle(int64(orderId), orderStatus, errCode, int(CallBackInfo.Amount.PayerTotal), msg) + res := thirdpay_notify.NewOrderNotifyWithHandle(int64(orderId), errCode, orderStatus, int(CallBackInfo.Amount.PayerTotal), msg) merchantCallback, _ := json.Marshal(res) // 记录日志 go func() { diff --git a/app/utils/util.go b/app/utils/util.go index 34b8995..abe75e3 100644 --- a/app/utils/util.go +++ b/app/utils/util.go @@ -455,7 +455,7 @@ func PayType(payChannel int) int { switch payChannel { case common.PAY_CHANNEL_WECHAT_H5, common.PAY_CHANNEL_WECHAT_JSAPI, common.PAY_CHANNEL_WECHAT_NATIVE, common.PAY_CHANNEL_WECHAT_APP, common.PAY_CHANNEL_WECHAT_MINI: return common.PAY_CHANNLE_TYPE_WECHAT - case common.PAY_CHANNEL_ALIPAY_JSAPI, common.PAY_CHANNEL_ALIPAY_WEB, common.PAY_CHANNEL_ALIPAY_MINI: + case common.PAY_CHANNEL_ALIPAY_JSAPI, common.PAY_CHANNEL_ALIPAY_WEB, common.PAY_CHANNEL_ALIPAY_MINI, common.PAY_CHANNEL_ALIPAY_PC: return common.PAY_CHANNLE_TYPE_ZFB default: return 0