feat: add source: 'onboarding' metadata to subscriptions from onboarding v3 (#26619)
When a user signs up to a team/org from onboarding v3, the subscription now includes source: 'onboarding' in its metadata. This helps track which subscriptions originated from the onboarding flow. Changes: - Add source: 'onboarding' to subscription_data.metadata in team checkout when isOnboarding is true - Add source: 'onboarding' to subscription metadata for organization onboarding flow Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
This commit is contained in:
co-authored by
Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Anik Dhabal Babu
parent
478ca05246
commit
58798f27d2
@@ -274,11 +274,12 @@ export class OrganizationPaymentService {
|
||||
})
|
||||
);
|
||||
|
||||
const subscriptionData = ORG_TRIAL_DAYS
|
||||
? {
|
||||
trial_period_days: ORG_TRIAL_DAYS,
|
||||
}
|
||||
: undefined;
|
||||
const subscriptionData = {
|
||||
...(ORG_TRIAL_DAYS && { trial_period_days: ORG_TRIAL_DAYS }),
|
||||
metadata: {
|
||||
source: "onboarding",
|
||||
},
|
||||
};
|
||||
|
||||
return this.billingService.createSubscriptionCheckout({
|
||||
customerId: stripeCustomerId,
|
||||
@@ -292,7 +293,7 @@ export class OrganizationPaymentService {
|
||||
pricePerSeat: config.pricePerSeat,
|
||||
billingPeriod: config.billingPeriod,
|
||||
},
|
||||
...(subscriptionData && { subscriptionData }),
|
||||
subscriptionData,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -97,6 +97,9 @@ export const generateTeamCheckoutSession = async ({
|
||||
},
|
||||
subscription_data: {
|
||||
trial_period_days: 14, // Add a 14-day trial
|
||||
metadata: {
|
||||
...(isOnboarding && { source: "onboarding" }),
|
||||
},
|
||||
},
|
||||
metadata: {
|
||||
type: CHECKOUT_SESSION_TYPES.TEAM_CREATION,
|
||||
|
||||
Reference in New Issue
Block a user