互动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.1 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. package test
  2. import (
  3. "fmt"
  4. "hudongzhuanjia/logger"
  5. pay_service "hudongzhuanjia/services/pay"
  6. "testing"
  7. "time"
  8. )
  9. func TestUnifiedOrder(t *testing.T) {
  10. res, err := pay_service.UnifiedOrder("欧轩互动测试", "o9XM41s_NN8Y0QK6_MbM-aYMV3TE",
  11. 200, 0, 1, 101, time.Now().Add(1*time.Hour).Unix())
  12. if err != nil {
  13. t.Error(err)
  14. }
  15. fmt.Println(res)
  16. }
  17. func TestRefund(t *testing.T) {
  18. //res, err := pay_service.Refund("测试退款", "ZxzwZv6B0A0JmiDsKMUvFCDTupu4v3kZ")
  19. res, err := pay_service.Refund("测试退款", "9dAV4ROBNLZgAHzrRmF55uCKsGvNGkeE")
  20. if err != nil {
  21. t.Error(err)
  22. }
  23. fmt.Printf("%+v", res)
  24. }
  25. func TestApi(t *testing.T) {
  26. res, err := pay_service.SendRedPack("欧轩测试", "9dAV4ROBNLZgAHzrRmF55uCKsGvNGkeE",
  27. "恭喜发财", "抢红包活动", "越抢越多", 1, 1, 1)
  28. fmt.Println(res, err)
  29. }
  30. func TestHandleReward(t *testing.T) {
  31. pay_service.HandleReward()
  32. }
  33. func TestLoggerLine(t *testing.T) {
  34. logger.Error("test")
  35. }
  36. func TestOrderQuery(t *testing.T) {
  37. fmt.Println(pay_service.OrderQuery("xxxxxx"))
  38. }
  39. func TestCloseOrder(t *testing.T) {
  40. fmt.Println(pay_service.Close("xxxxxxx"))
  41. }