package test import ( "fmt" "hudongzhuanjia/logger" pay_service "hudongzhuanjia/services/pay" "testing" "time" ) func TestUnifiedOrder(t *testing.T) { res, err := pay_service.UnifiedOrder("欧轩互动测试", "o9XM41s_NN8Y0QK6_MbM-aYMV3TE", 200, 0, 1, 101, time.Now().Add(1*time.Hour).Unix()) if err != nil { t.Error(err) } fmt.Println(res) } func TestRefund(t *testing.T) { //res, err := pay_service.Refund("测试退款", "ZxzwZv6B0A0JmiDsKMUvFCDTupu4v3kZ") res, err := pay_service.Refund("测试退款", "9dAV4ROBNLZgAHzrRmF55uCKsGvNGkeE") if err != nil { t.Error(err) } fmt.Printf("%+v", res) } func TestApi(t *testing.T) { res, err := pay_service.SendRedPack("欧轩测试", "9dAV4ROBNLZgAHzrRmF55uCKsGvNGkeE", "恭喜发财", "抢红包活动", "越抢越多", 1, 1, 1) fmt.Println(res, err) } func TestHandleReward(t *testing.T) { pay_service.HandleReward() } func TestLoggerLine(t *testing.T) { logger.Error("test") } func TestOrderQuery(t *testing.T) { fmt.Println(pay_service.OrderQuery("xxxxxx")) } func TestCloseOrder(t *testing.T) { fmt.Println(pay_service.Close("xxxxxxx")) }