-
Notifications
You must be signed in to change notification settings - Fork 23
/
transaction_reporting_test.go
112 lines (86 loc) · 2.02 KB
/
transaction_reporting_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
package AuthorizeCIM
import (
"testing"
)
func TestGetSettledBatchList(t *testing.T) {
list := Range{
Start: LastWeek(),
End: Now(),
}
batches, err := list.SettledBatch()
if err != nil {
t.Log(err)
t.Fail()
}
batchList := batches.List()
for _, v := range batchList {
t.Log("Batch ID: ", v.BatchID, "\n")
t.Log("Payment Method: ", v.PaymentMethod, "\n")
t.Log("State: ", v.SettlementState, "\n")
}
}
func TestGetTransactionList(t *testing.T) {
list := Range{
BatchId: "6933560",
}
batches, err := list.Transactions()
if err != nil {
t.Log(err)
t.Fail()
}
batchList := batches.List()
for _, v := range batchList {
t.Log("Transaction ID: ", v.TransID, "\n")
t.Log("Amount: ", v.Amount, "\n")
t.Log("Account: ", v.AccountNumber, "\n")
}
}
func TestGetTransactionDetails(t *testing.T) {
newTransaction := PreviousTransaction{
RefId: "60019493304",
}
response, err := newTransaction.Info()
if err != nil {
t.Log(err)
t.Fail()
}
t.Log("Transaction Status: ", response.TransactionStatus, "\n")
}
func TestGetUnSettledBatchList(t *testing.T) {
batches, err := UnSettledBatch()
if err != nil {
t.Log(err)
t.Fail()
}
batchList := batches.List()
for _, v := range batchList {
t.Log("Status: ", v.TransactionStatus, "\n")
t.Log("Amount: ", v.Amount, "\n")
t.Log("Transaction ID: #", v.TransID, "\n")
}
}
func TestGetBatchStatistics(t *testing.T) {
list := Range{
BatchId: "6933560",
}
batch, err := list.Statistics()
if err != nil {
t.Log(err)
t.Fail()
}
t.Log("Refund Count: ", batch.RefundCount, "\n")
t.Log("Charge Count: ", batch.ChargeCount, "\n")
t.Log("Void Count: ", batch.VoidCount, "\n")
t.Log("Charge Amount: ", batch.ChargeAmount, "\n")
t.Log("Refund Amount: ", batch.RefundAmount, "\n")
}
func TestGetMerchantDetails(t *testing.T) {
info, err := GetMerchantDetails()
if err != nil {
t.Log(err)
t.Fail()
}
t.Log("Test Mode: ", info.IsTestMode, "\n")
t.Log("Merchant Name: ", info.MerchantName, "\n")
t.Log("Gateway ID: ", info.GatewayID, "\n")
}