diff --git a/platformapi/jdshopapi/callback.go b/platformapi/jdshopapi/callback.go index 9a8a85a7..40279a09 100644 --- a/platformapi/jdshopapi/callback.go +++ b/platformapi/jdshopapi/callback.go @@ -25,6 +25,7 @@ type CallBackResult struct { OrderSource string `json:"orderSource"` FreightPrice string `json:"freightPrice"` MsgType string `json:"msgType"` + Pin string `json:"pin"` ConsigneeInfo *CallBackConsigneeInfo `json:"consigneeInfo"` ItemInfoList []*CallBackItemInfoList `json:"itemInfoList"` } diff --git a/platformapi/jdshopapi/order.go b/platformapi/jdshopapi/order.go index 40519aee..c6751ad7 100644 --- a/platformapi/jdshopapi/order.go +++ b/platformapi/jdshopapi/order.go @@ -11,6 +11,12 @@ import ( "git.rosy.net.cn/baseapi/utils" ) +const ( + OrderStatusPopPause = "POP_ORDER_PAUSE" + OrderStatusPause = "PAUSE" + OrderStatusWait = "WAIT_SELLER_STOCK_OUT" +) + //订单出库 //https://open.jd.com/home/home#/doc/api?apiCateId=55&apiId=1948&apiName=jingdong.pop.order.shipment func (a *API) OrderShipment(orderID int64, logiCoprId, logiNo string) (err error) { @@ -86,6 +92,7 @@ type GetOrderResult struct { OrderID string `json:"orderId"` OrderSource string `json:"orderSource"` FreightPrice string `json:"freightPrice"` + Pin string `json:"pin"` } //查询单个订单 @@ -96,7 +103,7 @@ func (a *API) GetOrder(orderID int64) (getOrderResult *GetOrderResult, err error "optional_fields": `orderType,payType,orderTotalPrice,orderSellerPrice, orderPayment,freightPrice,orderState,orderStateRemark, orderStartTime,orderEndTime,orderRemark,consigneeInfo, - itemInfoList,pauseBizInfo`, + itemInfoList,pauseBizInfo,pin`, // "order_state": "WAIT_SELLER_STOCK_OUT,PAUSE", }) if err == nil { diff --git a/platformapi/jdshopapi/sku_test.go b/platformapi/jdshopapi/sku_test.go index c3e3daa2..f45425bc 100644 --- a/platformapi/jdshopapi/sku_test.go +++ b/platformapi/jdshopapi/sku_test.go @@ -360,7 +360,7 @@ func TestDeleteSku(t *testing.T) { } func TestFindSkuById(t *testing.T) { - result, err := api.FindSkuById(69948250090) + result, err := api.FindSkuById(71538612626) if err != nil { t.Fatal(err) } diff --git a/platformapi/jdshopapi/store_page_test.go b/platformapi/jdshopapi/store_page_test.go index 6d75367a..65a840c9 100644 --- a/platformapi/jdshopapi/store_page_test.go +++ b/platformapi/jdshopapi/store_page_test.go @@ -104,7 +104,7 @@ func TestTryGetCookie(t *testing.T) { } func TestAAADS(t *testing.T) { - str := "AASWvkdk5a60bjm3lFqaoCyzJprhJZvabCAbNtGu14Lu/ZBGNYf/MdPCEIcIN9oVbEw=" + str := "AASWvkdk5a60bjm3lFqaoCyzBFIjrHQjoKSY+LN5VcswOzDkqjbjxVyK1Psdqcj3ci0+4I9v3evrtrJHLuUSo3eEfT3+psX6DF45CILeq0VbKxwxkE+AS1WTxr9RTHqaM3g=" data, _ := base64.StdEncoding.DecodeString(str) data2, _ := base64.StdEncoding.DecodeString("XsGNdyDyDHnR79iKU6d5LTSJYaQyWAEssDoD7VM5Kks=") b := bytes.NewBuffer(data) @@ -113,7 +113,8 @@ func TestAAADS(t *testing.T) { b.Read(iv) main := make([]byte, len(data)-18-16) b.Read(main) - decryptedData, err := Decrypt(main, data2[:16], iv) + decryptedData, err := utils.AESCBCDecpryt(main, data2[:16], iv) + // decryptedData, err := Decrypt(main, data2[:16], iv) if err != nil { t.Fatal(err) } @@ -135,27 +136,3 @@ func PKCS5UnPadding(decrypted []byte) []byte { unPadding := int(decrypted[length-1]) return decrypted[:(length - unPadding)] } - -func TestAUS(t *testing.T) { - str = ` - { - "consigneeInfo": "map[city:丰台区 cityId:2805 county:三环到四环之间 countyId:2855 fullAddress:AASWvkdk5a60bjm3lFqaoCyzGU2pgGw0Mc968Xbceeuuur8Il0tvS5LpWP0iiwxMlnsjuCvooqgcrwXLf/EqIpgmHOyV2n1UApCLdSaPAyt20D4mGqmqIHIQwUSVZm/RxWM= fullname:AASWvkdk5a60bjm3lFqaoCyzDcRkyHzNfI X/q1aFI1yPZP1k3suF6YXD8H KWhuKGo= mobile:AASWvkdk5a60bjm3lFqaoCyzyWkFBtaTbjNTqZc6TzQhYdfQcEOaeHur1JNVg0rPSLA= province:北京 provinceId:1 telephone:AASWvkdk5a60bjm3lFqaoCyz2oKxkxWmBWybvDIbcX4qcGf2tQG7Q0nBIwAkrgVza/c= town: townId:0]", - "freightPrice": "0.00", - "itemInfoList": "[map[giftPoint:0 invoiceContentId: itemExt:{\"skuUuid\":\"30_0_10374877_71027198959_2_0\",\"isVMI\":0,\"newStoreId\":\"0\"} itemTotal:1 jdPrice:40.00 newStoreId:0 outerSkuId:6045739 productNo: skuId:71027198959 skuName:小台农芒果新鲜当季水果 5斤 wareId:14650176651]]", - "orderExt": "{\"road\":\"2\",\"aerfaTime.idSopShipmentType\":\"67\"}", - "orderId": "129337563399", - "orderPayment": "8.40", - "orderRemark": "", - "orderSellerPrice": "8.40", - "orderSource": "移动端订单", - "orderStartTime": "2020-07-29 12:08:39", - "orderState": "WAIT_GOODS_RECEIVE_CONFIRM", - "orderStateRemark": "等待确认收货", - "orderTotalPrice": "40.00", - "orderType": "22", - "payType": "4-在线支付", - "storeId": "0", - "storeOrder": "" -} -` -}