1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-23 03:01:23 +01:00

resolve the issue with changes of payment method (#3976)

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
This commit is contained in:
cyprain-okeke 2024-04-11 15:19:28 +01:00 committed by GitHub
parent 0a43d8335d
commit 736a6f19a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -845,16 +845,20 @@ public class StripePaymentService : IPaymentService
{
try
{
if (chargeNow)
if (!isPm5864DollarThresholdEnabled && !invoiceNow)
{
paymentIntentClientSecret = await PayInvoiceAfterSubscriptionChangeAsync(subscriber, invoice);
}
else
{
invoice = await _stripeAdapter.InvoiceFinalizeInvoiceAsync(subResponse.LatestInvoiceId,
new InvoiceFinalizeOptions { AutoAdvance = false, });
await _stripeAdapter.InvoiceSendInvoiceAsync(invoice.Id, new InvoiceSendOptions());
paymentIntentClientSecret = null;
if (chargeNow)
{
paymentIntentClientSecret =
await PayInvoiceAfterSubscriptionChangeAsync(subscriber, invoice);
}
else
{
invoice = await _stripeAdapter.InvoiceFinalizeInvoiceAsync(subResponse.LatestInvoiceId,
new InvoiceFinalizeOptions { AutoAdvance = false, });
await _stripeAdapter.InvoiceSendInvoiceAsync(invoice.Id, new InvoiceSendOptions());
paymentIntentClientSecret = null;
}
}
}
catch