/** * Returns a list of all currently active subscription levels for a specific Joomla! user ID. The return is an array * of integers, e.g. [1, 2, 5, 8] * * @return array */ public function getGroupsForUser($user_id) { // If we are not logged in we don't have any active subscriptions. if (empty($user_id)) { return []; } $status = \PayplansStatus::SUBSCRIPTION_ACTIVE; // For PayPlans 3.x return \PayplansApi::getUser($user_id)->getPlans($status); }
public static function getPlanName($planid) { include_once JPATH_ROOT . DS . 'components' . DS . 'com_payplans' . DS . 'includes' . DS . 'api.php'; $planInstance = PayplansApi::getPlan($planid); return $planInstance->getTitle(); }