func (c Client) List(params *stripe.DisputeListParams) *Iter { type disputeList struct { stripe.ListMeta Values []*stripe.Dispute `json:"data"` } var body *url.Values var lp *stripe.ListParams if params != nil { body = &url.Values{} params.AppendTo(body) lp = ¶ms.ListParams } return &Iter{stripe.GetIter(lp, body, func(b url.Values) ([]interface{}, stripe.ListMeta, error) { list := &disputeList{} err := c.B.Call("GET", "/disputes", 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 })} }
func (s Client) List(params *stripe.SourceListParams) *Iter { body := &url.Values{} var lp *stripe.ListParams params.AppendTo(body) lp = ¶ms.ListParams return &Iter{stripe.GetIter(lp, body, func(b url.Values) ([]interface{}, stripe.ListMeta, error) { list := &stripe.SourceList{} var err error if len(params.Customer) > 0 { err = s.B.Call("GET", fmt.Sprintf("/customers/%v/sources", params.Customer), s.Key, &b, nil, list) } else { err = errors.New("Invalid source params: customer needs to be set") } 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.FileUploadListParams) *Iter { type fileUploadList struct { stripe.ListMeta Values []*stripe.FileUpload `json:"data"` } var body *url.Values var lp *stripe.ListParams if params != nil { body = &url.Values{} if len(params.Purpose) > 0 { body.Add("purpose", string(params.Purpose)) } params.AppendTo(body) lp = ¶ms.ListParams } return &Iter{stripe.GetIter(lp, body, func(b url.Values) ([]interface{}, stripe.ListMeta, error) { list := &fileUploadList{} err := c.B.Call("GET", "/files", 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 })} }
func (c Client) List(params *stripe.BitcoinReceiverListParams) *Iter { type receiverList struct { stripe.ListMeta Values []*stripe.BitcoinReceiver `json:"data"` } var body *url.Values var lp *stripe.ListParams if params != nil { body = &url.Values{} body.Add("filled", strconv.FormatBool(!params.NotFilled)) body.Add("active", strconv.FormatBool(!params.NotActive)) body.Add("uncaptured_funds", strconv.FormatBool(params.Uncaptured)) params.AppendTo(body) lp = ¶ms.ListParams } return &Iter{stripe.GetIter(lp, body, func(b url.Values) ([]interface{}, stripe.ListMeta, error) { list := &receiverList{} err := c.B.Call("GET", "/bitcoin/receivers", 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 })} }
func (c Client) List(params *stripe.BitcoinTransactionListParams) *Iter { type receiverList struct { stripe.ListMeta Values []*stripe.BitcoinTransaction `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) } params.AppendTo(body) lp = ¶ms.ListParams } return &Iter{stripe.GetIter(lp, body, func(b url.Values) ([]interface{}, stripe.ListMeta, error) { list := &receiverList{} err := c.B.Call("GET", fmt.Sprintf("/bitcoin/receivers/%v/transactions", params.Receiver), 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 })} }
func (c Client) ListLines(params *stripe.InvoiceLineListParams) *LineIter { body := &url.Values{} var lp *stripe.ListParams if len(params.Customer) > 0 { body.Add("customer", params.Customer) } if len(params.Sub) > 0 { body.Add("subscription", params.Sub) } params.AppendTo(body) lp = ¶ms.ListParams return &LineIter{stripe.GetIter(lp, body, func(b url.Values) ([]interface{}, stripe.ListMeta, error) { list := &stripe.InvoiceLineList{} err := c.B.Call("GET", fmt.Sprintf("/invoices/%v/lines", params.ID), 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 })} }
func (c Client) List(params *stripe.CardListParams) *Iter { body := &url.Values{} var lp *stripe.ListParams params.AppendTo(body) lp = ¶ms.ListParams return &Iter{stripe.GetIter(lp, body, func(b url.Values) ([]interface{}, stripe.ListMeta, error) { list := &stripe.CardList{} var err error if len(params.Customer) > 0 { err = c.B.Call("GET", fmt.Sprintf("/customers/%v/cards", params.Customer), c.Key, &b, nil, list) } else if len(params.Recipient) > 0 { err = c.B.Call("GET", fmt.Sprintf("/recipients/%v/cards", params.Recipient), c.Key, &b, nil, list) } else { err = errors.New("Invalid card params: either customer or recipient need to be set") } 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.CustomerListParams) *Iter { type customerList struct { stripe.ListMeta Values []*stripe.Customer `json:"data"` } var body *url.Values var lp *stripe.ListParams if params != nil { body = &url.Values{} if params.Created > 0 { body.Add("created", strconv.FormatInt(params.Created, 10)) } params.AppendTo(body) lp = ¶ms.ListParams } return &Iter{stripe.GetIter(lp, body, func(b url.Values) ([]interface{}, stripe.ListMeta, error) { list := &customerList{} err := c.B.Call("GET", "/customers", 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 })} }
func (c Client) List(params *stripe.TxListParams) *Iter { var body *url.Values var lp *stripe.ListParams if params != nil { body = &url.Values{} if params.Created > 0 { body.Add("created", strconv.FormatInt(params.Created, 10)) } if params.Available > 0 { body.Add("available_on", strconv.FormatInt(params.Available, 10)) } if len(params.Currency) > 0 { body.Add("currency", params.Currency) } if len(params.Src) > 0 { body.Add("source", params.Src) } if len(params.Transfer) > 0 { body.Add("transfer", params.Transfer) } if len(params.Type) > 0 { body.Add("type", string(params.Type)) } params.AppendTo(body) lp = ¶ms.ListParams } return &Iter{stripe.GetIter(lp, body, func(b url.Values) ([]interface{}, stripe.ListMeta, error) { type transactionList struct { stripe.ListMeta Values []*stripe.Transaction `json:"data"` } list := &transactionList{} err := c.B.Call("GET", "/balance/history", 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 })} }
func (c Client) List(params *stripe.BankAccountListParams) *Iter { body := &url.Values{} var lp *stripe.ListParams params.AppendTo(body) lp = ¶ms.ListParams return &Iter{stripe.GetIter(lp, body, func(b url.Values) ([]interface{}, stripe.ListMeta, error) { list := &stripe.BankAccountList{} err := c.B.Call("GET", fmt.Sprintf("/accounts/%v/bank_accounts", params.AccountID), 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 })} }