func (c Client) List(params *stripe.InvoiceListParams) *Iter { var body *stripe.RequestValues var lp *stripe.ListParams var p *stripe.Params if params != nil { body = &stripe.RequestValues{} if len(params.Customer) > 0 { body.Add("customer", params.Customer) } if params.Date > 0 { body.Add("date", strconv.FormatInt(params.Date, 10)) } params.AppendTo(body) lp = ¶ms.ListParams p = params.ToParams() } return &Iter{stripe.GetIter(lp, body, func(b *stripe.RequestValues) ([]interface{}, stripe.ListMeta, error) { list := &stripe.InvoiceList{} err := c.B.Call("GET", "/invoices", c.Key, b, p, list) ret := make([]interface{}, len(list.Values)) for i, v := range list.Values { ret[i] = v } return ret, list.ListMeta, err })} }
func (c Client) List(params *stripe.InvoiceListParams) *Iter { type invoiceList struct { stripe.ListMeta Values []*stripe.Invoice `json:"data"` } var body *url.Values var lp *stripe.ListParams if params != nil { body = &url.Values{} if len(params.Customer) > 0 { body.Add("customer", params.Customer) } if params.Date > 0 { body.Add("date", strconv.FormatInt(params.Date, 10)) } params.AppendTo(body) lp = ¶ms.ListParams } return &Iter{stripe.GetIter(lp, body, func(b url.Values) ([]interface{}, stripe.ListMeta, error) { list := &invoiceList{} err := c.B.Call("GET", "/invoices", c.Key, &b, nil, list) ret := make([]interface{}, len(list.Values)) for i, v := range list.Values { ret[i] = v } return ret, list.ListMeta, err })} }