1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-06 13:38:13 -05:00
bitwarden/src/Core/Billing/Extensions/CustomerExtensions.cs
Jonas Hendrickx cae8835e27 WIP
2025-03-18 11:46:34 +01:00

21 lines
622 B
C#

using Bit.Core.Billing.Constants;
using Stripe;
namespace Bit.Core.Billing.Extensions;
public static class CustomerExtensions
{
/// <summary>
/// Determines if a Stripe customer supports automatic tax
/// </summary>
/// <param name="customer"></param>
/// <returns></returns>
public static bool HasTaxLocationVerified(this Customer customer) =>
customer?.Tax?.AutomaticTax != StripeConstants.AutomaticTaxStatus.UnrecognizedLocation;
public static decimal GetBillingBalance(this Customer customer)
{
return customer != null ? customer.Balance / 100M : default;
}
}