mirror of
https://github.com/bitwarden/server
synced 2025-12-06 00:03:34 +00:00
* Add feature flag * Further establish billing command pattern and use in PreviewTaxAmountCommand * Add billing address models/commands/queries/tests * Update TypeReadingJsonConverter to account for new union types * Add payment method models/commands/queries/tests * Add credit models/commands/queries/tests * Add command/query registrations * Add new endpoints to support new command model and payment functionality * Run dotnet format * Add InjectUserAttribute for easier AccountBillilngVNextController handling * Add InjectOrganizationAttribute for easier OrganizationBillingVNextController handling * Add InjectProviderAttribute for easier ProviderBillingVNextController handling * Add XML documentation for billing command pipeline * Fix StripeConstants post-nullability * More nullability cleanup * Run dotnet format
34 lines
1.5 KiB
C#
34 lines
1.5 KiB
C#
using Bit.Core.Billing.Caches;
|
|
using Bit.Core.Billing.Caches.Implementations;
|
|
using Bit.Core.Billing.Licenses.Extensions;
|
|
using Bit.Core.Billing.Payment;
|
|
using Bit.Core.Billing.Pricing;
|
|
using Bit.Core.Billing.Services;
|
|
using Bit.Core.Billing.Services.Implementations;
|
|
using Bit.Core.Billing.Tax.Commands;
|
|
using Bit.Core.Billing.Tax.Services;
|
|
using Bit.Core.Billing.Tax.Services.Implementations;
|
|
|
|
namespace Bit.Core.Billing.Extensions;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
public static void AddBillingOperations(this IServiceCollection services)
|
|
{
|
|
services.AddSingleton<ITaxService, TaxService>();
|
|
services.AddTransient<IOrganizationBillingService, OrganizationBillingService>();
|
|
services.AddTransient<IPremiumUserBillingService, PremiumUserBillingService>();
|
|
services.AddTransient<ISetupIntentCache, SetupIntentDistributedCache>();
|
|
services.AddTransient<ISubscriberService, SubscriberService>();
|
|
services.AddKeyedTransient<IAutomaticTaxStrategy, PersonalUseAutomaticTaxStrategy>(AutomaticTaxFactory.PersonalUse);
|
|
services.AddKeyedTransient<IAutomaticTaxStrategy, BusinessUseAutomaticTaxStrategy>(AutomaticTaxFactory.BusinessUse);
|
|
services.AddTransient<IAutomaticTaxFactory, AutomaticTaxFactory>();
|
|
services.AddLicenseServices();
|
|
services.AddPricingClient();
|
|
services.AddTransient<IPreviewTaxAmountCommand, PreviewTaxAmountCommand>();
|
|
services.AddPaymentOperations();
|
|
}
|
|
}
|