Conditions | 4 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | package smobilpay |
||
24 | func (service *billService) Get(ctx context.Context, params *BillGetParams, options ...RequestOption) ([]*Bill, *Response, error) { |
||
25 | request, err := service.client.newRequest(ctx, options, http.MethodGet, fmt.Sprintf("/bill?serviceid=%s&merchant=%s&serviceNumber=%s", params.ServiceID, params.Merchant, params.ServiceNumber), nil) |
||
26 | if err != nil { |
||
27 | return nil, nil, err |
||
28 | } |
||
29 | |||
30 | response, err := service.client.do(request) |
||
31 | if err != nil { |
||
32 | return nil, response, err |
||
33 | } |
||
34 | |||
35 | var bills []*Bill |
||
36 | if err = json.Unmarshal(*response.Body, &bills); err != nil { |
||
37 | return nil, response, err |
||
38 | } |
||
39 | |||
40 | return bills, response, nil |
||
41 | } |
||
42 |