1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-05 18:12:48 -05:00

remove charge and add balance to billing models

This commit is contained in:
Kyle Spearrin
2019-02-18 17:09:56 -05:00
parent 2397c6d862
commit 250784d197
3 changed files with 4 additions and 64 deletions

View File

@ -939,7 +939,7 @@ namespace Bit.Core.Services
var customer = await customerService.GetAsync(subscriber.GatewayCustomerId);
if(customer != null)
{
billingInfo.CreditAmount = customer.AccountBalance / 100M;
billingInfo.Balance = customer.AccountBalance / 100M;
if(customer.Metadata?.ContainsKey("btCustomerId") ?? false)
{
@ -968,14 +968,6 @@ namespace Bit.Core.Services
}
}
var charges = await chargeService.ListAsync(new ChargeListOptions
{
CustomerId = customer.Id,
Limit = 20
});
billingInfo.Charges = charges?.Data?.OrderByDescending(c => c.Created)
.Select(c => new BillingInfo.BillingCharge(c));
var invoices = await invoiceService.ListAsync(new InvoiceListOptions
{
CustomerId = customer.Id,