diff --git a/src/Billing/Startup.cs b/src/Billing/Startup.cs index ec4cefe40b..5007536ff6 100644 --- a/src/Billing/Startup.cs +++ b/src/Billing/Startup.cs @@ -50,6 +50,9 @@ namespace Bit.Billing // Repositories services.AddSqlServerRepositories(); + // Context + services.AddScoped(); + // Services services.AddBaseServices(); services.AddDefaultServices(); diff --git a/src/Core/Models/StaticStore/Plan.cs b/src/Core/Models/StaticStore/Plan.cs index 08e5bc7bce..1b81e09dc5 100644 --- a/src/Core/Models/StaticStore/Plan.cs +++ b/src/Core/Models/StaticStore/Plan.cs @@ -16,5 +16,6 @@ namespace Bit.Core.Models.StaticStore public short? MaxSubvaults { get; set; } public int UpgradeSortOrder { get; set; } public bool Disabled { get; set; } + public int? TrialPeriodDays { get; set; } } } diff --git a/src/Core/Services/Implementations/OrganizationService.cs b/src/Core/Services/Implementations/OrganizationService.cs index cb6057ac6b..378beaad9c 100644 --- a/src/Core/Services/Implementations/OrganizationService.cs +++ b/src/Core/Services/Implementations/OrganizationService.cs @@ -287,6 +287,7 @@ namespace Bit.Core.Services // They must have been on a free plan. Create new sub. var subCreateOptions = new StripeSubscriptionCreateOptions { + TrialPeriodDays = newPlan.TrialPeriodDays, Items = new List { new StripeSubscriptionItemOption @@ -504,6 +505,7 @@ namespace Bit.Core.Services var subCreateOptions = new StripeSubscriptionCreateOptions { + TrialPeriodDays = plan.TrialPeriodDays, Items = new List { new StripeSubscriptionItemOption diff --git a/src/Core/Utilities/StaticStore.cs b/src/Core/Utilities/StaticStore.cs index 588e69c5f9..82b0f6b24d 100644 --- a/src/Core/Utilities/StaticStore.cs +++ b/src/Core/Utilities/StaticStore.cs @@ -111,7 +111,8 @@ namespace Bit.Core.Utilities Name = "Personal", StripePlanId = "personal-org-annually", StripeSeatPlanId = "personal-org-seat-annually", - UpgradeSortOrder = 1 + UpgradeSortOrder = 1, + TrialPeriodDays = 7 }, new Plan { @@ -123,7 +124,8 @@ namespace Bit.Core.Utilities Name = "Teams (Monthly)", StripePlanId = "teams-org-monthly", StripeSeatPlanId = "teams-org-seat-monthly", - UpgradeSortOrder = 2 + UpgradeSortOrder = 2, + TrialPeriodDays = 7 }, new Plan { @@ -135,7 +137,8 @@ namespace Bit.Core.Utilities Name = "Teams (Annually)", StripePlanId = "teams-org-annually", StripeSeatPlanId = "teams-org-seat-annually", - UpgradeSortOrder = 2 + UpgradeSortOrder = 2, + TrialPeriodDays = 7 } };