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

Resolve RisksSubscriptionFailure bugs (#3790)

This commit is contained in:
Alex Morask
2024-02-29 08:15:18 -05:00
committed by GitHub
parent 696883c5e0
commit eb1eb0554c
6 changed files with 27 additions and 24 deletions

View File

@ -1738,13 +1738,17 @@ public class StripePaymentService : IPaymentService
{
var subscriptionInfo = await GetSubscriptionAsync(organization);
if (subscriptionInfo.Subscription is not { Status: "active" or "trialing" or "past_due" } ||
subscriptionInfo.UpcomingInvoice == null)
if (subscriptionInfo.Subscription is not
{
Status: "active" or "trialing" or "past_due",
CollectionMethod: "charge_automatically"
}
|| subscriptionInfo.UpcomingInvoice == null)
{
return false;
}
var customer = await GetCustomerAsync(organization.GatewayCustomerId);
var customer = await GetCustomerAsync(organization.GatewayCustomerId, GetCustomerPaymentOptions());
var paymentSource = await GetBillingPaymentSourceAsync(customer);