fix(thirdpay): 处理支付结果为FAIL的情况并新增未知状态日志
新增支付状态FAIL的分支处理,将对应订单置为失败状态,同时新增未知支付状态的日志记录和失败返回逻辑
This commit is contained in:
parent
7a118ee19e
commit
e4e43feaf2
|
|
@ -77,6 +77,13 @@ func OrderQueryAndNotify(ctx context.Context, orderInfo *ordersmodel.OrdersLeftP
|
||||||
// 关闭
|
// 关闭
|
||||||
status = common.ORDER_STATUS_CLOSE
|
status = common.ORDER_STATUS_CLOSE
|
||||||
msg = "订单关闭"
|
msg = "订单关闭"
|
||||||
|
case "FAIL":
|
||||||
|
// 失败
|
||||||
|
status = common.ORDER_STATUS_FAILED
|
||||||
|
default:
|
||||||
|
utils.Log(nil, "支付状态未知", fmt.Sprintf("id =%d, status=%s", orderInfo.Id, result.Result.TradeState))
|
||||||
|
msg = "支付失败"
|
||||||
|
return
|
||||||
}
|
}
|
||||||
// 回调通知下游
|
// 回调通知下游
|
||||||
notifyResult := thirdpay_notify.NewOrderNotifyWithHandle(orderInfo.Id, result.Code, status, int(result.Result.AmountTotal), int(result.Result.PayerTotal), msg, result.Result.TransactionId)
|
notifyResult := thirdpay_notify.NewOrderNotifyWithHandle(orderInfo.Id, result.Code, status, int(result.Result.AmountTotal), int(result.Result.PayerTotal), msg, result.Result.TransactionId)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue