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

inject stripepaymentservice

This commit is contained in:
Kyle Spearrin
2019-02-08 23:53:09 -05:00
parent a97a6216d7
commit d568b86e1e
12 changed files with 58 additions and 464 deletions

View File

@ -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