mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 00:22:50 -05:00
upcoming invoice info
This commit is contained in:
@ -46,6 +46,7 @@ namespace Bit.Core.Services
|
||||
var customerService = new StripeCustomerService();
|
||||
var subscriptionService = new StripeSubscriptionService();
|
||||
var chargeService = new StripeChargeService();
|
||||
var invoiceService = new StripeInvoiceService();
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(organization.StripeCustomerId))
|
||||
{
|
||||
@ -72,6 +73,19 @@ namespace Bit.Core.Services
|
||||
Limit = 20
|
||||
});
|
||||
orgBilling.Charges = charges.OrderByDescending(c => c.Created);
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(organization.StripeSubscriptionId))
|
||||
{
|
||||
try
|
||||
{
|
||||
var upcomingInvoice = await invoiceService.UpcomingAsync(organization.StripeCustomerId);
|
||||
if(upcomingInvoice != null)
|
||||
{
|
||||
orgBilling.UpcomingInvoice = upcomingInvoice;
|
||||
}
|
||||
}
|
||||
catch(StripeException) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user