mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 00:52:49 -05:00
Fix stripe invoice time on seat adjust (#1564)
* Finalize and void subscription updates Stripe does not allow deletion of invoices created as subscription updates. Instead, finalize it and void it out without sending to the customer. * Store and Restore invoice days until due Currently, we're overwriting customer invoice lead times whenever they attempt to update their seat count. Changes are now updated to previous behavior after our seat adjustment work * PR Comments
This commit is contained in:
@ -889,7 +889,18 @@ namespace Bit.Core.Services
|
||||
if (cardPaymentMethodId == null)
|
||||
{
|
||||
// We're going to delete this draft invoice, it can't be paid
|
||||
await invoiceService.DeleteAsync(invoice.Id);
|
||||
try
|
||||
{
|
||||
await invoiceService.DeleteAsync(invoice.Id);
|
||||
}
|
||||
catch
|
||||
{
|
||||
await invoiceService.FinalizeInvoiceAsync(invoice.Id, new InvoiceFinalizeOptions
|
||||
{
|
||||
AutoAdvance = false
|
||||
});
|
||||
await invoiceService.VoidInvoiceAsync(invoice.Id);
|
||||
}
|
||||
throw new BadRequestException("No payment method is available.");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user