mirror of
https://github.com/bitwarden/server.git
synced 2025-06-27 22:26:13 -05:00
[PM-18699] Add trial path to Stripe metadata (#5940)
* Add the market and product initiated change * Resolve the failing test * revert the change * resolve the failing test * Resolve the failing test * revert the add skipstrial * Revert add the new bool SkipTrial * Revert the changes * Revert the changes on the organizationsale * remove the trailsource property * Remove the CustomerSetup added * Add the improved code change for trial metadata * Revert the changes on GetSubscriptionSetup * Assign the InitiationPath
This commit is contained in:
parent
49816e0926
commit
7fd1ccb7a2
@ -34,6 +34,7 @@ public class OrganizationSale
|
|||||||
var subscriptionSetup = GetSubscriptionSetup(signup);
|
var subscriptionSetup = GetSubscriptionSetup(signup);
|
||||||
|
|
||||||
subscriptionSetup.SkipTrial = signup.SkipTrial;
|
subscriptionSetup.SkipTrial = signup.SkipTrial;
|
||||||
|
subscriptionSetup.InitiationPath = signup.InitiationPath;
|
||||||
|
|
||||||
return new OrganizationSale
|
return new OrganizationSale
|
||||||
{
|
{
|
||||||
|
@ -10,6 +10,7 @@ public class SubscriptionSetup
|
|||||||
public required PasswordManager PasswordManagerOptions { get; set; }
|
public required PasswordManager PasswordManagerOptions { get; set; }
|
||||||
public SecretsManager? SecretsManagerOptions { get; set; }
|
public SecretsManager? SecretsManagerOptions { get; set; }
|
||||||
public bool SkipTrial = false;
|
public bool SkipTrial = false;
|
||||||
|
public string? InitiationPath { get; set; }
|
||||||
|
|
||||||
public class PasswordManager
|
public class PasswordManager
|
||||||
{
|
{
|
||||||
|
@ -420,7 +420,11 @@ public class OrganizationBillingService(
|
|||||||
Items = subscriptionItemOptionsList,
|
Items = subscriptionItemOptionsList,
|
||||||
Metadata = new Dictionary<string, string>
|
Metadata = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
["organizationId"] = organizationId.ToString()
|
["organizationId"] = organizationId.ToString(),
|
||||||
|
["trialInitiationPath"] = !string.IsNullOrEmpty(subscriptionSetup.InitiationPath) &&
|
||||||
|
subscriptionSetup.InitiationPath.Contains("trial from marketing website")
|
||||||
|
? "marketing-initiated"
|
||||||
|
: "product-initiated"
|
||||||
},
|
},
|
||||||
OffSession = true,
|
OffSession = true,
|
||||||
TrialPeriodDays = subscriptionSetup.SkipTrial ? 0 : plan.TrialPeriodDays
|
TrialPeriodDays = subscriptionSetup.SkipTrial ? 0 : plan.TrialPeriodDays
|
||||||
|
Loading…
x
Reference in New Issue
Block a user