-
Notifications
You must be signed in to change notification settings - Fork 0
/
account_test.go
89 lines (81 loc) · 1.51 KB
/
account_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
package pasdk
import (
"testing"
)
func Test_Account(t *testing.T) {
if shouldRunIntegrationTests() {
return
}
request := AccountRequest{}
response, err := request.Fetch()
if err != nil {
t.Error(err)
return
}
if response.DisplayName != "Test Merchant" {
t.Error()
}
if response.LegalName != "Test Merchant" {
t.Error()
}
if response.Plans[0].ID != 6 {
t.Error()
}
if response.Plans[0].Name != "3-Payment" {
t.Error()
}
if response.Plans[0].Instalments != 3 {
t.Error()
}
if response.Plans[0].DepositRequired != true {
t.Error()
}
if response.Plans[0].APR != "0" {
t.Error()
}
if response.Plans[0].Frequency != "monthly" {
t.Error()
}
if response.Plans[0].MinAmount != nil {
t.Error()
}
if *response.Plans[0].MaxAmount != 500000 {
t.Error()
}
if response.Plans[0].CommissionRate != "8.50" {
t.Error()
}
if response.Plans[0].CommissionFixedFee != nil {
t.Error()
}
if response.Plans[1].ID != 1 {
t.Error()
}
if response.Plans[1].Name != "4-Payment" {
t.Error()
}
if response.Plans[1].Instalments != 4 {
t.Error()
}
if response.Plans[1].DepositRequired != false {
t.Error()
}
if response.Plans[1].APR != "5.5" {
t.Error()
}
if response.Plans[1].Frequency != "monthly" {
t.Error()
}
if *response.Plans[1].MinAmount != 10000 {
t.Error()
}
if *response.Plans[1].MaxAmount != 300000 {
t.Error(*response.Plans[1].MaxAmount)
}
if response.Plans[1].CommissionRate != "0" {
t.Error()
}
if *response.Plans[1].CommissionFixedFee != 5000 {
t.Error()
}
}