diff --git a/platformapi/jcqapi/jcqapi.go b/platformapi/jcqapi/jcqapi.go index 1bc8ef1c..69573733 100644 --- a/platformapi/jcqapi/jcqapi.go +++ b/platformapi/jcqapi/jcqapi.go @@ -78,7 +78,6 @@ func (a *API) signParam(params map[string]interface{}) (sig string) { } sort.Sort(sort.StringSlice(valueList)) sig = strings.Join(valueList, "&") - fmt.Println("sig", sig) key := []byte(a.secretKey) mac := hmac.New(sha1.New, key) mac.Write([]byte(sig)) diff --git a/platformapi/jdshopapi/order.go b/platformapi/jdshopapi/order.go index 912bb12c..0216fc39 100644 --- a/platformapi/jdshopapi/order.go +++ b/platformapi/jdshopapi/order.go @@ -15,6 +15,7 @@ const ( OrderStatusPopPause = "POP_ORDER_PAUSE" OrderStatusPause = "PAUSE" OrderStatusWait = "WAIT_SELLER_STOCK_OUT" + OrderStatusCancel = "TRADE_CANCELED" ) //订单出库 @@ -97,15 +98,17 @@ type GetOrderResult struct { //查询单个订单 //https://open.jd.com/home/home#/doc/api?apiCateId=55&apiId=4247&apiName=jingdong.pop.order.get -func (a *API) GetOrder(orderID int64) (getOrderResult *GetOrderResult, err error) { - result, err := a.AccessAPI("jingdong.pop.order.get", prodURL, map[string]interface{}{ - "order_id": orderID, - "optional_fields": `orderType,payType,orderTotalPrice,orderSellerPrice, - orderPayment,freightPrice,orderState,orderStateRemark, - orderStartTime,orderEndTime,orderRemark,consigneeInfo, - itemInfoList,pauseBizInfo,pin`, - "order_state": "WAIT_SELLER_STOCK_OUT,PAUSE", - }) +func (a *API) GetOrder(orderID int64, isStatus bool) (getOrderResult *GetOrderResult, err error) { + params := make(map[string]interface{}) + params["order_id"] = orderID + params["optional_fields"] = `orderType,payType,orderTotalPrice,orderSellerPrice, + orderPayment,freightPrice,orderState,orderStateRemark, + orderStartTime,orderEndTime,orderRemark,consigneeInfo, + itemInfoList,pauseBizInfo,pin` + if isStatus { + params["order_state"] = "WAIT_SELLER_STOCK_OUT,PAUSE" + } + result, err := a.AccessAPI("jingdong.pop.order.get", prodURL, params) if err == nil { utils.Map2StructByJson(result["jingdong_pop_order_get_responce"].(map[string]interface{})["orderDetailInfo"].(map[string]interface{})["orderInfo"], &getOrderResult, false) }