From 1ec4c69017704b76b2a45210c132ac91f6f83be7 Mon Sep 17 00:00:00 2001 From: yogi sofiharja Date: Thu, 6 Jul 2023 10:52:05 +0700 Subject: client: return response from duitku even if the code is not success (00) It allow the client to show error that comes from duitku --- client.go | 9 --------- 1 file changed, 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 } -- cgit v1.3