43 lines
1.0 KiB
Go
43 lines
1.0 KiB
Go
package jd
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
|
"git.rosy.net.cn/baseapi/utils"
|
|
)
|
|
|
|
func OnOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
|
if curPurchaseHandler != nil {
|
|
if retVal = curPurchaseHandler.OnOrderMsg(msg); retVal == nil {
|
|
retVal = jdapi.Err2CallbackResponse(errors.New("Internal Error"), "")
|
|
}
|
|
}
|
|
return retVal
|
|
}
|
|
|
|
func OnWaybillMsg(msg *jdapi.CallbackDeliveryStatusMsg) (retVal *jdapi.CallbackResponse) {
|
|
if curPurchaseHandler != nil {
|
|
if retVal = curPurchaseHandler.OnWaybillMsg(msg); retVal == nil {
|
|
retVal = jdapi.Err2CallbackResponse(errors.New("Internal Error"), "")
|
|
}
|
|
}
|
|
return retVal
|
|
}
|
|
|
|
func OnStoreMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
|
if curPurchaseHandler != nil {
|
|
retVal = curPurchaseHandler.onStoreMsg(msg)
|
|
}
|
|
return retVal
|
|
}
|
|
|
|
func OnFinancialMsg2(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
|
if curPurchaseHandler != nil {
|
|
utils.CallFuncAsync(func() {
|
|
OnFinancialMsg(msg)
|
|
})
|
|
}
|
|
return retVal
|
|
}
|