mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
inject stripepaymentservice
This commit is contained in:
@ -15,6 +15,5 @@ namespace Bit.Core.Models.Table
|
||||
string BraintreeCustomerIdPrefix();
|
||||
string BraintreeIdField();
|
||||
string GatewayIdField();
|
||||
IPaymentService GetPaymentService(GlobalSettings globalSettings);
|
||||
}
|
||||
}
|
||||
|
@ -99,29 +99,6 @@ namespace Bit.Core.Models.Table
|
||||
return maxStorageBytes - Storage.Value;
|
||||
}
|
||||
|
||||
public IPaymentService GetPaymentService(GlobalSettings globalSettings)
|
||||
{
|
||||
if(Gateway == null)
|
||||
{
|
||||
throw new BadRequestException("No gateway.");
|
||||
}
|
||||
|
||||
IPaymentService paymentService = null;
|
||||
switch(Gateway)
|
||||
{
|
||||
case GatewayType.Stripe:
|
||||
paymentService = new StripePaymentService(globalSettings);
|
||||
break;
|
||||
case GatewayType.Braintree:
|
||||
paymentService = new BraintreePaymentService(globalSettings);
|
||||
break;
|
||||
default:
|
||||
throw new NotSupportedException("Unsupported gateway.");
|
||||
}
|
||||
|
||||
return paymentService;
|
||||
}
|
||||
|
||||
public Dictionary<TwoFactorProviderType, TwoFactorProvider> GetTwoFactorProviders()
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(TwoFactorProviders))
|
||||
|
@ -148,29 +148,6 @@ namespace Bit.Core.Models.Table
|
||||
return maxStorageBytes - Storage.Value;
|
||||
}
|
||||
|
||||
public IPaymentService GetPaymentService(GlobalSettings globalSettings)
|
||||
{
|
||||
if(Gateway == null)
|
||||
{
|
||||
throw new BadRequestException("No gateway.");
|
||||
}
|
||||
|
||||
IPaymentService paymentService = null;
|
||||
switch(Gateway)
|
||||
{
|
||||
case GatewayType.Stripe:
|
||||
paymentService = new StripePaymentService(globalSettings);
|
||||
break;
|
||||
case GatewayType.Braintree:
|
||||
paymentService = new BraintreePaymentService(globalSettings);
|
||||
break;
|
||||
default:
|
||||
throw new NotSupportedException("Unsupported gateway.");
|
||||
}
|
||||
|
||||
return paymentService;
|
||||
}
|
||||
|
||||
public IdentityUser ToIdentityUser(bool twoFactorEnabled)
|
||||
{
|
||||
return new IdentityUser
|
||||
|
Reference in New Issue
Block a user