diff --git a/platformapi/ebaiapi/order_test.go b/platformapi/ebaiapi/order_test.go index 9c351967..1d3d8d02 100644 --- a/platformapi/ebaiapi/order_test.go +++ b/platformapi/ebaiapi/order_test.go @@ -13,7 +13,7 @@ func TestCancelOrder(t *testing.T) { } func TestOrderGet(t *testing.T) { - result, err := api.OrderGet("4055150105296238277") + result, err := api.OrderGet("4085900049668072177") if err != nil { t.Fatal(err) } else { @@ -23,15 +23,14 @@ func TestOrderGet(t *testing.T) { func TestOrderAgreePartRefund(t *testing.T) { param := &RefundOrderExamine{ - ReverseOrderId: "2308279044977730245", - OrderId: "4015750049354953219", - IdempotentId: utils.Int64ToStr(time.Now().UnixNano()), - ActionType: RefundTypeAgree, - ReasonCode: "", - ReasonRemarks: "", + OrderId: "4015750049354953219", + IdempotentId: utils.Int64ToStr(time.Now().UnixNano()), + ActionType: RefundTypeAgree, + ReasonCode: "", + ReasonRemarks: "", } refundProductList := make([]*RefundProductList, 0, 0) - date, _ := api.GetReverseOrder("4015750049354953219") + date, _ := api.GetReverseOrder("4035480124822912660") for _, v := range date { v2 := v.(map[string]interface{}) refundProduct := &RefundProductList{ @@ -44,6 +43,9 @@ func TestOrderAgreePartRefund(t *testing.T) { case 1: refundProduct.RefundAmount = utils.Int64ToStr(utils.MustInterface2Int64(v2["refund_user_amount"])) } + if param.ReverseOrderId == "" { + param.ReverseOrderId = utils.Int64ToStr(utils.Interface2Int64WithDefault(v2["refund_order_id"], 0)) + } refundProductList = append(refundProductList, refundProduct) } param.RefundProductList = refundProductList @@ -63,7 +65,7 @@ func TestOrderAgreeRefund(t *testing.T) { } func TestGetReverseOrder(t *testing.T) { - date, _ := api.GetReverseOrder("4099660048407490187") + date, _ := api.GetReverseOrder("4035480124822912660") for _, v := range date { fmt.Println(v) } diff --git a/platformapi/mtwmapi/food_test.go b/platformapi/mtwmapi/food_test.go index a903439f..6b298ede 100644 --- a/platformapi/mtwmapi/food_test.go +++ b/platformapi/mtwmapi/food_test.go @@ -16,5 +16,5 @@ func TestFoodList(t *testing.T) { } func TestGetSkuPurchasePrice(t *testing.T) { - api.GetSkuPurchasePrice("18048546", "16295939515") + api.GetSkuPurchasePrice("18048546", "305011066") } diff --git a/platformapi/mtwmapi/mtwmapi_test.go b/platformapi/mtwmapi/mtwmapi_test.go index f8d4ccb6..746f6abc 100644 --- a/platformapi/mtwmapi/mtwmapi_test.go +++ b/platformapi/mtwmapi/mtwmapi_test.go @@ -20,14 +20,13 @@ func init() { baseapi.Init(sugarLogger) // 菜市 - api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") + //api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") // 果园 //api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") //商超 - //api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_ovSLnyKTsMNx0RxMzJ1C7w") //token_n4TwqCntWWuvQwAawzxC0w - + api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_r36FEse6_ywebQI65FNNWA") //token_n4TwqCntWWuvQwAawzxC0w cookieStr := ` acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1; ` diff --git a/platformapi/tiktok_shop/tiktok_api/afs_test.go b/platformapi/tiktok_shop/tiktok_api/afs_test.go index c48b2d34..a5ba4e59 100644 --- a/platformapi/tiktok_shop/tiktok_api/afs_test.go +++ b/platformapi/tiktok_shop/tiktok_api/afs_test.go @@ -7,12 +7,12 @@ import ( "testing" ) -var token = `{"access_token":"4a1ac795-50a7-4f83-8b13-a0ee30d93456","expires_in":1692502247,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"b1892379-82b9-4636-91a3-2bff32d164ca","authority_id":""}` +var token = `{"access_token":"4a543151-f8fd-43d5-9c34-d19fe11fc51c","expires_in":1694069036,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"5a2aaca1-42f7-4b83-9358-8ed5d1d4bcd6","authority_id":""}` var a = New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", token) // 查询售后单详情 func TestAfsOrder(t *testing.T) { - a.QueryAfsOrderDetail("7165706329204670732", true) + a.QueryAfsOrderDetail("6921428072500696298", true) } // 同意/拒绝售后单 diff --git a/platformapi/tiktok_shop/tiktok_api/api_test.go b/platformapi/tiktok_shop/tiktok_api/api_test.go index bf166ea9..1145b851 100644 --- a/platformapi/tiktok_shop/tiktok_api/api_test.go +++ b/platformapi/tiktok_shop/tiktok_api/api_test.go @@ -82,17 +82,23 @@ func TestApplyMarketAfterSale(t *testing.T) { } func TestOrderStatusAndPsInfo(t *testing.T) { - a := NewExpress("7153997323561879075", "3517d3ea-b96b-4379-a7a4-2d9389e8ffeb", "") + //appKey := `7152420904331429407` // 暂时定死 + //appSecret := `cc7ba367-2394-4cbb-81c6-26f0e929d1c6` //暂时定死 + token := `{"access_token":"4a543151-f8fd-43d5-9c34-d19fe11fc51c","expires_in":1694069036,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"5a2aaca1-42f7-4b83-9358-8ed5d1d4bcd6","authority_id":""}` + a := NewExpress("7152420904331429407", "cc7ba367-2394-4cbb-81c6-26f0e929d1c6", token) a.CreateToken() param := make(map[string]interface{}, 0) - param["third_carrier_order_id"] = "4996521792598113690" - param["logistics_context"] = "呼叫骑手" - param["opcode"] = "CALL_RIDER" - param["courier_name"] = "" - param["courier_phone"] = "" + param["third_carrier_order_id"] = "6921428072500696298" + param["logistics_context"] = "JIEDAN" + param["opcode"] = "DELIVERED" + param["courier_name"] = "刘磊" + param["courier_phone"] = "18981810340" a.OrderStatusAndPsInfo(param) } -func TestMap(t *testing.T) { - fmt.Println((57 & 2) != 0) -} +// +// +//TiktokLogisticsORDERRECEIVED = "ORDER_RECEIVED" // 已接单 +//TiktokLogisticsRIDERARRIVED = "RIDER_ARRIVED" // 已到店 +//TiktokLogisticsRIDERPICKUP = "RIDER_PICK_UP" // 已取货 +//TiktokLogisticsDELIVERED = "DELIVERED" // 已送达 diff --git a/platformapi/tiktok_shop/tiktok_api/transport_test.go b/platformapi/tiktok_shop/tiktok_api/transport_test.go index a6a4765e..f75154da 100644 --- a/platformapi/tiktok_shop/tiktok_api/transport_test.go +++ b/platformapi/tiktok_shop/tiktok_api/transport_test.go @@ -37,7 +37,7 @@ func Test(t *testing.T) { } func TestGetShipmentInfo(t *testing.T) { - a.GetShipmentInfo(5030299715093774047, 0, ShipmentTypeInvoice) + a.GetShipmentInfo(6921428072500696298, 0, ShipmentTypeInvoice) } func TestGetStoreAutoCallRiderInfo(t *testing.T) {