-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransactions.go
138 lines (128 loc) · 4.91 KB
/
transactions.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
package examples
import (
"context"
"encoding/json"
"log"
"github.com/rizefinance/rize-go-sdk"
)
// List Transactions
func (e Example) ExampleTransactionService_List(rc *rize.Client) {
params := &rize.TransactionListParams{
CustomerUID: "uKxmLxUEiSj5h4M3",
PoolUID: "wTSMX1GubP21ev2h",
DebitCardUID: "MYNGv45UK6HWBHHf",
SourceSyntheticAccountUID: "4XkJnsfHsuqrxmeX",
DestinationSyntheticAccountUID: "exMDShw6yM3NHLYV",
SyntheticAccountUID: "4XkJnsfHsuqrxmeX",
Type: "card_refund",
ShowDeniedAuths: true,
ShowExpired: true,
Status: "failed",
SearchDescription: "Transfer%2A",
IncludeZero: true,
Limit: 100,
Offset: 10,
Sort: "id_asc",
}
resp, err := rc.Transactions.List(context.Background(), params)
if err != nil {
log.Fatal("Error fetching Transactions\n", err)
}
output, _ := json.MarshalIndent(resp, "", "\t")
log.Println("List Transactions:", string(output))
}
// Get Transaction
func (e Example) ExampleTransactionService_Get(rc *rize.Client) {
resp, err := rc.Transactions.Get(context.Background(), "SMwKC1osz77DTEiu")
if err != nil {
log.Fatal("Error fetching Transaction\n", err)
}
output, _ := json.MarshalIndent(resp, "", "\t")
log.Println("Get Transaction:", string(output))
}
// List Transaction Events
func (e Example) ExampleTransactionService_ListTransactionEvents(rc *rize.Client) {
params := &rize.TransactionEventListParams{
SourceCustodialAccountUID: "dmRtw1xkS9ghrntB",
DestinationCustodialAccountUID: "W55zKgvAk3zkpGM3",
CustodialAccountUID: "dmRtw1xkS9ghrntB",
Type: "odfi_ach_withdrawal",
TransactionUID: "SMwKC1osz77DTEiu",
Limit: 100,
Offset: 10,
Sort: "created_at_asc",
}
resp, err := rc.Transactions.ListTransactionEvents(context.Background(), params)
if err != nil {
log.Fatal("Error fetching Transaction Events\n", err)
}
output, _ := json.MarshalIndent(resp, "", "\t")
log.Println("List Transaction Events:", string(output))
}
// Get Transaction Event
func (e Example) ExampleTransactionService_GetTransactionEvent(rc *rize.Client) {
resp, err := rc.Transactions.GetTransactionEvent(context.Background(), "MB2yqBrm3c4bUbou")
if err != nil {
log.Fatal("Error fetching Transaction Event\n", err)
}
output, _ := json.MarshalIndent(resp, "", "\t")
log.Println("Get Transaction Event:", string(output))
}
// List Synthetic Line Items
func (e Example) ExampleTransactionService_ListSyntheticLineItems(rc *rize.Client) {
params := &rize.SyntheticLineItemListParams{
CustomerUID: "uKxmLxUEiSj5h4M3",
PoolUID: "wTSMX1GubP21ev2h",
SyntheticAccountUID: "4XkJnsfHsuqrxmeX",
Limit: 100,
Offset: 10,
TransactionUID: "SMwKC1osz77DTEiu",
Status: "in_progress",
Sort: "created_at_asc",
}
resp, err := rc.Transactions.ListSyntheticLineItems(context.Background(), params)
if err != nil {
log.Fatal("Error fetching Synthetic Line Items\n", err)
}
output, _ := json.MarshalIndent(resp, "", "\t")
log.Println("List Synthetic Line Items:", string(output))
}
// Get Synthetic Line Item
func (e Example) ExampleTransactionService_GetSyntheticLineItem(rc *rize.Client) {
resp, err := rc.Transactions.GetSyntheticLineItem(context.Background(), "j56aHgLBqkNu1KwK")
if err != nil {
log.Fatal("Error fetching Synthetic Line Item\n", err)
}
output, _ := json.MarshalIndent(resp, "", "\t")
log.Println("Get Synthetic Line Item:", string(output))
}
// List Custodial Line Items
func (e Example) ExampleTransactionService_ListCustodialLineItems(rc *rize.Client) {
params := &rize.CustodialLineItemListParams{
CustomerUID: "uKxmLxUEiSj5h4M3",
CustodialAccountUID: "wTSMX1GubP21ev2h",
Status: "voided",
USDollarAmountMax: 2,
USDollarAmountMin: 2,
TransactionEventUID: "MB2yqBrm3c4bUbou",
TransactionUID: "SMwKC1osz77DTEiu",
Limit: 100,
Offset: 10,
Sort: "created_at_asc",
}
resp, err := rc.Transactions.ListCustodialLineItems(context.Background(), params)
if err != nil {
log.Fatal("Error fetching Custodial Line Items\n", err)
}
output, _ := json.MarshalIndent(resp, "", "\t")
log.Println("List Custodial Line Items:", string(output))
}
// Get Custodial Line Item
func (e Example) ExampleTransactionService_GetCustodialLineItem(rc *rize.Client) {
resp, err := rc.Transactions.GetCustodialLineItem(context.Background(), "j56aHgLBqkNu1KwK")
if err != nil {
log.Fatal("Error fetching Custodial Line Item\n", err)
}
output, _ := json.MarshalIndent(resp, "", "\t")
log.Println("Get Custodial Line Item:", string(output))
}