Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to filter an account's subscriptions #140

Closed
cgerrior opened this issue Feb 26, 2015 · 1 comment
Closed

Unable to filter an account's subscriptions #140

cgerrior opened this issue Feb 26, 2015 · 1 comment
Labels
V2 V2 Client

Comments

@cgerrior
Copy link

There is no method for the Recurly_SubscriptionList class that allows you to filter an account's subscriptions based on "state" (active, expired, future).

@drewish
Copy link

drewish commented Feb 26, 2015

So it looks like it's there but not necessarily obvious:

$list = Recurly_SubscriptionList::getForAccount('ACCOUNT_CODE', array('state' => 'active'));
foreach ($list as $sub) {
  var_dump($sub->getValues());
}

For reference here's all the values of state:

  • active
  • canceled
  • expired
  • future
  • in_trial
  • live
  • past_due

My preference would have been to expose it on the Recurly_Account object, something like:

$list = Recurly_Account::get('ACCOUNT_CODE')->subscriptions(array('state' => 'active'));

But the subscriptions name is used by the stub meaning you can only fetch the unfiltered list of subscriptions:

$list = Recurly_Account::get('ACCOUNT_CODE')->subscriptions->get();

@bhelx bhelx added the V2 V2 Client label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V2 V2 Client
Projects
None yet
Development

No branches or pull requests

3 participants