1
0
mirror of https://github.com/bitwarden/server synced 2026-01-04 17:43:53 +00:00

[AC-1608] Send offboarding survey response to Stripe on subscription cancellation (#3734)

* Added offboarding survey response to cancellation when FF is on.

* Removed service methods to prevent unnecessary upstream registrations

* Forgot to actually remove the injected command in the services

* Rui's feedback

* Add missing summary

* Missed [FromBody]
This commit is contained in:
Alex Morask
2024-02-09 11:58:37 -05:00
committed by GitHub
parent b81f9ca749
commit 59fa6935b4
20 changed files with 656 additions and 12 deletions

View File

@@ -14,7 +14,8 @@ public interface ISubscriber
string BraintreeCustomerIdPrefix();
string BraintreeIdField();
string BraintreeCloudRegionField();
string GatewayIdField();
bool IsOrganization();
bool IsUser();
string SubscriberType();
bool IsExpired();
}

View File

@@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Identity;
namespace Bit.Core.Entities;
public class User : ITableObject<Guid>, ISubscriber, IStorable, IStorableSubscriber, IRevisable, ITwoFactorProvidersUser, IReferenceable
public class User : ITableObject<Guid>, IStorableSubscriber, IRevisable, ITwoFactorProvidersUser, IReferenceable
{
private Dictionary<TwoFactorProviderType, TwoFactorProvider> _twoFactorProviders;
@@ -111,6 +111,8 @@ public class User : ITableObject<Guid>, ISubscriber, IStorable, IStorableSubscri
return "userId";
}
public bool IsOrganization() => false;
public bool IsUser()
{
return true;
@@ -121,6 +123,8 @@ public class User : ITableObject<Guid>, ISubscriber, IStorable, IStorableSubscri
return "Subscriber";
}
public bool IsExpired() => PremiumExpirationDate.HasValue && PremiumExpirationDate.Value <= DateTime.UtcNow;
public Dictionary<TwoFactorProviderType, TwoFactorProvider> GetTwoFactorProviders()
{
if (string.IsNullOrWhiteSpace(TwoFactorProviders))