mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 09:02:48 -05:00
[PM-11993] Fix free organization bug in SubscriberService.GetPaymentMethod (#4766)
* Handle free organization in SubscriberService.GetPaymentMethod * Run dotnet format
This commit is contained in:
@ -213,11 +213,16 @@ public class SubscriberService(
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(subscriber);
|
||||
|
||||
var customer = await GetCustomerOrThrow(subscriber, new CustomerGetOptions
|
||||
var customer = await GetCustomer(subscriber, new CustomerGetOptions
|
||||
{
|
||||
Expand = ["default_source", "invoice_settings.default_payment_method", "subscriptions", "tax_ids"]
|
||||
});
|
||||
|
||||
if (customer == null)
|
||||
{
|
||||
return PaymentMethod.Empty;
|
||||
}
|
||||
|
||||
var accountCredit = customer.Balance * -1 / 100;
|
||||
|
||||
var paymentMethod = await GetPaymentSourceAsync(subscriber.Id, customer);
|
||||
|
Reference in New Issue
Block a user