aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-11-07 11:05:27 +0700
committerShulhan <ms@kilabit.info>2022-11-07 11:05:27 +0700
commitab25f641e3343151839cf2624d19ef235a070c9d (patch)
tree03e37bbeeb2e0034d066cc92cd7f582ab47ec13f
parentf56f142d9a9b10beac2081695cfbbbff481d4297 (diff)
downloadduitku-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.go12
-rw-r--r--client_test.go12
2 files changed, 12 insertions, 12 deletions
diff --git a/client.go b/client.go
index 4fb1a83..789f8fb 100644
--- a/client.go
+++ b/client.go
@@ -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))
}