Browse Source

Remove the feature flag

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
ac-2957-delete-the-feature-flag-PM-5864-dollar-threshold
Cy Okeke 1 year ago
parent
commit
738e308ee4
No known key found for this signature in database
GPG Key ID: 88B341B55C84B45C
  1. 1
      src/Core/Constants.cs
  2. 7
      src/Core/Services/Implementations/StripePaymentService.cs

1
src/Core/Constants.cs

@ -108,7 +108,6 @@ public static class FeatureFlagKeys
public const string ItemShare = "item-share"; public const string ItemShare = "item-share";
public const string KeyRotationImprovements = "key-rotation-improvements"; public const string KeyRotationImprovements = "key-rotation-improvements";
public const string DuoRedirect = "duo-redirect"; public const string DuoRedirect = "duo-redirect";
public const string PM5864DollarThreshold = "PM-5864-dollar-threshold";
public const string ShowPaymentMethodWarningBanners = "show-payment-method-warning-banners"; public const string ShowPaymentMethodWarningBanners = "show-payment-method-warning-banners";
public const string AC2101UpdateTrialInitiationEmail = "AC-2101-update-trial-initiation-email"; public const string AC2101UpdateTrialInitiationEmail = "AC-2101-update-trial-initiation-email";
public const string EnableConsolidatedBilling = "enable-consolidated-billing"; public const string EnableConsolidatedBilling = "enable-consolidated-billing";

7
src/Core/Services/Implementations/StripePaymentService.cs

@ -715,19 +715,18 @@ public class StripePaymentService : IPaymentService
var daysUntilDue = sub.DaysUntilDue; var daysUntilDue = sub.DaysUntilDue;
var chargeNow = collectionMethod == "charge_automatically"; var chargeNow = collectionMethod == "charge_automatically";
var updatedItemOptions = subscriptionUpdate.UpgradeItemsOptions(sub); var updatedItemOptions = subscriptionUpdate.UpgradeItemsOptions(sub);
var isPm5864DollarThresholdEnabled = _featureService.IsEnabled(FeatureFlagKeys.PM5864DollarThreshold);
var isAnnualPlan = sub?.Items?.Data.FirstOrDefault()?.Plan?.Interval == "year"; var isAnnualPlan = sub?.Items?.Data.FirstOrDefault()?.Plan?.Interval == "year";
var subUpdateOptions = new SubscriptionUpdateOptions var subUpdateOptions = new SubscriptionUpdateOptions
{ {
Items = updatedItemOptions, Items = updatedItemOptions,
ProrationBehavior = !isPm5864DollarThresholdEnabled || invoiceNow ProrationBehavior = invoiceNow
? Constants.AlwaysInvoice ? Constants.AlwaysInvoice
: Constants.CreateProrations, : Constants.CreateProrations,
DaysUntilDue = daysUntilDue ?? 1, DaysUntilDue = daysUntilDue ?? 1,
CollectionMethod = "send_invoice" CollectionMethod = "send_invoice"
}; };
if (!invoiceNow && isAnnualPlan && isPm5864DollarThresholdEnabled && sub.Status.Trim() != "trialing") if (!invoiceNow && isAnnualPlan && sub.Status.Trim() != "trialing")
{ {
subUpdateOptions.PendingInvoiceItemInterval = subUpdateOptions.PendingInvoiceItemInterval =
new SubscriptionPendingInvoiceItemIntervalOptions { Interval = "month" }; new SubscriptionPendingInvoiceItemIntervalOptions { Interval = "month" };
@ -761,7 +760,7 @@ public class StripePaymentService : IPaymentService
{ {
try try
{ {
if (!isPm5864DollarThresholdEnabled && !invoiceNow) if (!invoiceNow)
{ {
if (chargeNow) if (chargeNow)
{ {

Loading…
Cancel
Save