1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00

[PM-8844] Families sponsorship line items bug (#4440)

* Resovled issue where free families line item isn't removed from the Stripe subscription when the sponsorship isn't in the database

* Moved SponsorOrganizationSubscriptionUpdate to Billing namespace
This commit is contained in:
Conner Turnbull 2024-07-15 13:39:28 -04:00 committed by GitHub
parent 60cdf9d3a7
commit 883a2dad17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,7 @@
using Stripe; using Bit.Core.Models.Business;
using Stripe;
namespace Bit.Core.Models.Business; namespace Bit.Core.Billing.Models.Business;
public class SponsorOrganizationSubscriptionUpdate : SubscriptionUpdate public class SponsorOrganizationSubscriptionUpdate : SubscriptionUpdate
{ {
@ -9,10 +10,11 @@ public class SponsorOrganizationSubscriptionUpdate : SubscriptionUpdate
private readonly bool _applySponsorship; private readonly bool _applySponsorship;
protected override List<string> PlanIds => new() { _existingPlanStripeId, _sponsoredPlanStripeId }; protected override List<string> PlanIds => new() { _existingPlanStripeId, _sponsoredPlanStripeId };
public SponsorOrganizationSubscriptionUpdate(StaticStore.Plan existingPlan, StaticStore.SponsoredPlan sponsoredPlan, bool applySponsorship) public SponsorOrganizationSubscriptionUpdate(Core.Models.StaticStore.Plan existingPlan, Core.Models.StaticStore.SponsoredPlan sponsoredPlan, bool applySponsorship)
{ {
_existingPlanStripeId = existingPlan.PasswordManager.StripePlanId; _existingPlanStripeId = existingPlan.PasswordManager.StripePlanId;
_sponsoredPlanStripeId = sponsoredPlan?.StripePlanId; _sponsoredPlanStripeId = sponsoredPlan?.StripePlanId
?? Core.Utilities.StaticStore.SponsoredPlans.FirstOrDefault()?.StripePlanId;
_applySponsorship = applySponsorship; _applySponsorship = applySponsorship;
} }

View File

@ -2,6 +2,7 @@
using Bit.Core.AdminConsole.Entities.Provider; using Bit.Core.AdminConsole.Entities.Provider;
using Bit.Core.Billing.Constants; using Bit.Core.Billing.Constants;
using Bit.Core.Billing.Models; using Bit.Core.Billing.Models;
using Bit.Core.Billing.Models.Business;
using Bit.Core.Entities; using Bit.Core.Entities;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;