diff options
| author | Shulhan <ms@kilabit.info> | 2022-11-07 11:05:27 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-11-07 11:05:27 +0700 |
| commit | ab25f641e3343151839cf2624d19ef235a070c9d (patch) | |
| tree | 03e37bbeeb2e0034d066cc92cd7f582ab47ec13f | |
| parent | f56f142d9a9b10beac2081695cfbbbff481d4297 (diff) | |
| download | duitku-ab25f641e3343151839cf2624d19ef235a070c9d.tar.xz | |
all: remove prefix Disbursement from Client methods
Since most methods are call to disbursement methods, adding Disbursement
in the method names not only make it longer but sligtly redundant.
| -rw-r--r-- | client.go | 12 | ||||
| -rw-r--r-- | client_test.go | 12 |
2 files changed, 12 insertions, 12 deletions
@@ -56,10 +56,10 @@ func NewClient(opts ClientOptions) (cl *Client, err error) { return cl, nil } -// DisbursementCheckBalance get the current balances. -func (cl *Client) DisbursementCheckBalance() (bal *Balance, err error) { +// CheckBalance get the current balances. +func (cl *Client) CheckBalance() (bal *Balance, err error) { var ( - logp = `DisbursementCheckBalance` + logp = `CheckBalance` req = CreateRequest(cl.opts) httpRes *http.Response @@ -85,10 +85,10 @@ func (cl *Client) DisbursementCheckBalance() (bal *Balance, err error) { return bal, nil } -// DisbursementListBank fetch list of banks for disbursement. -func (cl *Client) DisbursementListBank() (banks []Bank, err error) { +// tListBank fetch list of banks for disbursement. +func (cl *Client) ListBank() (banks []Bank, err error) { var ( - logp = `DisbursementListBank` + logp = `ListBank` req = CreateRequest(cl.opts) res = struct { Data interface{} `json:"Banks"` diff --git a/client_test.go b/client_test.go index e1fdc4d..2e2fd8f 100644 --- a/client_test.go +++ b/client_test.go @@ -10,7 +10,7 @@ import ( "github.com/shuLhan/share/lib/test" ) -func TestClient_DisbursementCheckBalance(t *testing.T) { +func TestClient_CheckBalance(t *testing.T) { var ( tdata *test.Data balance *Balance @@ -24,7 +24,7 @@ func TestClient_DisbursementCheckBalance(t *testing.T) { t.Fatal(err) } - balance, err = testClient.DisbursementCheckBalance() + balance, err = testClient.CheckBalance() if err != nil { t.Fatal(err) } @@ -41,7 +41,7 @@ func TestClient_DisbursementCheckBalance(t *testing.T) { exp = tdata.Output[`response.json`] - test.Assert(t, `DisbursementCheckBalance`, string(exp), string(got)) + test.Assert(t, `CheckBalance`, string(exp), string(got)) } func TestClient_RtolInquiry_live(t *testing.T) { @@ -116,7 +116,7 @@ func TestClient_RtolTransfer_sandbox(t *testing.T) { test.Assert(t, `AccountName`, `Test Account`, inquiryRes.AccountName) } -func TestClient_DisbursementListBank(t *testing.T) { +func TestClient_ListBank(t *testing.T) { var ( tdata *test.Data err error @@ -130,7 +130,7 @@ func TestClient_DisbursementListBank(t *testing.T) { t.Fatal(err) } - banks, err = testClient.DisbursementListBank() + banks, err = testClient.ListBank() if err != nil { t.Fatal(err) } @@ -144,5 +144,5 @@ func TestClient_DisbursementListBank(t *testing.T) { exp = tdata.Output[`response.json`] - test.Assert(t, `DisbursementListBank`, string(exp), string(got)) + test.Assert(t, `ListBank`, string(exp), string(got)) } |
