Skip to content

List::get_all() ignores query parameters #193

@phayes

Description

@phayes

For example:

let mut list_subscriptions = stripe::ListSubscriptions::new();
list_subscriptions.created = Some(range);
list_subscriptions.limit = Some(100);
let subs = stripe::Subscription::list(&client, list_subscriptions)?.get_all(&client)?;

If there are more than 100 invoices returned in the first fetch, then get_all() returns all invoices stored in Stripe, ignoring the created range query param.

I'm trying to track down a root cause, but so far the List looks like this:

 &invoices = List {
    data: [...],
    has_more: true,
    total_count: None,
    url: "/v1/invoices",
}

The URL does not properly contain the list_subscriptions.created = Some(range); data. It doesn't have this data because it's simply a deserialized copy of the stripe response, which looks like:

{
  "object": "list",
  "url": "/v1/invoices",
  "has_more": false,
   "data: [...],
}  

So what we probably need is a new method called something like params which allows re-passing in params to re-prime the List with the params.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions