diff --git a/src/Core/Services/Implementations/OrganizationService.cs b/src/Core/Services/Implementations/OrganizationService.cs index ac98009f5a..9b62a32e02 100644 --- a/src/Core/Services/Implementations/OrganizationService.cs +++ b/src/Core/Services/Implementations/OrganizationService.cs @@ -338,9 +338,9 @@ namespace Bit.Core.Services var subResponse = await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions() { - Items = new List() + Items = new List { - new SubscriptionItemOptions() + new SubscriptionItemOptions { Id = seatItem?.Id, Plan = plan.StripeSeatPlanId, @@ -361,21 +361,21 @@ namespace Bit.Core.Services try { paymentIntentClientSecret = await (_paymentService as StripePaymentService) - .PayInvoiceAfterSubscriptionChangeAsync(organization, subResponse?.LatestInvoiceId); + .PayInvoiceAfterSubscriptionChangeAsync(organization, subResponse.LatestInvoiceId); } catch { // Need to revert the subscription - await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions() + await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions { - Items = new List() + Items = new List { - new SubscriptionItemOptions() + new SubscriptionItemOptions { Id = seatItem?.Id, Plan = plan.StripeSeatPlanId, Quantity = organization.Seats, - Deleted = (seatItem?.Id == null || organization.Seats == 0) ? true : (bool?)null + Deleted = seatItem?.Id == null ? true : (bool?)null } }, // This proration behavior prevents a false "credit" from diff --git a/src/Core/Services/Implementations/StripePaymentService.cs b/src/Core/Services/Implementations/StripePaymentService.cs index 238b48a102..23539dcaf5 100644 --- a/src/Core/Services/Implementations/StripePaymentService.cs +++ b/src/Core/Services/Implementations/StripePaymentService.cs @@ -709,11 +709,11 @@ namespace Bit.Core.Services var prorationDate = DateTime.UtcNow; var storageItem = sub.Items?.FirstOrDefault(i => i.Plan.Id == storagePlanId); - var subResponse = await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions() + var subResponse = await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions { - Items = new List() + Items = new List { - new SubscriptionItemOptions() + new SubscriptionItemOptions { Id = storageItem?.Id, Plan = storagePlanId, @@ -739,11 +739,11 @@ namespace Bit.Core.Services catch { // Need to revert the subscription - await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions() + await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions { - Items = new List() + Items = new List { - new SubscriptionItemOptions() + new SubscriptionItemOptions { Id = storageItem?.Id, Plan = storagePlanId,