订单信息修改
This commit is contained in:
@@ -40,7 +40,7 @@ func TestAddOrderAfterQuery(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCancel(t *testing.T) {
|
||||
cancelResponse, err := dadaapi.CancelOrder("129178201000000002", ReasonIDOther, "协商一致")
|
||||
cancelResponse, err := dadaapi.CancelOrder("129188742504000002", ReasonIDOther, "协商一致")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package jdshopapi
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
||||
@@ -66,14 +67,8 @@ func (a *API) GetCallbackMsg(request *http.Request) (call *CallBackResult, err e
|
||||
return nil, err
|
||||
}
|
||||
mapData := utils.URLValues2Map(values)
|
||||
consigneeInfo := &CallBackConsigneeInfo{}
|
||||
var itemInfoList []*CallBackItemInfoList
|
||||
utils.Map2StructByJson(mapData["consigneeInfo"], &consigneeInfo, false)
|
||||
utils.Map2StructByJson(mapData["itemInfoList"], &itemInfoList, false)
|
||||
delete(mapData, "consigneeInfo")
|
||||
delete(mapData, "itemInfoList")
|
||||
utils.Map2StructByJson(mapData, &call, false)
|
||||
call.ConsigneeInfo = consigneeInfo
|
||||
call.ItemInfoList = itemInfoList
|
||||
if err = json.Unmarshal([]byte(mapData["orderInfo"].(string)), &call); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return call, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user