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:
@ -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")]
|
||||
|
Reference in New Issue
Block a user