Reputation: 467
How does one retrieve a customer's subscription(s) using the Stripe PHP library when the subscription IDs are not already known?
Is there a way to do something like:
$customer = \Stripe\Customer::retrieve($customerId);
$subscription = $customer->subscription;
And the value in $subscription will hold the customer's subscription information.
Thanks,
Mike
Upvotes: 2
Views: 913
Reputation: 5470
You'll want to list the subscriptions, passing a customer id.
\Stripe\Subscription::all(array('customer'=>$customerId,'limit'=>10));
https://stripe.com/docs/api/php#list_subscriptions
Upvotes: 3