1
This commit is contained in:
@@ -144,13 +144,24 @@ func (c *MtwmController) DeliveryFeeChange() {
|
||||
func (c *MtwmController) Invoice() {
|
||||
body, err := ioutil.ReadAll(c.Ctx.Request.Body)
|
||||
if err != nil {
|
||||
c.Data["json"] = mtwmapi.Err2CallbackResponse(err, "")
|
||||
c.Data["json"] = map[string]interface{}{"result_code": -1}
|
||||
c.ServeJSON()
|
||||
return
|
||||
}
|
||||
globals.SugarLogger.Debugf("------body:= %s", string(body))
|
||||
callbackResponse := mtwmapi.Err2CallbackResponse(nil, "")
|
||||
c.Data["json"] = callbackResponse
|
||||
|
||||
data := &mtwmapi.InvoiceCallback{}
|
||||
if err = json.Unmarshal(body, data); err != nil {
|
||||
c.Data["json"] = map[string]interface{}{"result_code": -1}
|
||||
c.ServeJSON()
|
||||
return
|
||||
}
|
||||
|
||||
// 消息通知
|
||||
if err = mtwm.InvoiceCallback(data); err != nil {
|
||||
globals.SugarLogger.Errorf("mtwm Invoice err := %v", err)
|
||||
}
|
||||
c.Data["json"] = map[string]interface{}{"result_code": 1}
|
||||
c.ServeJSON()
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user