<?php include "include.php"; if (!FastSpring_Helper::is_subscribed($_SESSION["user_id"])) { header("Location: billing.php"); exit; } $subscription_ref = FastSpring_Helper::get_subscription_ref($_SESSION["user_id"]); if (isset($_POST["cancel"])) { try { $cancelSub = $fastspring->cancelSubscription($subscription_ref); } catch (FsprgException $cancelEx) { // die($cancelEx); } } elseif (isset($_POST["renew"])) { try { $fastspring->renewSubscription($subscription_ref); } catch (FsprgException $renewEx) { // Error can be handled here } } elseif (isset($_POST["update"])) { $update = new FsprgSubscriptionUpdate($subscription_ref); if (isset($_POST["productPath"])) { $update->productPath = $_POST["productPath"]; } if (isset($_POST["tags"])) { $update->tags = $_POST["tags"]; } if (isset($_POST["quantity"])) { $update->quantity = $_POST["quantity"]; }
<?php include "include.php"; /** Get the customer's ref */ $user_id = $_SESSION["user_id"]; if (FastSpring_Helper::is_subscribed($user_id)) { $redirectToUrl = "subpage1.php"; header("Location: {$redirectToUrl}"); } else { $redirectToUrl = "select.php"; header("Location: {$redirectToUrl}"); }