mirror of
https://github.com/bitwarden/server
synced 2026-02-21 11:53:42 +00:00
[PM-29089] Remove FF: pm-26793-fetch-premium-price-from-pricing-service - Logic (#6989)
* refactor: [PM-39087] remove PM-26793 feature flag from PricingClient * test: add ListPremiumPlans and GetAvailablePremiumPlan coverage to PricingClientTests
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System.Net;
|
||||
using System.Net.Http.Json;
|
||||
using Bit.Core.Billing.Constants;
|
||||
using Bit.Core.Billing.Enums;
|
||||
using Bit.Core.Billing.Pricing.Organizations;
|
||||
using Bit.Core.Exceptions;
|
||||
@@ -12,7 +11,6 @@ namespace Bit.Core.Billing.Pricing;
|
||||
|
||||
using OrganizationPlan = Bit.Core.Models.StaticStore.Plan;
|
||||
using PremiumPlan = Premium.Plan;
|
||||
using Purchasable = Premium.Purchasable;
|
||||
|
||||
public class PricingClient(
|
||||
IFeatureService featureService,
|
||||
@@ -99,14 +97,6 @@ public class PricingClient(
|
||||
return [];
|
||||
}
|
||||
|
||||
var fetchPremiumPriceFromPricingService =
|
||||
featureService.IsEnabled(FeatureFlagKeys.PM26793_FetchPremiumPriceFromPricingService);
|
||||
|
||||
if (!fetchPremiumPriceFromPricingService)
|
||||
{
|
||||
return [CurrentPremiumPlan];
|
||||
}
|
||||
|
||||
var response = await httpClient.GetAsync("plans/premium");
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
@@ -164,12 +154,4 @@ public class PricingClient(
|
||||
return plan;
|
||||
}
|
||||
|
||||
private static PremiumPlan CurrentPremiumPlan => new()
|
||||
{
|
||||
Name = "Premium",
|
||||
Available = true,
|
||||
LegacyYear = null,
|
||||
Seat = new Purchasable { Price = 10M, StripePriceId = StripeConstants.Prices.PremiumAnnually },
|
||||
Storage = new Purchasable { Price = 4M, StripePriceId = StripeConstants.Prices.StoragePlanPersonal, Provided = 1 }
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user