- correct implementation of AddOrderAfterQuery
This commit is contained in:
47
platformapi/dadaapi/order_test.go
Normal file
47
platformapi/dadaapi/order_test.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package dadaapi
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
|
||||
func TestAddOrderAfterQuery(t *testing.T) {
|
||||
orderID := utils.GetUUID()
|
||||
result, err := dadaapi.QueryDeliverFee(&OperateOrderRequiredParams{
|
||||
ShopNo: "18180948107",
|
||||
OriginID: orderID,
|
||||
CityCode: "028",
|
||||
CargoPrice: 0.01,
|
||||
IsPrepay: 0,
|
||||
ReceiverName: "徐建华",
|
||||
ReceiverAddress: "西南交通大学科技大厦",
|
||||
ReceiverLng: 104.056822,
|
||||
ReceiverLat: 30.696041,
|
||||
ReceiverPhone: "18180948107",
|
||||
}, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
baseapi.SugarLogger.Debug(utils.Format4Output(result, false))
|
||||
|
||||
err = dadaapi.AddOrderAfterQuery(result.DeliveryNo)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cancelResponse, err := dadaapi.CancelOrder(orderID, ReasonIDOther, "test")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
baseapi.SugarLogger.Debug(utils.Format4Output(cancelResponse, false))
|
||||
}
|
||||
|
||||
func TestCancel(t *testing.T) {
|
||||
cancelResponse, err := dadaapi.CancelOrder("94065C161F8E11E9AAC8186590E02977", ReasonIDOther, "test")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
baseapi.SugarLogger.Debug(utils.Format4Output(cancelResponse, false))
|
||||
}
|
||||
Reference in New Issue
Block a user