aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryogi sofiharja <hardja.ogie@gmail.com>2023-07-06 10:52:05 +0700
committerShulhan <ms@kilabit.info>2023-07-06 13:27:33 +0700
commit1ec4c69017704b76b2a45210c132ac91f6f83be7 (patch)
tree3a01bef013b758c57cffa44a0831dfbbcfa3ac3f
parent4065a6c41d972b4bf800d1ac8df4c5cf89687719 (diff)
downloadduitku-1ec4c69017704b76b2a45210c132ac91f6f83be7.tar.xz
client: return response from duitku even if the code is not success (00)
It allow the client to show error that comes from duitku
-rw-r--r--client.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/client.go b/client.go
index d50fc45..169d955 100644
--- a/client.go
+++ b/client.go
@@ -93,9 +93,6 @@ func (cl *Client) CheckBalance() (bal *Balance, err error) {
if err != nil {
return nil, fmt.Errorf(`%s: %s`, logp, err)
}
- if bal.Code != ResCodeSuccess {
- return nil, fmt.Errorf(`%s: %s: %s`, logp, bal.Code, bal.Desc)
- }
return bal, nil
}
@@ -131,9 +128,6 @@ func (cl *Client) ClearingInquiry(req *ClearingInquiry) (res *ClearingInquiryRes
if err != nil {
return nil, fmt.Errorf(`%s: %w`, logp, err)
}
- if res.Code != ResCodeSuccess {
- return nil, fmt.Errorf(`%s: %s: %s`, logp, res.Code, res.Desc)
- }
return res, nil
}
@@ -400,9 +394,6 @@ func (cl *Client) RtolInquiry(req *RtolInquiry) (res *RtolInquiryResponse, err e
if err != nil {
return nil, fmt.Errorf(`%s: %w`, logp, err)
}
- if res.Code != ResCodeSuccess {
- return nil, fmt.Errorf(`%s: %s: %s`, logp, res.Code, res.Desc)
- }
return res, nil
}