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 try
{ {
if (chargeNow) if (!isPm5864DollarThresholdEnabled && !invoiceNow)
{ {
paymentIntentClientSecret = await PayInvoiceAfterSubscriptionChangeAsync(subscriber, invoice); if (chargeNow)
} {
else paymentIntentClientSecret =
{ await PayInvoiceAfterSubscriptionChangeAsync(subscriber, invoice);
invoice = await _stripeAdapter.InvoiceFinalizeInvoiceAsync(subResponse.LatestInvoiceId, }
new InvoiceFinalizeOptions { AutoAdvance = false, }); else
await _stripeAdapter.InvoiceSendInvoiceAsync(invoice.Id, new InvoiceSendOptions()); {
paymentIntentClientSecret = null; invoice = await _stripeAdapter.InvoiceFinalizeInvoiceAsync(subResponse.LatestInvoiceId,
new InvoiceFinalizeOptions { AutoAdvance = false, });
await _stripeAdapter.InvoiceSendInvoiceAsync(invoice.Id, new InvoiceSendOptions());
paymentIntentClientSecret = null;
}
} }
} }
catch catch