Conditions | 4 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | package smobilpay |
||
16 | func (service *cashinService) Get(ctx context.Context, serviceID string, options ...RequestOption) ([]*PayItem, *Response, error) { |
||
17 | request, err := service.client.newRequest(ctx, options, http.MethodGet, fmt.Sprintf("/cashin?serviceid=%s", serviceID), nil) |
||
18 | if err != nil { |
||
19 | return nil, nil, err |
||
20 | } |
||
21 | |||
22 | response, err := service.client.do(request) |
||
23 | if err != nil { |
||
24 | return nil, response, err |
||
25 | } |
||
26 | |||
27 | var packages []*PayItem |
||
28 | if err = json.Unmarshal(*response.Body, &packages); err != nil { |
||
29 | return nil, response, err |
||
30 | } |
||
31 | |||
32 | return packages, response, nil |
||
33 | } |
||
34 |