1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 00:52:49 -05:00

Pay 0 cost invoices that have not been paid (#1739)

This commit is contained in:
Matt Gibson
2021-12-01 14:41:05 -06:00
committed by GitHub
parent 757927e02a
commit dc3d70cf3a
3 changed files with 8 additions and 2 deletions

View File

@ -801,6 +801,12 @@ namespace Bit.Core.Services
throw;
}
}
else if (!invoice.Paid)
{
// Pay invoice with no charge to customer this completes the invoice immediately without waiting the scheduled 1h
invoice = await _stripeAdapter.InvoicePayAsync(subResponse.LatestInvoiceId);
paymentIntentClientSecret = null;
}
// Change back the subscription collection method and/or days until due
if (collectionMethod != "send_invoice" || daysUntilDue == null)