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:
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user