1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-16 10:38:17 -05:00

Updated code style and PR feedback

This commit is contained in:
Chad Scharf 2020-05-12 17:22:04 -04:00
parent a9a7003bfc
commit a024b43cea
2 changed files with 13 additions and 13 deletions

View File

@ -338,9 +338,9 @@ namespace Bit.Core.Services
var subResponse = await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions() var subResponse = await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions()
{ {
Items = new List<SubscriptionItemOptions>() Items = new List<SubscriptionItemOptions>
{ {
new SubscriptionItemOptions() new SubscriptionItemOptions
{ {
Id = seatItem?.Id, Id = seatItem?.Id,
Plan = plan.StripeSeatPlanId, Plan = plan.StripeSeatPlanId,
@ -361,21 +361,21 @@ namespace Bit.Core.Services
try try
{ {
paymentIntentClientSecret = await (_paymentService as StripePaymentService) paymentIntentClientSecret = await (_paymentService as StripePaymentService)
.PayInvoiceAfterSubscriptionChangeAsync(organization, subResponse?.LatestInvoiceId); .PayInvoiceAfterSubscriptionChangeAsync(organization, subResponse.LatestInvoiceId);
} }
catch catch
{ {
// Need to revert the subscription // Need to revert the subscription
await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions() await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions
{ {
Items = new List<SubscriptionItemOptions>() Items = new List<SubscriptionItemOptions>
{ {
new SubscriptionItemOptions() new SubscriptionItemOptions
{ {
Id = seatItem?.Id, Id = seatItem?.Id,
Plan = plan.StripeSeatPlanId, Plan = plan.StripeSeatPlanId,
Quantity = organization.Seats, 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 // This proration behavior prevents a false "credit" from

View File

@ -709,11 +709,11 @@ namespace Bit.Core.Services
var prorationDate = DateTime.UtcNow; var prorationDate = DateTime.UtcNow;
var storageItem = sub.Items?.FirstOrDefault(i => i.Plan.Id == storagePlanId); 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<SubscriptionItemOptions>() Items = new List<SubscriptionItemOptions>
{ {
new SubscriptionItemOptions() new SubscriptionItemOptions
{ {
Id = storageItem?.Id, Id = storageItem?.Id,
Plan = storagePlanId, Plan = storagePlanId,
@ -739,11 +739,11 @@ namespace Bit.Core.Services
catch catch
{ {
// Need to revert the subscription // Need to revert the subscription
await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions() await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions
{ {
Items = new List<SubscriptionItemOptions>() Items = new List<SubscriptionItemOptions>
{ {
new SubscriptionItemOptions() new SubscriptionItemOptions
{ {
Id = storageItem?.Id, Id = storageItem?.Id,
Plan = storagePlanId, Plan = storagePlanId,