-
Notifications
You must be signed in to change notification settings - Fork 43
/
settlement.go
26 lines (22 loc) · 890 Bytes
/
settlement.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package paystack
// SettlementService handles operations related to the settlement
// For more details see https://developers.paystack.co/v1.0/reference#create-settlement
type SettlementService service
// SettlementList is a list object for settlements.
type SettlementList struct {
Meta ListMeta
Values []Response `json:"data,omitempty"`
}
// List returns a list of settlements.
// For more details see https://developers.paystack.co/v1.0/reference#settlements
func (s *SettlementService) List() (*SettlementList, error) {
return s.ListN(10, 0)
}
// ListN returns a list of settlements
// For more details see https://developers.paystack.co/v1.0/reference#settlements
func (s *SettlementService) ListN(count, offset int) (*SettlementList, error) {
u := paginateURL("/settlement", count, offset)
pg := &SettlementList{}
err := s.client.Call("GET", u, nil, pg)
return pg, err
}