diff --git a/src/Core/Services/Implementations/OrganizationService.cs b/src/Core/Services/Implementations/OrganizationService.cs index 0dcb70f731..9d20e4da0b 100644 --- a/src/Core/Services/Implementations/OrganizationService.cs +++ b/src/Core/Services/Implementations/OrganizationService.cs @@ -336,6 +336,8 @@ namespace Bit.Core.Services var prorationDate = DateTime.UtcNow; var seatItem = sub.Items?.Data?.FirstOrDefault(i => i.Plan.Id == plan.StripeSeatPlanId); + // Retain original collection method + var collectionMethod = sub.CollectionMethod; var subResponse = await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions { @@ -381,17 +383,20 @@ namespace Bit.Core.Services // This proration behavior prevents a false "credit" from // being applied forward to the next month's invoice ProrationBehavior = "none", - CollectionMethod = "charge_automatically", + CollectionMethod = collectionMethod, }); throw; } } // Change back the subscription collection method - await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions + if (collectionMethod != "send_invoice") { - CollectionMethod = "charge_automatically", - }); + await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions + { + CollectionMethod = collectionMethod, + }); + } organization.Seats = (short?)newSeatTotal; await ReplaceAndUpdateCache(organization); diff --git a/src/Core/Services/Implementations/StripePaymentService.cs b/src/Core/Services/Implementations/StripePaymentService.cs index ff92c7d123..383ec1b0dd 100644 --- a/src/Core/Services/Implementations/StripePaymentService.cs +++ b/src/Core/Services/Implementations/StripePaymentService.cs @@ -732,6 +732,8 @@ namespace Bit.Core.Services var prorationDate = DateTime.UtcNow; var storageItem = sub.Items?.FirstOrDefault(i => i.Plan.Id == storagePlanId); + // Retain original collection method + var collectionMethod = sub.CollectionMethod; var subResponse = await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions { @@ -778,17 +780,20 @@ namespace Bit.Core.Services // This proration behavior prevents a false "credit" from // being applied forward to the next month's invoice ProrationBehavior = "none", - CollectionMethod = "charge_automatically", + CollectionMethod = collectionMethod, }); throw; } } // Change back the subscription collection method - await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions + if (collectionMethod != "send_invoice") { - CollectionMethod = "charge_automatically", - }); + await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions + { + CollectionMethod = collectionMethod, + }); + } return paymentIntentClientSecret; }