package jx import "fmt" const ( appKey = "4A86853D-E4B6-454E-940A-B68ECDA2B73E" MsgTypeOrder = "order" SubMsgTypeOrderNew = "newOrder" SubMsgTypeOrderAdjust = "adjustOrder" SubMsgTypeOrderApplyCancel = "applyCancel" // SubMsgTypeOrderApplayRefund = "applyRefund" ) type CallbackResponse struct { Code int `json:"code"` Data string `json:"data"` } type CallbackMsg struct { AppKey string `json:"appKey"` MsgType string `json:"msgType"` SubMsgType string `json:"subMsgType"` ThingID string `json:"thingID"` Data string `json:"data"` } func OnCallbackMsg(msg *CallbackMsg) (retVal, errCode string, err error) { if msg.AppKey != appKey { return retVal, errCode, fmt.Errorf("无效的AppKey:%s", msg.AppKey) } if msg.MsgType == MsgTypeOrder { retVal, errCode, err = CurPurchaseHandler.OnOrderMsg(msg) } return retVal, errCode, err }