diff --git a/platformapi/fnpsapi/callback.go b/platformapi/fnpsapi/callback.go index 638ef67e..fe0019ef 100644 --- a/platformapi/fnpsapi/callback.go +++ b/platformapi/fnpsapi/callback.go @@ -145,7 +145,7 @@ func (a *API) GetChainOrderStatusNotify(request *http.Request) (shopStatusMsg *O } fmt.Println("string==================", string(data)) - storeNotify := &ShortStatus{} + storeNotify := make(map[string]interface{}, 4) err = utils.Map2StructByJson(data, storeNotify, true) if err != nil { baseapi.SugarLogger.Debugf("FN GetShopStatusCallbackMsg failed with err:%v", err) @@ -155,7 +155,7 @@ func (a *API) GetChainOrderStatusNotify(request *http.Request) (shopStatusMsg *O fmt.Println("======================", storeNotify) fnNotify := &OrderStatusNottify{} - if err := json.Unmarshal([]byte(utils.Interface2String(storeNotify.BusinessData)), fnNotify); err != nil { + if err := json.Unmarshal([]byte(utils.Interface2String(storeNotify["business_data"])), fnNotify); err != nil { baseapi.SugarLogger.Debugf("FN callback string to ChainstoreStatusNotify failed with err:%v", err) callbackResponse = &CallbackResponse{Code: -1} return nil, callbackResponse diff --git a/platformapi/fnpsapi/order.go b/platformapi/fnpsapi/order.go index e7234378..14efd13f 100644 --- a/platformapi/fnpsapi/order.go +++ b/platformapi/fnpsapi/order.go @@ -146,13 +146,7 @@ func (a *API) PreCancelOrder(req *PreCancelOrderReq) (actualCancelCostCent int64 } if k, ok := data["businessData"]; ok { - respParam := struct { - ActualCancelCostCent int64 `json:"actual_cancel_cost_cent"` - }{} - if err := json.Unmarshal([]byte(utils.Interface2String(k)), respParam); err != nil { - return 0, err - } - return respParam.ActualCancelCostCent, nil + return utils.MustInterface2Int64(k), nil } return }