From a024b43cea6afe17204702cf9aa2f15bc83a0e40 Mon Sep 17 00:00:00 2001 From: Chad Scharf <3904944+cscharf@users.noreply.github.com> Date: Tue, 12 May 2020 17:22:04 -0400 Subject: [PATCH] Updated code style and PR feedback --- .../Implementations/OrganizationService.cs | 14 +++++++------- .../Implementations/StripePaymentService.cs | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) 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,