forked from smartwalle/alipay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bill_test.go
34 lines (31 loc) · 878 Bytes
/
bill_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
package alipay_test
import (
"github.com/smartwalle/alipay/v3"
"testing"
)
func TestClient_BillDownloadURLQuery(t *testing.T) {
t.Log("========== BillDownloadURLQuery ==========")
var p = alipay.BillDownloadURLQuery{}
p.BillType = "trade"
p.BillDate = "2019-01-01"
rsp, err := client.BillDownloadURLQuery(p)
if err != nil {
t.Fatal(err)
}
if rsp.Content.Code != alipay.CodeSuccess {
t.Fatal(rsp.Content.Msg, rsp.Content.SubMsg)
}
t.Log(rsp.Content.BillDownloadUrl)
}
func TestClient_BillBalanceQuery(t *testing.T) {
t.Log("========== BillBalanceQuery ==========")
var p = alipay.BillBalanceQuery{}
rsp, err := client.BillBalanceQuery(p)
if err != nil {
t.Fatal(err)
}
if rsp.Content.Code != alipay.CodeSuccess {
t.Fatal(rsp.Content.Msg, rsp.Content.SubMsg)
}
t.Log(rsp.Content.TotalAmount, rsp.Content.FreezeAmount, rsp.Content.AvailableAmount)
}