1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-09 20:03:47 -05:00

[AC-2471] Prevent calls to Stripe when unlinking client org has no Stripe objects (#3999)

* Prevent calls to Stripe when unlinking client org has no Stripe objects

* Thomas' feedback

* Check for stripe when org unlinked from org page

---------

Co-authored-by: Conner Turnbull <cturnbull@bitwarden.com>
This commit is contained in:
Alex Morask
2024-05-09 09:20:02 -04:00
committed by GitHub
parent fa7b00a728
commit ac4ccafe19
6 changed files with 103 additions and 13 deletions

View File

@ -22,6 +22,10 @@ public static class BillingExtensions
PlanType: PlanType.TeamsMonthly or PlanType.EnterpriseMonthly
};
public static bool IsStripeEnabled(this Organization organization)
=> !string.IsNullOrEmpty(organization.GatewayCustomerId) &&
!string.IsNullOrEmpty(organization.GatewaySubscriptionId);
public static bool SupportsConsolidatedBilling(this PlanType planType)
=> planType is PlanType.TeamsMonthly or PlanType.EnterpriseMonthly;
}