- 只有存在相应的API才注册purchase partner
This commit is contained in:
@@ -8,22 +8,24 @@ import (
|
||||
)
|
||||
|
||||
func OnOrderCallbackMsg(msg *mtwmapi.CallbackMsg) (response *mtwmapi.CallbackResponse) {
|
||||
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)
|
||||
})
|
||||
} else if msg.Cmd == mtwmapi.MsgTypeStoreStatusChanged {
|
||||
response = curPurchaseHandler.onStoreStatusChanged(msg)
|
||||
if curPurchaseHandler != nil {
|
||||
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)
|
||||
})
|
||||
} else if msg.Cmd == mtwmapi.MsgTypeStoreStatusChanged {
|
||||
response = curPurchaseHandler.onStoreStatusChanged(msg)
|
||||
}
|
||||
}
|
||||
return response
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user