对接新供应链-唯品尚

This commit is contained in:
zhongqiang
2025-06-04 11:00:10 +08:00
parent e936dd6622
commit 1b97811c6a
4 changed files with 92 additions and 13 deletions

View File

@@ -80,14 +80,14 @@ func TestWeiPinShangClient_PreOrder(t *testing.T) {
Key: "f654ea5bde7635c3f46191191e5c4c8e",
},
args: PreOrderReq{
GoodsInfo: "[{\"goodsId\":\"WPS9_282520\",\"goodSpecId\":\"WPS9_1221183858889276\",\"num\":2},{\"goodsId\":\"WPS2_0213160707208717\",\"goodSpecId\":\"WPS2_0213160707965791\",\"num\":2}]",
GoodsInfo: "[{\"goodsId\":\"WPS9_282520\",\"goodSpecId\":\"WPS9_1221183858889276\",\"num\":2}]",
Province: "广东省",
Address: "奥园",
City: "广州市",
Area: "番禺区",
ConsigneePhone: "15375390426",
ConsigneeContacts: "张三",
LockCode: "L0123456789",
LockCode: "L100000000",
Source: "AILEHUI",
},
},
@@ -135,8 +135,8 @@ func TestWeiPinShangClient_CreateOrder(t *testing.T) {
Key: "f654ea5bde7635c3f46191191e5c4c8e",
},
args: CreateOrderReq{
LockCode: "L0123456789",
OrderNo: "20000000000",
LockCode: "L100000000",
OrderNo: "30000000000",
},
},
}
@@ -233,7 +233,7 @@ func TestWeiPinShangClient_GetOrderInfoByItemNO(t *testing.T) {
},
args: args{
//mcOrderNo: "mc20250527174640537475",
mcOrderNo: "mc20250529102347907570",
mcOrderNo: "mc20250529102347485667",
},
},
}
@@ -362,6 +362,53 @@ func TestWeiPinShangClient_IsRefund(t *testing.T) {
}
}
func TestWeiPinShangClient_OrderCancel(t *testing.T) {
type fields struct {
Host string
ChannelType string
Key string
}
type args struct {
mcOrderNo string
}
tests := []struct {
name string
fields fields
args args
wantRes *IsRefundRes
wantErr bool
}{
{
name: "test1",
fields: fields{
Host: "https://uat.api.weipinshang.net/",
ChannelType: "AILEHUI",
Key: "f654ea5bde7635c3f46191191e5c4c8e",
},
args: args{
mcOrderNo: "mc20250529102347485667",
},
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
h := &WeiPinShangClient{
Host: test.fields.Host,
ChannelType: test.fields.ChannelType,
Key: test.fields.Key,
}
gotRes, err := h.OrderCancel(test.args.mcOrderNo)
log.Println(gotRes, err)
if (err != nil) != test.wantErr {
t.Errorf("GetManyPostage() error = %v, wantErr %v", err, test.wantErr)
}
})
}
}
// test ---------------------------------------------------
func TestWeiPinShangClient_DeliverGoods(t *testing.T) {
@@ -400,7 +447,7 @@ func TestWeiPinShangClient_DeliverGoods(t *testing.T) {
Key: "f654ea5bde7635c3f46191191e5c4c8e",
},
args: DeliverGoodsReq{
COrderItemNo: "mc20250527172503673418",
COrderItemNo: "mc20250530115549372224",
CDeliveryName: "京东",
CDeliveryNo: "1234567890",
},
@@ -459,8 +506,8 @@ func TestWeiPinShangClient_UpdateService(t *testing.T) {
Key: "f654ea5bde7635c3f46191191e5c4c8e",
},
args: UpdateServiceReq{
COrderItemNo: "10000000000",
CType: "2",
COrderItemNo: "mc20250530172009173148",
CType: "3",
},
},
}