From 0be3db7a898b9e9a1f5062e4b93b6f9717d307fc Mon Sep 17 00:00:00 2001 From: wolter Date: Mon, 26 Aug 2024 14:59:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=89=8D=E5=8F=B0=EF=BC=8C=E9=A2=84?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=A0=A1=E9=AA=8C=E6=94=AF=E4=BB=98=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/constants/errorcode/error_code.go | 19 +++++++++++-------- app/services/thirdpay/do/pay_check.go | 4 ++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/constants/errorcode/error_code.go b/app/constants/errorcode/error_code.go index 415a04e..ab6a619 100644 --- a/app/constants/errorcode/error_code.go +++ b/app/constants/errorcode/error_code.go @@ -73,6 +73,7 @@ const ( OrderAppidNotEqRefundAppid = 1412 OrderNotSupportRefundPart = 1413 OrderRefundAmountError = 1414 + OrderPayChannelChange = 1415 // 关闭订单 CloseOrderPayed = 1420 @@ -149,14 +150,16 @@ var MsgZH = map[int]string{ RequestLogNotFound: "未找到日志信息", RequestResponseValid: "上游返回格式无效", - OrdersNotFound: "未找到订单", - OrdersExist: "订单已存在", - OrderTypeNotFount: "未知的支付方式", - OrderIsDelete: "订单已删除", - OrderStatusErr: "订单状态错误", - OrderClosed: "订单已关闭,无法继续支付", - OrderFailed: "订单支付失败,请重新发起", - OrderPayed: "订单已支付成功,请勿重复支付", + OrdersNotFound: "未找到订单", + OrdersExist: "订单已存在", + OrderTypeNotFount: "未知的支付方式", + OrderIsDelete: "订单已删除", + OrderStatusErr: "订单状态错误", + OrderClosed: "订单已关闭,无法继续支付", + OrderFailed: "订单支付失败,请重新发起", + OrderPayed: "订单已支付成功,请勿重复支付", + OrderPayChannelChange: "支付方式不一致,切换支付方式请关闭原订单生成新订单", + NotifySendFail: "回调发送失败", RefundOrderNotFound: "退款订单未找到", OrderStatusRefundNotSupport: "订单状态不支持退款", diff --git a/app/services/thirdpay/do/pay_check.go b/app/services/thirdpay/do/pay_check.go index 22ab448..6cc51f5 100644 --- a/app/services/thirdpay/do/pay_check.go +++ b/app/services/thirdpay/do/pay_check.go @@ -74,6 +74,10 @@ func (w *PayCheck) CheckOrderPay() { w.CheckCode = errorcode.OrderPayed default: } + // 切换了支付方式 + if w.Reqs.PayChannelId != w.OldOrder.PayChannelId { + w.CheckCode = errorcode.OrderPayChannelChange + } } return