-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransfers.go
54 lines (49 loc) · 1.58 KB
/
transfers.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
package examples
import (
"context"
"encoding/json"
"log"
"github.com/rizefinance/rize-go-sdk"
)
// List Transfers
func (e Example) ExampleTransferService_List(rc *rize.Client) {
params := &rize.TransferListParams{
CustomerUID: "uKxmLxUEiSj5h4M3",
ExternalUID: "client-generated-id",
PoolUID: "wTSMX1GubP21ev2h",
SyntheticAccountUID: "4XkJnsfHsuqrxmeX",
Limit: 100,
Offset: 10,
}
resp, err := rc.Transfers.List(context.Background(), params)
if err != nil {
log.Fatal("Error fetching Transfers\n", err)
}
output, _ := json.MarshalIndent(resp, "", "\t")
log.Println("List Transfers:", string(output))
}
// Create Transfer
func (e Example) ExampleTransferService_Create(rc *rize.Client) {
params := &rize.TransferCreateParams{
ExternalUID: "partner-generated-id",
SourceSyntheticAccountUID: "4XkJnsfHsuqrxmeX",
DestinationSyntheticAccountUID: "exMDShw6yM3NHLYV",
InitiatingCustomerUID: "iDtmSA52zRhgN4iy",
USDTransferAmount: "12.34",
}
resp, err := rc.Transfers.Create(context.Background(), params)
if err != nil {
log.Fatal("Error creating Transfer\n", err)
}
output, _ := json.MarshalIndent(resp, "", "\t")
log.Println("Create Transfer:", string(output))
}
// Get Transfer
func (e Example) ExampleTransferService_Get(rc *rize.Client) {
resp, err := rc.Transfers.Get(context.Background(), "EhrQZJNjCd79LLYq")
if err != nil {
log.Fatal("Error fetching Transfer\n", err)
}
output, _ := json.MarshalIndent(resp, "", "\t")
log.Println("Get Transfer:", string(output))
}