feat(signup): no-card 7-day trial on Starter plan#38
Merged
Conversation
New signups land on a 7-day generic trial (Cashier trial_ends_at) without a Stripe customer or subscription. Account is on Starter plan limits during the trial. After 7 days, EnsureAccountReady redirects to /subscribe per the existing flow. - CreateUser sets account.trial_ends_at and plan_id = Starter - EnsureAccountReady allows access when subscribed() OR onGenericTrial() - Account::isOnTrial() includes generic trial check Existing users unaffected: paying users have a subscription; never-paid users continue redirecting to /subscribe.
…efault - BillingController::index reads onTrial from Account::isOnTrial() (covers generic trial without a Stripe subscription) and falls back to account.trial_ends_at when no subscription exists. Vue page already had the badge + 'Trial ends' UI wired — just needed the right props. - Drop default trial_days from 8 to 7 for consistency with messaging.
…ial() Centralizes the 'is the user on any kind of trial?' question in the model. Equivalent behavior — Cashier's subscribed() already includes trialing subscriptions — but semantically cleaner and easier to extend.
…lEndsAt() Centralizes 'what date should the UI show as trial end?' on the model. Returns null when not on trial, the subscription's trial date when on trial-with-card, or the generic trial date for no-card users.
…ock on activeTrialEndsAt
Trial now exists exclusively at signup (no-card generic trial). The /subscribe page is reached only after the trial has been consumed (or to upgrade plans), so it should never offer another trial — that would be a double-trial loophole. - BillingController::subscribe drops trialDays prop - BillingController::checkout drops ->trialDays() call (direct charge) - Subscribe.vue drops trialDays prop and :days placeholders - i18n (en/pt-BR/es): new subscribe-focused copy, remove start_trial/trial_info
- StripeEventListener::handleSubscriptionCreated nulls account.trial_ends_at when a Stripe subscription is created. Prevents 'Trial' badge from lingering for users who convert mid-generic-trial to paid. - Drop unused trialDays global Inertia prop (no frontend consumers after /subscribe redesign). Tests added (10 new, 0 regressions, 1533 total): - AccountTest: isOnTrial + activeTrialEndsAt across 4 scenarios (no trial, generic only, subscription only, both — subscription wins) - StripeEventListenerTest: subscription created clears generic trial - TrialMiddlewareAccessTest: trialing-with-card subscription passes - BillingControllerTest: index exposes onTrial/trialEndsAt for the 3 trial states (generic-only, subscription-only, paying); subscribe page no longer exposes trialDays prop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New signups land on a 7-day generic trial (Cashier trial_ends_at) without a Stripe customer or subscription. Account is on Starter plan limits during the trial. After 7 days, EnsureAccountReady redirects to /subscribe per the existing flow.
Existing users unaffected: paying users have a subscription; never-paid users continue redirecting to /subscribe.