美团,饿百回调添加系统级参数

This commit is contained in:
gazebo
2019-12-09 14:43:09 +08:00
parent 460af4f42c
commit 490e7b96ca
2 changed files with 27 additions and 6 deletions

View File

@@ -60,7 +60,12 @@ type CallbackRefundInfo struct {
}
type CallbackMsg struct {
Cmd string
Cmd string
Timestamp int64 `json:"timestamp"`
AppID string `json:"app_id"`
Sig string `json:"sig"`
FormData url.Values
Data interface{}
}
@@ -110,6 +115,10 @@ func (a *API) GetCallbackMsg(request *http.Request) (msg *CallbackMsg, callbackR
}
msg.FormData.Set(k, v.(string))
}
msg.Timestamp = utils.Str2Int64(msg.FormData.Get("timestamp"))
msg.Sig = dataSign.(string)
msg.AppID = msg.FormData.Get("app_id")
if msg.Cmd == MsgTypeOrderRefund || msg.Cmd == MsgTypeOrderPartialRefund {
var refundData *CallbackRefundInfo
if err = utils.Map2StructByJson(data, &refundData, true); err == nil {