1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-01 23:31:41 +01:00

do not accept bank tokens for premium

This commit is contained in:
Kyle Spearrin 2017-08-13 00:33:37 -04:00
parent 72848a0623
commit 45c2d3eeb8

View File

@ -551,6 +551,11 @@ namespace Bit.Core.Services
}
else if(!string.IsNullOrWhiteSpace(paymentToken))
{
if(paymentToken.StartsWith("btok_"))
{
throw new BadRequestException("Invalid token.");
}
if(paymentToken.StartsWith("tok_"))
{
paymentService = new StripePaymentService();
@ -612,6 +617,11 @@ namespace Bit.Core.Services
public async Task ReplacePaymentMethodAsync(User user, string paymentToken)
{
if(paymentToken.StartsWith("btok_"))
{
throw new BadRequestException("Invalid token.");
}
IPaymentService paymentService = null;
if(paymentToken.StartsWith("tok_"))
{