diff options
| author | Shulhan <ms@kilabit.info> | 2023-03-17 13:57:34 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-03-17 13:57:34 +0700 |
| commit | 548c92ff835de375e2b35add255bd4bf77a3e632 (patch) | |
| tree | ae5e4557904dd0a59f690431dc25f0be14e102d7 /client.go | |
| parent | 3d29a1cf144c785c8a210c1e85061968446b2433 (diff) | |
| download | duitku-548c92ff835de375e2b35add255bd4bf77a3e632.tar.xz | |
all: change the MerchantTxStatus parameter to struct
The idea is to allow the caller to know the Signature of request after
call to MerchantTxStatus and possibly log the whole request.
While at it, we change the method name to MerchantPaymentStatus and
the type from transactionStatus to PaymentStatus, and from
TxStatusResponse to PaymentStatusResponse.
Diffstat (limited to 'client.go')
| -rw-r--r-- | client.go | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -322,24 +322,21 @@ func (cl *Client) MerchantPaymentMethod(req *PaymentMethod) (resp *PaymentMethod return resp, nil } -// [MerchantTxStatus] get the status of payment from customer. +// [MerchantPaymentStatus] get the status of payment from customer. // -// [MerchantTxStatus]: https://docs.duitku.com/api/en/#check-transaction -func (cl *Client) MerchantTxStatus(orderID, paymentMethod string) (resp *TxStatusResponse, err error) { +// [MerchantPaymentStatus]: https://docs.duitku.com/api/en/#check-transaction +func (cl *Client) MerchantPaymentStatus(req *PaymentStatus) (resp *PaymentStatusResponse, err error) { var ( - logp = `MerchantTxStatus` - req = transactionStatus{ - OrderID: orderID, - } + logp = `MerchantPaymentStatus` params url.Values httpRes *http.Response resBody []byte ) - req.sign(cl.opts, paymentMethod) + req.sign(cl.opts) - params, err = libhttp.MarshalForm(req) + params, err = libhttp.MarshalForm(*req) if err != nil { return nil, fmt.Errorf(`%s: %w`, logp, err) } |
