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

billing info when self hosted with no gateway info

This commit is contained in:
Kyle Spearrin
2017-08-11 23:23:50 -04:00
parent 67edcd035c
commit a020a7268e
2 changed files with 16 additions and 6 deletions

View File

@ -444,14 +444,16 @@ namespace Bit.Api.Controllers
throw new UnauthorizedAccessException();
}
var paymentService = user.GetPaymentService(_globalSettings);
var billingInfo = await paymentService.GetBillingAsync(user);
if(billingInfo == null)
if(!_globalSettings.SelfHosted && user.Gateway != null)
{
throw new NotFoundException();
var paymentService = user.GetPaymentService(_globalSettings);
var billingInfo = await paymentService.GetBillingAsync(user);
return new BillingResponseModel(user, billingInfo, _licenseService);
}
else
{
return new BillingResponseModel(user);
}
return new BillingResponseModel(user, billingInfo, _licenseService);
}
[HttpPut("payment")]