From dceafe02da72628a962acf113f656499f6aca112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 22 Jul 2022 19:29:26 +0800 Subject: [PATCH] 1 --- business/q_bida/q_bida_server.go | 5 ++++- controllers/tonglian_callback.go | 11 ++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/business/q_bida/q_bida_server.go b/business/q_bida/q_bida_server.go index ce6d926b6..aef54f989 100644 --- a/business/q_bida/q_bida_server.go +++ b/business/q_bida/q_bida_server.go @@ -383,7 +383,10 @@ func CreateOrder2QBiDa(order *model.UserVendorOrder) error { makeOrder.ReceiveName = receiveAddress.ConsigneeName makeOrder.ReceivePhone = receiveAddress.ConsigneeMobile otherId, err := createOtherOrder(makeOrder) - + if err != nil { + globals.SugarLogger.Debug("err==========", err) + } + order.Remark = fmt.Sprintf("%s", err.Error()) order.OtherWayBill = otherId order.OrderStatus = model.OrderStatusWaitPickup order.UpdatedAt = time.Now() diff --git a/controllers/tonglian_callback.go b/controllers/tonglian_callback.go index e9bfa2434..6572311de 100644 --- a/controllers/tonglian_callback.go +++ b/controllers/tonglian_callback.go @@ -24,10 +24,15 @@ func (c *TongLianController) Msg() { if c.Ctx.Input.Method() == http.MethodPost { call, err := api.TLpayAPI.GetCallbackMsg(getUsefulRequest2(c.Ctx)) globals.SugarLogger.Debugf("tonglianapi callback callbackResponse:%s", utils.Format4Output(call, true)) - if err == nil { - err = financial.OnTLPayCallback(call) + if err != nil { + c.Abort("404") + return } - c.Data["json"] = call + if err = financial.OnTLPayCallback(call); err != nil { + c.Abort("404") + return + } + c.Data["json"] = "success" c.ServeJSON() } else { c.Abort("404")