cancelSubscriptions($_GET['subscription_tid']); _error_log('listSubscription::cancel subscritpion canceled ' . json_encode($response)); if (!empty($_REQUEST['plans_id']) && !empty($_REQUEST['users_id'])) { $row = SubscriptionTable::getSubscription($_REQUEST['users_id'], $_REQUEST['plans_id']); if (!empty($response)) { SubscriptionTable::updateStripeCostumerId($row['id'], "canceled"); } } else { _error_log('listSubscription::cancel plans_id or user not found'); } } ?> <?php echo __("Stripe Subscription") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?>
getAllSubscriptions(); foreach ($subs->data as $value) { $users_id = $value->metadata->users_id; $plans_id = $value->metadata->plans_id; $title = ""; $body = ""; $buttonClass = "danger"; if (!empty($users_id)) { $user = new User($users_id); if (!empty($user)) { $title .= $user->getName() . " (" . $user->getEmail() . ")"; } } else { $title .= "User ID Not found"; } if (AVideoPlugin::isEnabledByName("Subscription")) { if (!empty($plans_id)) { $plan = new SubscriptionPlansTable($plans_id); if (!empty($plan)) { $title .= " [" . $plan->getName() . "]"; $row = SubscriptionTable::getSubscription($users_id, $plans_id); if (!empty($row)) { $buttonClass = "success"; } } } else { $title .= " [Plan ID Not found]"; } } $body .= "Created in: " . date("Y-m-d", $value->created); foreach ($value->items->data as $value2) { $body .= "
Plan: " . $value2->plan->nickname; $body .= "
Value: " . StripeYPT::addDot($value2->plan->amount) . " " . $value2->plan->currency; $body .= "
Interval: each " . $value2->plan->interval_count . " " . $value2->plan->interval; } ?>
getAllSubscriptions('trialing'); foreach ($subs->data as $value) { $users_id = $value->metadata->users_id; $plans_id = $value->metadata->plans_id; $title = ""; $body = ""; $buttonClass = "danger"; if (!empty($users_id)) { $user = new User($users_id); if (!empty($user)) { $title .= $user->getName() . " (" . $user->getEmail() . ")"; } } else { $title .= "User ID Not found"; } if (AVideoPlugin::isEnabledByName("Subscription")) { if (!empty($plans_id)) { $plan = new SubscriptionPlansTable($plans_id); if (!empty($plan)) { $title .= " [" . $plan->getName() . "]"; $row = SubscriptionTable::getSubscription($users_id, $plans_id); if (!empty($row)) { $buttonClass = "success"; } } } else { $title .= " [Plan ID Not found]"; } } $body .= "Created in: " . date("Y-m-d", $value->created); foreach ($value->items->data as $value2) { $body .= "
Plan: " . $value2->plan->nickname; $body .= "
Value: " . StripeYPT::addDot($value2->plan->amount) . " " . $value2->plan->currency; $body .= "
Interval: each " . $value2->plan->interval_count . " " . $value2->plan->interval; } ?>