mirror of
https://github.com/bitwarden/server.git
synced 2025-01-19 21:21:22 +01:00
[PM-12765] Display error when attempting to autoscale canceled subscription (#5132)
This commit is contained in:
parent
4730d2dab7
commit
fe70db3e87
@ -14,6 +14,7 @@ using Bit.Core.Auth.Models.Business;
|
|||||||
using Bit.Core.Auth.Models.Business.Tokenables;
|
using Bit.Core.Auth.Models.Business.Tokenables;
|
||||||
using Bit.Core.Auth.Repositories;
|
using Bit.Core.Auth.Repositories;
|
||||||
using Bit.Core.Auth.UserFeatures.TwoFactorAuth.Interfaces;
|
using Bit.Core.Auth.UserFeatures.TwoFactorAuth.Interfaces;
|
||||||
|
using Bit.Core.Billing.Constants;
|
||||||
using Bit.Core.Billing.Enums;
|
using Bit.Core.Billing.Enums;
|
||||||
using Bit.Core.Billing.Extensions;
|
using Bit.Core.Billing.Extensions;
|
||||||
using Bit.Core.Billing.Services;
|
using Bit.Core.Billing.Services;
|
||||||
@ -1324,6 +1325,12 @@ public class OrganizationService : IOrganizationService
|
|||||||
return (false, $"Seat limit has been reached.");
|
return (false, $"Seat limit has been reached.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var subscription = await _paymentService.GetSubscriptionAsync(organization);
|
||||||
|
if (subscription?.Subscription?.Status == StripeConstants.SubscriptionStatus.Canceled)
|
||||||
|
{
|
||||||
|
return (false, "Cannot autoscale with a canceled subscription.");
|
||||||
|
}
|
||||||
|
|
||||||
return (true, failureReason);
|
return (true, failureReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user