mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 00:52:49 -05:00
[AC-1904] Implement endpoint to retrieve Provider subscription (#3921)
* Refactor Core.Billing prior to adding new logic * Add ProviderBillingQueries.GetSubscriptionData * Add ProviderBillingController.GetSubscriptionAsync
This commit is contained in:
@ -6,7 +6,7 @@ using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Core.AdminConsole.Entities.Provider;
|
||||
|
||||
public class Provider : ITableObject<Guid>
|
||||
public class Provider : ITableObject<Guid>, ISubscriber
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
/// <summary>
|
||||
@ -34,6 +34,26 @@ public class Provider : ITableObject<Guid>
|
||||
public string GatewayCustomerId { get; set; }
|
||||
public string GatewaySubscriptionId { get; set; }
|
||||
|
||||
public string BillingEmailAddress() => BillingEmail?.ToLowerInvariant().Trim();
|
||||
|
||||
public string BillingName() => DisplayBusinessName();
|
||||
|
||||
public string SubscriberName() => DisplayName();
|
||||
|
||||
public string BraintreeCustomerIdPrefix() => "p";
|
||||
|
||||
public string BraintreeIdField() => "provider_id";
|
||||
|
||||
public string BraintreeCloudRegionField() => "region";
|
||||
|
||||
public bool IsOrganization() => false;
|
||||
|
||||
public bool IsUser() => false;
|
||||
|
||||
public string SubscriberType() => "Provider";
|
||||
|
||||
public bool IsExpired() => false;
|
||||
|
||||
public void SetNewId()
|
||||
{
|
||||
if (Id == default)
|
||||
|
Reference in New Issue
Block a user