Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: resolved trail issue

=c160515d2d81
diff --git a/backend/src/ee/services/license-v2/license-v2-service.ts b/backend/src/ee/services/license-v2/license-v2-service.ts
index c358b3910a..e488572efb 100644
--- a/backend/src/ee/services/license-v2/license-v2-service.ts
+++ b/backend/src/ee/services/license-v2/license-v2-service.ts
@@ -952,7 +952,9 @@ export const licenseV2ServiceFactory = ({
productKey: productId,
planKey: plan,
email,
- name: organization?.name
+ name: organization?.name,
+ // The trial's card-setup checkout redirects here; built server-side from SITE_URL like checkout.
+ returnUrl: buildReturnUrl(orgId)
});
await licenseClient.invalidateEntitlements(orgId);
return { outcome: result.outcome, cardSetupUrl: result.cardSetupUrl };
diff --git a/backend/src/services/license-client/license-client-backends.ts b/backend/src/services/license-client/license-client-backends.ts
index ed20bb1356..be88b41d5e 100644
--- a/backend/src/services/license-client/license-client-backends.ts
+++ b/backend/src/services/license-client/license-client-backends.ts
@@ -284,7 +284,8 @@ export const licenseServerBackend = (
product_key: payload.productKey,
plan_key: payload.planKey,
email: payload.email,
- name: payload.name
+ name: payload.name,
+ returnUrl: payload.returnUrl
}),
redirect: "manual"
});
diff --git a/backend/src/services/license-client/license-client-types.ts b/backend/src/services/license-client/license-client-types.ts
index 29dd6b2566..89ad83fe3e 100644
--- a/backend/src/services/license-client/license-client-types.ts
+++ b/backend/src/services/license-client/license-client-types.ts
@@ -391,6 +391,7 @@ export type TStartTrialPayload = {
// A trial starts with no Stripe customer yet, so the server needs an email + org name to create one.
email?: string;
name?: string;
+ returnUrl?: string;
};
// The trial is always granted immediately (our-side, no Stripe subscription, no upfront charge), so
diff --git a/frontend/src/pages/organization/BillingV2Page/BillingV2Page.tsx b/frontend/src/pages/organization/BillingV2Page/BillingV2Page.tsx
index a7aa570e2e..1b2910e6c3 100644
--- a/frontend/src/pages/organization/BillingV2Page/BillingV2Page.tsx
+++ b/frontend/src/pages/organization/BillingV2Page/BillingV2Page.tsx
@@ -103,12 +103,7 @@ export const BillingV2Page = () => {
setFlow({ type: "sheet", prodId: productId });
};
- // A first-time customer checks out through Stripe; an org with a live subscription has products
- // added / changed in place. Trialing and past-due orgs still have a usable subscription.
- const hasActiveSubscription =
- overview?.subState === "active" ||
- overview?.subState === "trialing" ||
- overview?.subState === "past-due";
+ const hasActiveSubscription = overview?.subState === "active";
const onUpdatePayment = async () => {
try {