mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 17:42:49 -05:00
remove charge and add balance to billing models
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user