mirror of
https://github.com/bitwarden/server.git
synced 2025-05-20 11:04:31 -05:00
Prevent organization disablement on addition to provider (#5419)
This commit is contained in:
parent
fcb9848180
commit
43be2dbc83
@ -33,13 +33,16 @@ public class SubscriptionDeletedHandler : ISubscriptionDeletedHandler
|
|||||||
var subCanceled = subscription.Status == StripeSubscriptionStatus.Canceled;
|
var subCanceled = subscription.Status == StripeSubscriptionStatus.Canceled;
|
||||||
|
|
||||||
const string providerMigrationCancellationComment = "Cancelled as part of provider migration to Consolidated Billing";
|
const string providerMigrationCancellationComment = "Cancelled as part of provider migration to Consolidated Billing";
|
||||||
|
const string addedToProviderCancellationComment = "Organization was added to Provider";
|
||||||
|
|
||||||
if (!subCanceled)
|
if (!subCanceled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (organizationId.HasValue && subscription is not { CancellationDetails.Comment: providerMigrationCancellationComment })
|
if (organizationId.HasValue &&
|
||||||
|
subscription.CancellationDetails.Comment != providerMigrationCancellationComment &&
|
||||||
|
!subscription.CancellationDetails.Comment.Contains(addedToProviderCancellationComment))
|
||||||
{
|
{
|
||||||
await _organizationService.DisableAsync(organizationId.Value, subscription.CurrentPeriodEnd);
|
await _organizationService.DisableAsync(organizationId.Value, subscription.CurrentPeriodEnd);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user