diff --git a/client/api.go b/client/api.go index 54c8cc0e..8b64b400 100644 --- a/client/api.go +++ b/client/api.go @@ -16,6 +16,7 @@ import ( "github.com/xendit/xendit-go/qrcode" "github.com/xendit/xendit-go/recurringpayment" "github.com/xendit/xendit-go/retailoutlet" + "github.com/xendit/xendit-go/transaction" "github.com/xendit/xendit-go/virtualaccount" ) @@ -35,6 +36,7 @@ type API struct { Disbursement *disbursement.Client QRCode *qrcode.Client Customer *customer.Client + Transaction *transaction.Client } func (a *API) init() { @@ -50,6 +52,7 @@ func (a *API) init() { a.Disbursement = &disbursement.Client{Opt: &a.opt, APIRequester: a.apiRequester} a.QRCode = &qrcode.Client{Opt: &a.opt, APIRequester: a.apiRequester} a.Customer = &customer.Client{Opt: &a.opt, APIRequester: a.apiRequester} + a.Transaction = &transaction.Client{Opt: &a.opt, APIRequester: a.apiRequester} } // New creates a new Xendit API client diff --git a/transaction/client.go b/transaction/client.go index 1304391d..7c017a55 100644 --- a/transaction/client.go +++ b/transaction/client.go @@ -10,7 +10,7 @@ import ( "github.com/xendit/xendit-go/utils/validator" ) -// Client is the client used to invoke invoice API. +// Client is the client used to invoke transaction API type Client struct { Opt *xendit.Option APIRequester xendit.APIRequester @@ -50,12 +50,12 @@ func (c *Client) GetTransactionnWithContext(ctx context.Context, data *GetTransa return response, nil } -// GetListTransaction gets list transaction +// GetListTransaction gets list transactions func (c *Client) GetListTransaction(data *GetListTransactionParams) (*xendit.ListTransactions, *xendit.Error) { return c.GetListTransactionWithContext(context.Background(), data) } -// GetListTransactionWithContext gets list transaction with context +// GetListTransactionWithContext gets list transactions with context func (c *Client) GetListTransactionWithContext(ctx context.Context, data *GetListTransactionParams) (*xendit.ListTransactions, *xendit.Error) { if err := validator.ValidateRequired(ctx, data); err != nil { return nil, validator.APIValidatorErr(err)