回滚
This commit is contained in:
@@ -7,36 +7,35 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func OnCallbackMsg(msg *mtwmapi.CallbackMsg) (response *mtwmapi.CallbackResponse) {
|
func OnCallbackMsg(msg *mtwmapi.CallbackMsg) (response *mtwmapi.CallbackResponse) {
|
||||||
if CurPurchaseHandler == nil {
|
if CurPurchaseHandler != nil {
|
||||||
return &mtwmapi.CallbackResponse{Data: "CurPurchaseHandler init fail"}
|
if msg.Cmd == mtwmapi.MsgTypeStoreStatusChanged || msg.Cmd == mtwmapi.MsgTypeStoreAuditStatusChanged {
|
||||||
|
response = CurPurchaseHandler.onStoreStatusChanged(msg)
|
||||||
|
} else if msg.Cmd == mtwmapi.MsgTypePrivateNumberDowngrade {
|
||||||
|
response = CurPurchaseHandler.onNumberDowngrade(msg)
|
||||||
|
} else if msg.Cmd == mtwmapi.MsgTypeStoreBind {
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if orderID := GetOrderIDFromMsg(msg); orderID != "" {
|
||||||
|
jxutils.CallMsgHandler(func() {
|
||||||
|
switch msg.Cmd {
|
||||||
|
case mtwmapi.MsgTypeWaybillStatus:
|
||||||
|
response = CurPurchaseHandler.onWaybillMsg(msg)
|
||||||
|
default:
|
||||||
|
response = CurPurchaseHandler.onOrderMsg(msg)
|
||||||
|
}
|
||||||
|
}, jxutils.ComposeUniversalOrderID(orderID, model.VendorIDMTWM))
|
||||||
|
}
|
||||||
|
/*if msg.Cmd == mtwmapi.MsgTypeOrderRefund || msg.Cmd == mtwmapi.MsgTypeOrderPartialRefund {
|
||||||
|
utils.CallFuncAsync(func() {
|
||||||
|
OnFinancialMsg(msg)
|
||||||
|
})
|
||||||
|
} */
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取orderId
|
|
||||||
orderID := GetOrderIDFromMsg(msg)
|
|
||||||
switch {
|
|
||||||
case msg.Cmd == mtwmapi.MsgTypeStoreStatusChanged || msg.Cmd == mtwmapi.MsgTypeStoreAuditStatusChanged:
|
|
||||||
response = CurPurchaseHandler.onStoreStatusChanged(msg)
|
|
||||||
case msg.Cmd == mtwmapi.MsgTypePrivateNumberDowngrade:
|
|
||||||
response = CurPurchaseHandler.onNumberDowngrade(msg)
|
|
||||||
case msg.Cmd == mtwmapi.MsgTypeStoreBind:
|
|
||||||
break
|
|
||||||
case orderID != "" && msg.Cmd == mtwmapi.MsgTypeWaybillStatus:
|
|
||||||
jxutils.CallMsgHandler(func() {
|
|
||||||
if msg.Cmd == mtwmapi.MsgTypeWaybillStatus {
|
|
||||||
response = CurPurchaseHandler.onWaybillMsg(msg)
|
|
||||||
} else {
|
|
||||||
response = CurPurchaseHandler.onOrderMsg(msg)
|
|
||||||
}
|
|
||||||
}, jxutils.ComposeUniversalOrderID(orderID, model.VendorIDMTWM))
|
|
||||||
}
|
|
||||||
|
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetOrderIDFromMsg(msg *mtwmapi.CallbackMsg) string {
|
func GetOrderIDFromMsg(msg *mtwmapi.CallbackMsg) string {
|
||||||
return msg.FormData.Get(mtwmapi.KeyOrderID)
|
return msg.FormData.Get(mtwmapi.KeyOrderID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetVendorStoreIDFromMsg(msg *mtwmapi.CallbackMsg) string {
|
func GetVendorStoreIDFromMsg(msg *mtwmapi.CallbackMsg) string {
|
||||||
return msg.FormData.Get(mtwmapi.KeyAppPoiCode)
|
return msg.FormData.Get(mtwmapi.KeyAppPoiCode)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user