mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 00:22:50 -05:00
Pay 0 cost invoices that have not been paid (#1739)
This commit is contained in:
@ -101,7 +101,7 @@ namespace Bit.Core.Services
|
||||
return _invoiceService.SendInvoiceAsync(id, options);
|
||||
}
|
||||
|
||||
public Task<Stripe.Invoice> InvoicePayAsync(string id, Stripe.InvoicePayOptions options)
|
||||
public Task<Stripe.Invoice> InvoicePayAsync(string id, Stripe.InvoicePayOptions options = null)
|
||||
{
|
||||
return _invoiceService.PayAsync(id, options);
|
||||
}
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user