forked from smartwalle/alipay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fund_test.go
119 lines (105 loc) · 2.61 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
package alipay_test
import (
"testing"
"github.com/smartwalle/alipay/v3"
)
func TestClient_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.IsFailure() {
t.Fatal(rsp.Msg, rsp.SubMsg)
}
t.Logf("%v", rsp)
}
func TestClient_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.IsFailure() {
t.Fatal(rsp.Msg, rsp.SubMsg)
}
t.Logf("%v", rsp)
}
func TestClient_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)
}
func TestClient_FundTransUniTransfer(t *testing.T) {
t.Log("========== FundTransUniTransfer ==========")
var param = alipay.FundTransUniTransfer{
OutBizNo: "1111",
TransAmount: "10.00",
ProductCode: "TRANS_ACCOUNT_NO_PWD",
BizScene: "DIRECT_TRANSFER",
OrderTitle: "remark",
PayeeInfo: &alipay.PayeeInfo{
Identity: "[email protected]",
IdentityType: "ALIPAY_LOGON_ID",
Name: "沙箱环境",
},
Remark: "remark",
}
rsp, err := client.FundTransUniTransfer(param)
if err != nil {
t.Fatal(err)
}
if rsp.IsFailure() {
t.Fatal(rsp.Msg, rsp.SubMsg)
}
t.Logf("%v", rsp)
}
func TestClient_FundTransCommonQuery(t *testing.T) {
t.Log("========== FundTransCommonQuery ==========")
var param = alipay.FundTransCommonQuery{
ProductCode: "TRANS_ACCOUNT_NO_PWD",
BizScene: "DIRECT_TRANSFER",
OutBizNo: "1111",
}
rsp, err := client.FundTransCommonQuery(param)
if err != nil {
t.Fatal(err)
}
if rsp.IsFailure() {
t.Fatal(rsp.Msg, rsp.SubMsg)
}
t.Logf("%v", rsp)
}
func TestClient_FundAccountQuery(t *testing.T) {
t.Log("========== FundAccountQuery ==========")
var param = alipay.FundAccountQuery{
AliPayUserId: "2088102169227503",
}
rsp, err := client.FundAccountQuery(param)
if err != nil {
t.Fatal(err)
}
if rsp.IsFailure() {
t.Fatal(rsp.Msg, rsp.SubMsg)
}
t.Logf("%v", rsp)
}