1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 00:52:49 -05:00

Add Stripe Adapter and IBraintreeGateway to DI (#1596)

This commit is contained in:
Oscar Hinton
2021-09-27 23:01:13 +02:00
committed by GitHub
parent 66629b2f1c
commit 63c8070b01
5 changed files with 373 additions and 181 deletions

View File

@ -184,6 +184,18 @@ namespace Bit.Core.Utilities
// Required for UserService
services.AddWebAuthn(globalSettings);
services.AddSingleton<IStripeAdapter, StripeAdapter>();
services.AddSingleton<Braintree.IBraintreeGateway>((serviceProvider) =>
{
return new Braintree.BraintreeGateway
{
Environment = globalSettings.Braintree.Production ?
Braintree.Environment.PRODUCTION : Braintree.Environment.SANDBOX,
MerchantId = globalSettings.Braintree.MerchantId,
PublicKey = globalSettings.Braintree.PublicKey,
PrivateKey = globalSettings.Braintree.PrivateKey
};
});
services.AddSingleton<IPaymentService, StripePaymentService>();
services.AddSingleton<IMailService, HandlebarsMailService>();
services.AddSingleton<ILicensingService, LicensingService>();