Getting status for all subscriptions (limit set as 5).


 

$all = ChargeBee_Subscription::all(array("limit" => 5));
foreach($all as $entry){
  $subscription = $entry->subscription();
  echo  "SubID:" . $subscription->id . " - SubStatus: " . $subscription->status . "<br />";
}

 


Getting the status of a particular subscription:

 

$subscription_id="<replace-with-subscription-id>";
$result = ChargeBee_Subscription::retrieve($subscription_id);
$subscription = $result->subscription();
echo "$subscription->status";