Skip to content

Commit b8fe182

Browse files
committed
Add account to client API
1 parent ccb95a7 commit b8fe182

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

client/api.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"net/http"
66

77
"github.com/xendit/xendit-go"
8+
"github.com/xendit/xendit-go/account"
89
"github.com/xendit/xendit-go/balance"
910
"github.com/xendit/xendit-go/card"
1011
"github.com/xendit/xendit-go/cardlesscredit"
@@ -39,6 +40,7 @@ type API struct {
3940
Customer *customer.Client
4041
Transaction *transaction.Client
4142
Report *report.Client
43+
Account *account.Client
4244
}
4345

4446
func (a *API) init() {
@@ -56,6 +58,7 @@ func (a *API) init() {
5658
a.Customer = &customer.Client{Opt: &a.opt, APIRequester: a.apiRequester}
5759
a.Transaction = &transaction.Client{Opt: &a.opt, APIRequester: a.apiRequester}
5860
a.Report = &report.Client{Opt: &a.opt, APIRequester: a.apiRequester}
61+
a.Account = &account.Client{Opt: &a.opt, APIRequester: a.apiRequester}
5962
}
6063

6164
// New creates a new Xendit API client
@@ -74,7 +77,8 @@ func New(secretKey string) *API {
7477

7578
// WithAPIRequester set custom APIRequester for Xendit Client
7679
// Can be chained with constructor like below:
77-
// client.New(yourSecretKey).WithAPIRequester(yourCustomRequester)
80+
//
81+
// client.New(yourSecretKey).WithAPIRequester(yourCustomRequester)
7882
func (a *API) WithAPIRequester(apiRequester xendit.APIRequester) *API {
7983
a.apiRequester = apiRequester
8084
a.init()
@@ -83,7 +87,8 @@ func (a *API) WithAPIRequester(apiRequester xendit.APIRequester) *API {
8387

8488
// WithCustomURL set custom xendit URL for Xendit Client
8589
// Can be chained with constructor like below:
86-
// client.New(yourSecretKey).WithCustomURL(yourCustomURL)
90+
//
91+
// client.New(yourSecretKey).WithCustomURL(yourCustomURL)
8792
func (a *API) WithCustomURL(xenditURL string) *API {
8893
a.opt.XenditURL = xenditURL
8994
a.init()
@@ -92,7 +97,8 @@ func (a *API) WithCustomURL(xenditURL string) *API {
9297

9398
// WithCustomHTTPClient set custom HTTP Client for default API Requester
9499
// Can be chained with constructor like below:
95-
// client.New(yourSecretKey).WithCustomHTTPClient(yourCustomHTTPClient)
100+
//
101+
// client.New(yourSecretKey).WithCustomHTTPClient(yourCustomHTTPClient)
96102
func (a *API) WithCustomHTTPClient(client *http.Client) *API {
97103
a.apiRequester = &xendit.APIRequesterImplementation{
98104
HTTPClient: client,

0 commit comments

Comments
 (0)