-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Stripe #425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stripe #425
Changes from all commits
d8a4b91
988afe9
5e81536
64d0b45
c5ea1ee
9051a9c
086c545
bebc6fa
a3ed600
b20a4c4
570609a
daedaa6
0e3af8f
c51e2fe
74a39c6
407b314
3490890
85bfe72
cced41a
640d9d8
2b16395
71556b1
74adfc3
a6d06ce
607db25
e1dea54
b325cdf
994f022
cbe2501
6f9129c
da9c930
44f0a43
eff94eb
6add7f8
e2339cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,6 @@ | ||||||||||||||||||||||||||||||||||||
| "use client"; | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| import { useCallback } from "react"; | ||||||||||||||||||||||||||||||||||||
| import Link from "next/link"; | ||||||||||||||||||||||||||||||||||||
| import { type SubmitHandler, useFieldArray, useForm } from "react-hook-form"; | ||||||||||||||||||||||||||||||||||||
| import { useSession } from "next-auth/react"; | ||||||||||||||||||||||||||||||||||||
| import { zodResolver } from "@hookform/resolvers/zod"; | ||||||||||||||||||||||||||||||||||||
|
|
@@ -26,7 +25,6 @@ import { AlertBasic, AlertWithButton } from "@/components/Alert"; | |||||||||||||||||||||||||||||||||||
| import { usePremium } from "@/components/PremiumAlert"; | ||||||||||||||||||||||||||||||||||||
| import { pricingAdditonalEmail } from "@/app/(app)/premium/config"; | ||||||||||||||||||||||||||||||||||||
| import { PremiumTier } from "@prisma/client"; | ||||||||||||||||||||||||||||||||||||
| import { env } from "@/env"; | ||||||||||||||||||||||||||||||||||||
| import { getUserTier, isAdminForPremium } from "@/utils/premium"; | ||||||||||||||||||||||||||||||||||||
| import { usePremiumModal } from "@/app/(app)/premium/PremiumModal"; | ||||||||||||||||||||||||||||||||||||
| import { useAction } from "next-safe-action/hooks"; | ||||||||||||||||||||||||||||||||||||
|
|
@@ -212,20 +210,9 @@ function MultiAccountForm({ | |||||||||||||||||||||||||||||||||||
| })} | ||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| {needsToPurchaseMoreSeats ? ( | ||||||||||||||||||||||||||||||||||||
| <Button type="button" loading={isExecuting} asChild> | ||||||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||||||
| href={`${env.NEXT_PUBLIC_LIFETIME_EXTRA_SEATS_PAYMENT_LINK}?quantity=${extraSeats}`} | ||||||||||||||||||||||||||||||||||||
| target="_blank" | ||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||
| Purchase {extraSeats} Extra Seat{extraSeats > 1 ? "s" : ""} | ||||||||||||||||||||||||||||||||||||
| </Link> | ||||||||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||||||||
| ) : ( | ||||||||||||||||||||||||||||||||||||
| <Button type="submit" loading={isExecuting}> | ||||||||||||||||||||||||||||||||||||
| Save | ||||||||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||
| <Button type="submit" loading={isExecuting}> | ||||||||||||||||||||||||||||||||||||
| Save | ||||||||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+213
to
+215
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion UI simplified for the Stripe integration. The UI has been streamlined by removing the Lemon Squeezy payment link button and keeping only the Save button. This aligns with the migration to Stripe for subscription management. However, there's no clear alternative action for users who need to purchase more seats. Consider adding guidance for users when - <Button type="submit" loading={isExecuting}>
- Save
- </Button>
+ {needsToPurchaseMoreSeats ? (
+ <>
+ <Button type="submit" loading={isExecuting} disabled>
+ Save
+ </Button>
+ <p className="mt-2 text-sm text-muted-foreground">
+ You need to purchase additional seats before saving. Visit the billing section to upgrade.
+ </p>
+ </>
+ ) : (
+ <Button type="submit" loading={isExecuting}>
+ Save
+ </Button>
+ )}📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||
| </form> | ||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Simplified UI for Stripe integration.
Removed the conditional Lemon Squeezy payment button in favor of a simple "Save" button, aligning with the migration to Stripe-based billing.
Note that the form submission still blocks if extra seats are needed (line 176), but no longer provides a direct purchase option. Ensure this doesn't confuse users who need to upgrade but aren't given a clear path to do so.
🏁 Script executed:
Length of output: 83
🏁 Script executed:
Length of output: 2727
Provide a clear upgrade path when seat limit is reached
The “Save” button now replaces the old Lemon Squeezy purchase flow for Stripe migration. We verified that:
onSubmitcallback (apps/web/app/(app)/[emailAccountId]/settings/MultiAccountSection.tsx lines 168–174), submission simply returns ifneedsToPurchaseMoreSeatsis true.ExtraSeatsAlertcomponent (same file, lines 220–228) only renders a static alert showing current seats without offering any action.As a result, users who hit the seat limit have no obvious way to upgrade. Please add an explicit upgrade option, for example:
• In the
onSubmitblock, redirect to your billing page or open an “Upgrade plan” modal whenneedsToPurchaseMoreSeatsis true.• Enhance
ExtraSeatsAlertto include an “Upgrade plan” button or link alongside the seat information.