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.

38 lines
840 B

4 years ago
  1. // @Time : 2020/7/9 17:07
  2. // @Author : 黑白配
  3. // @File : main_test.go
  4. // @PackageName:WXPay
  5. // @Description:
  6. package WXPay
  7. import (
  8. "git.ouxuan.net/3136352472/wxpay/global"
  9. "git.ouxuan.net/3136352472/wxpay/src/V2"
  10. "git.ouxuan.net/3136352472/wxpay/src/V3/smartGuide"
  11. "testing"
  12. )
  13. func TestInit(t *testing.T) {
  14. api := Init(global.V2)
  15. if data, err := api.V3.SmartGuide.Query(smartGuide.Query{StoreID: 20774227}); err == nil {
  16. t.Log(data)
  17. } else {
  18. t.Error(err)
  19. }
  20. if data, err := api.V2.WxAppPay(V2.UnifiedOrder{
  21. Attach: "支付测试",
  22. OutTradeNo: "11111111111115 ",
  23. TotalFee: 1,
  24. SpbillCreateIP: "127.0.0.1",
  25. OpenID: "owJNp5PDj8lja9S3m2l2M_jt3aHY",
  26. Receipt: "Y",
  27. Body: "测试",
  28. TradeType: "JSAPI",
  29. }); err == nil {
  30. t.Log(data)
  31. } else {
  32. t.Error(err)
  33. }
  34. }