+ + +
+

Subscription Management

+ @if (@Model.Subscriber.Customer.ExternalRef is not null) + { + Customer Reference: @Model.Subscriber.Customer.ExternalRef + } +
+ + +
+
+ Current Subscription +
+
+
+
+
+ @Model.Subscriber.Plan.Name + @if (Model.Subscriber.Phase == SubscriberData.PhaseTypes.Trial) + { + Trial + } + else if (Model.Subscriber.Phase == SubscriberData.PhaseTypes.Grace) + { + Grace + } +
+ @if (Model.Subscriber.Plan.Description is not null) + { +

@Model.Subscriber.Plan.Description

+ } + +
+ + @if (!string.IsNullOrEmpty(date)) + { + @if (Model.Subscriber.Phase is SubscriberData.PhaseTypes.Normal) + { + Next billing: @date + } + else if (Model.Subscriber.Phase is SubscriberData.PhaseTypes.Trial) + { + Trial expires: @date + } + else if (Model.Subscriber.Phase is SubscriberData.PhaseTypes.Grace) + { + The subscription has already expired and will soon be inactivated + } + } +
+
+ @if (Model.Subscriber.Plan.RecurringType != PlanData.RecurringInterval.Lifetime) + { +
+

@DisplayFormatter.Currency(Model.Plan.Price, Model.Plan.Currency, DisplayFormatter.CurrencyFormat.Symbol)

+

@RecurringToString(Model.Plan.RecurringType)

+
+ } +
+
+
+ + @if (Model.Subscriber.IsSuspended) + { +
+
+ +
+
Access suspended
+

Your access to this subscription has been suspended.

+ @if (!String.IsNullOrEmpty(Model.Subscriber.SuspensionReason)) + { +

Reason: @Model.Subscriber.SuspensionReason

+ } +
+
+
+ } + else if (Model.Subscriber.Phase == SubscriberData.PhaseTypes.Expired) + { +
+
+ +
+
Access expired
+

Your access to this subscription has been expired.

+
+
+ +
+ } + else if (Model.Subscriber.Phase == SubscriberData.PhaseTypes.Trial) + { +
+
+ +
+
You are in trial
+

You access will be revoked in @FormatDays(daysRemaining)

+
+
+ +
+ } + else if (Model.Subscriber.GetReminderDate() is { } reminderDate2 && + reminderDate2 < DateTimeOffset.UtcNow && + !Model.Subscriber.IsNextPlanRenewable) + { +
+
+ +
+
Upgrade needed in @FormatDays(daysRemaining)
+
You access will be revoked in @FormatDays(daysRemaining), you need to subscribe to a new plan.
+
+
+ +
+ } + else if (Model.Subscriber.GetReminderDate() is { } reminderDate && + reminderDate < DateTimeOffset.UtcNow && + Model.Subscriber.MissingCredit() != 0) + { + @if (daysRemaining == 0) + { +
+
+ +
+
Payment due
+
You access will be revoked in @FormatDays(graceRemaining)
+
+
+ +
+ } + else + { +
+
+ +
+
Payment due in @FormatDays(daysRemaining)
+

Next billing + date: @date • @DisplayFormatter.Currency(Model.Subscriber.Plan.Price, Model.Subscriber.Plan.Currency, DisplayFormatter.CurrencyFormat.Symbol)

+
+
+ +
+ } + } + +
+
+ Billing Information +
+
+
+
+
Payment Method
+
+
+ Credit balance + @creditBalance +
+ +
+
+
+
+ + +
+ +
+
+ @if (Model.Subscriber.Plan.RecurringType is not PlanData.RecurringInterval.Lifetime) + { +
+
+
Plan price
+
@DisplayFormatter.Currency(Model.Subscriber.Plan.Price, Model.Subscriber.Plan.Currency, DisplayFormatter.CurrencyFormat.Symbol)
+
+
+
Credit applied
+
+ - @DisplayFormatter.Currency(Model.Credit.CreditApplied, Model.Credit.Currency, DisplayFormatter.CurrencyFormat.Symbol)
+
+
+
Next charge on @date
+
@DisplayFormatter.Currency(Model.Credit.NextCharge, Model.Credit.Currency, DisplayFormatter.CurrencyFormat.Symbol)
+
+
+ + + +
+ } +
+ @if (Model.Subscriber.Plan.RecurringType is not PlanData.RecurringInterval.Lifetime) + { +
+
Notification
+

+ @foreach (var identity in Model.Subscriber.Customer.CustomerIdentities) + { + + } +

+

Payment reminder will be sent @Model.Subscriber.PaymentReminderDaysOrDefault days before + expiration.

+
+ } +
+
+
+ + @if (Model.Plan.PlanChanges.Any()) + { + +
+
+ Plan Management +
+
+
+ @foreach (var batch in Model.PlanChanges.Batch(3)) + { +
+ @foreach (var plan in batch) + { + if (plan.Current) + { +
+
+
@plan.Name
+

@DisplayFormatter.Currency(plan.Price, plan.Currency, DisplayFormatter.CurrencyFormat.Symbol) @RecurringToString(plan.RecurringType)

+ Current +
+
+ } + else + { +
+
@plan.Name
+

@DisplayFormatter.Currency(plan.Price, plan.Currency, DisplayFormatter.CurrencyFormat.Symbol) @RecurringToString(plan.RecurringType)

+ + + @if (plan.ChangeType == PlanChangeData.ChangeType.Upgrade) + { + + Upgrade + + } + else + { + + Downgrade + + } + +
+ } + } +
+ } +
+
+
+ } + + @if (Model.Transactions.Count != 0) + { +
+
+ History +
+
+
+ + + + + + + + + + + @foreach (var tx in Model.Transactions) + { + var color = tx.Amount >= 0 ? "text-success" : "text-danger"; + + + + + + + } + +
DateDescriptionAmountTotal Balance
@tx.Date.ToString("D")@tx.Description + @DisplayFormatter.Currency(tx.Amount, currency, DisplayFormatter.CurrencyFormat.Symbol) + + @DisplayFormatter.Currency(tx.TotalBalance, currency, DisplayFormatter.CurrencyFormat.Symbol) +
+
+
+
+ } + + + + +