add debug log

This commit is contained in:
Sinh 2022-09-05 14:33:39 +07:00
parent bc3db15466
commit f9046088ea
2 changed files with 4 additions and 4 deletions

View File

@ -121,7 +121,7 @@ func (c *Client) CreateOrder(p CreateOrderPayload) (*CreateOrderResponseDecoded,
}
info, err := res.DecodeCreateOrderSuccess()
if err != nil {
log.Println("globalcare.Client.CreateOrder - DecodeCreateOrderSuccess err:", err)
log.Println("globalcare.Client.CreateOrder - DecodeCreateOrderSuccess err:", err, string(msg.Data))
return nil, err
}

View File

@ -10,19 +10,19 @@ type CommonResponse struct {
// DecodeCreateOrderSuccess ...
func (r *CommonResponse) DecodeCreateOrderSuccess() (res CreateOrderResponseDecoded, err error) {
err = r.Decode(res)
err = r.Decode(&res)
return res, err
}
// DecodeGetOrderSuccess ...
func (r *CommonResponse) DecodeGetOrderSuccess() (res GetOrderResponseDecoded, err error) {
err = r.Decode(res)
err = r.Decode(&res)
return res, err
}
// DecodeError ...
func (r *CommonResponse) DecodeError() (res ResponseError, err error) {
err = r.Decode(res)
err = r.Decode(&res)
return res, err
}