-
Notifications
You must be signed in to change notification settings - Fork 58
/
transaction.go
44 lines (35 loc) · 1.31 KB
/
transaction.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
package transaction
import (
"context"
"github.com/xendit/xendit-go"
)
// GetTransaction gets one retail outlet fixed payment code
func GetTransaction(data *GetTransactionParams) (*xendit.Transaction, *xendit.Error) {
return GetTransactionnWithContext(context.Background(), data)
}
// GetTransactionnWithContext gets one retail outlet fixed payment code with context
func GetTransactionnWithContext(ctx context.Context, data *GetTransactionParams) (*xendit.Transaction, *xendit.Error) {
client, err := getClient()
if err != nil {
return nil, err
}
return client.GetTransactionnWithContext(ctx, data)
}
// GetListTransaction gets one retail outlet fixed payment code
func GetListTransaction(data *GetListTransactionParams) (*xendit.ListTransactions, *xendit.Error) {
return GetListTransactionnWithContext(context.Background(), data)
}
// GetListTransactionnWithContext gets one retail outlet fixed payment code with context
func GetListTransactionnWithContext(ctx context.Context, data *GetListTransactionParams) (*xendit.ListTransactions, *xendit.Error) {
client, err := getClient()
if err != nil {
return nil, err
}
return client.GetListTransactionWithContext(ctx, data)
}
func getClient() (*Client, *xendit.Error) {
return &Client{
Opt: &xendit.Opt,
APIRequester: xendit.GetAPIRequester(),
}, nil
}