diff --git a/controllers/dada_order.go b/controllers/dada_order.go index 71bebc33d..8635d3fac 100644 --- a/controllers/dada_order.go +++ b/controllers/dada_order.go @@ -38,15 +38,16 @@ func (c *DadaDeliveryController) Notify() { obj, notifyResponse := api.DadaAPI.GetNotifyMsg(c.Ctx.Input.RequestBody) if notifyResponse == nil && obj.MessageObj != nil { err := api.DadaAPI.ConfirmRidderCancel(obj.MessageObj.OrderID, obj.MessageObj.DadaOrderID, true) + if err != nil { + notifyResponse = dadaapi.FailedNotifyResponse + } globals.SugarLogger.Debugf("dada notify, obj:%s, err:%v", utils.Format4Output(obj, false), err) } if notifyResponse == nil { notifyResponse = dadaapi.SuccessNotifyResponse - } else { - c.Data["json"] = notifyResponse - c.ServeJSON() } - globals.SugarLogger.Debugf("DadaDeliveryController.Notify:%s", utils.Format4Output(notifyResponse, false)) + c.Data["json"] = notifyResponse + c.ServeJSON() } else { c.Abort("404") }