forked from smartwalle/alipay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fund_test.go
56 lines (51 loc) · 1.36 KB
/
fund_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package alipay_test
import (
"github.com/smartwalle/alipay"
"testing"
)
func TestAliPay_FundTransToAccountTransfer(t *testing.T) {
t.Log("========== FundTransToAccountTransfer ==========")
var p = alipay.FundTransToAccountTransfer{}
p.OutBizNo = "xxxx"
p.PayeeType = "ALIPAY_LOGONID"
p.PayeeAccount = "[email protected]"
p.Amount = "100"
rsp, err := client.FundTransToAccountTransfer(p)
if err != nil {
t.Fatal(err)
}
if rsp.Content.Code != alipay.K_SUCCESS_CODE {
t.Fatal(rsp.Content.Msg, rsp.Content.SubMsg)
}
t.Log(rsp.Content.Msg)
}
func TestAliPay_FundAuthOrderVoucherCreate(t *testing.T) {
t.Log("========== FundAuthOrderVoucherCreate ==========")
var p = alipay.FundAuthOrderVoucherCreate{}
p.OutOrderNo = "1111"
p.OutRequestNo = "222"
p.OrderTitle = "eee"
p.Amount = "1001"
rsp, err := client.FundAuthOrderVoucherCreate(p)
if err != nil {
t.Fatal(err)
}
if rsp.Content.Code != alipay.K_SUCCESS_CODE {
t.Fatal(rsp.Content.Msg, rsp.Content.SubMsg)
}
t.Log(rsp.Content.Msg)
}
func TestAliPay_FundAuthOrderAppFreeze(t *testing.T) {
t.Log("========== FundAuthOrderAppFreeze ==========")
var p = alipay.FundAuthOrderAppFreeze{}
p.OutOrderNo = "111"
p.OutRequestNo = "xxxxx"
p.OrderTitle = "test"
p.Amount = "100"
p.ProductCode = "PRE_AUTH_ONLINE"
rsp, err := client.FundAuthOrderAppFreeze(p)
if err != nil {
t.Fatal(err)
}
t.Log(rsp)
}