1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00

refactor for addtnl. payment service (braintree)

This commit is contained in:
Kyle Spearrin
2017-07-28 12:09:12 -04:00
parent 2dc9c196c4
commit 082b53e133
14 changed files with 928 additions and 351 deletions

View File

@ -4,6 +4,7 @@ using Bit.Core.Utilities;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Linq;
using Bit.Core.Services;
namespace Bit.Core.Models.Table
{
@ -135,5 +136,20 @@ namespace Bit.Core.Models.Table
return maxStorageBytes - Storage.Value;
}
public IPaymentService GetPaymentService(GlobalSettings globalSettings)
{
IPaymentService paymentService = null;
if(StripeSubscriptionId.StartsWith("sub_"))
{
paymentService = new StripePaymentService();
}
else
{
paymentService = new BraintreePaymentService(globalSettings);
}
return paymentService;
}
}
}