- add callback sign check.
This commit is contained in:
@@ -19,6 +19,12 @@ func init() {
|
||||
// mtpsapi = NewMTPSAPI("3c0a05d464c247c19d7ec13accc78605", "b1M}9?:sTbsB[OF2gNORnN(|(iy9rB8(`7]|[wGLnbmt`evfM>E:A90DjHAW:UPE", sugarLogger)
|
||||
}
|
||||
|
||||
func handleError(t *testing.T, err error) {
|
||||
if err != nil {
|
||||
sugarLogger.Debug(err)
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
}
|
||||
func TestTest(t *testing.T) {
|
||||
sugarLogger.Debug(utils.GetCurTimeStr())
|
||||
}
|
||||
@@ -59,11 +65,39 @@ func TestCreateOrderByShop(t *testing.T) {
|
||||
}
|
||||
|
||||
order, err := mtpsapi.CreateOrderByShop(basicParams, nil)
|
||||
handleError(t, err)
|
||||
if order != nil {
|
||||
sugarLogger.Debugf("order:%v", order)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
sugarLogger.Debugf("err:%s", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func TestSimulateArrange(t *testing.T) {
|
||||
err := mtpsapi.SimulateArrange(123456789, "1529387562097059")
|
||||
handleError(t, err)
|
||||
}
|
||||
|
||||
func TestSimulatePickup(t *testing.T) {
|
||||
err := mtpsapi.SimulatePickup(123456789, "1529387562097059")
|
||||
handleError(t, err)
|
||||
}
|
||||
|
||||
func TestSimulateRearrange(t *testing.T) {
|
||||
err := mtpsapi.SimulateRearrange(123456789, "1529387562097059")
|
||||
handleError(t, err)
|
||||
}
|
||||
|
||||
func TestSimulateDeliver(t *testing.T) {
|
||||
err := mtpsapi.SimulateDeliver(123456789, "1529387562097059")
|
||||
handleError(t, err)
|
||||
}
|
||||
|
||||
func TestSimulateReportException(t *testing.T) {
|
||||
err := mtpsapi.SimulateReportException(123456789, "1529387562097059")
|
||||
handleError(t, err)
|
||||
}
|
||||
|
||||
func TestCancelOrder(t *testing.T) {
|
||||
result, err := mtpsapi.CancelOrder(123456789, "1529387562097059", CancelReasonMerchantOther, "just a test")
|
||||
handleError(t, err)
|
||||
sugarLogger.Debug(result)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user