91 lines
1.8 KiB
Go
91 lines
1.8 KiB
Go
package mtwmapi
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.rosy.net.cn/baseapi/utils"
|
|
)
|
|
|
|
func TestOrderViewStatus(t *testing.T) {
|
|
result, err := api.OrderViewStatus(33762863658107006)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(result)
|
|
}
|
|
|
|
func TestOrderGetOrderDetail(t *testing.T) {
|
|
result, err := api.OrderGetOrderDetail(69299961008767093, false)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if len(result) == 0 {
|
|
t.Fatal("result should have value")
|
|
}
|
|
t.Log(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestOrderGetOrderDetail2(t *testing.T) {
|
|
result, err := api.OrderGetOrderDetail2(68689721416501384, false)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestOrderReceived(t *testing.T) {
|
|
err := api.OrderReceived(25236872740350976)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func TestOrderConfirm(t *testing.T) {
|
|
err := api.OrderConfirm(25236872740350976)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func TestOrderApplyPartRefund(t *testing.T) {
|
|
err := api.OrderApplyPartRefund(25236872740350976, "缺货", []*RefundSku{
|
|
&RefundSku{
|
|
AppFoodCode: "30831",
|
|
Count: 1,
|
|
},
|
|
})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func TestOrderLogisticsStatus(t *testing.T) {
|
|
result, err := api.OrderLogisticsStatus(33762863658107006)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if len(result) == 0 {
|
|
t.Fatal("result should have value")
|
|
}
|
|
// t.Log(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestOrderBatchPullPhoneNumber(t *testing.T) {
|
|
result, err := api.OrderBatchPullPhoneNumber(testPoiCode, 0, 10)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if len(result) == 0 {
|
|
t.Fatal("result should have value")
|
|
}
|
|
// t.Log(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestGetOrderRefundDetail(t *testing.T) {
|
|
result, err := api.GetOrderRefundDetail(67413510345111009, 0)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(utils.Format4Output(result, false))
|
|
}
|