From d3c37dac08a137510a398ed23f7ee5cf5fc972d2 Mon Sep 17 00:00:00 2001 From: Mattsson <111893710+mattssonn@users.noreply.github.com> Date: Fri, 24 Jul 2026 19:19:49 +0200 Subject: [PATCH] feat(stripe): enable Stripe integration and update UI components (#1159) * feat(stripe): enable Stripe integration and update UI components * refactor(import): streamline user ID and sandbox status fetching logic --- app/(dashboard)/import/page.tsx | 31 ++++-------------- .../stripe/components/StripeSettingsPanel.tsx | 20 ----------- public/icons/stripe.webp | Bin 0 -> 2830 bytes public/logos/stripe.svg | 3 ++ 4 files changed, 9 insertions(+), 45 deletions(-) create mode 100644 public/icons/stripe.webp create mode 100644 public/logos/stripe.svg diff --git a/app/(dashboard)/import/page.tsx b/app/(dashboard)/import/page.tsx index 474f3911..6928df6a 100644 --- a/app/(dashboard)/import/page.tsx +++ b/app/(dashboard)/import/page.tsx @@ -1955,13 +1955,12 @@ const StripePanel = getSettingsPanel('stripe') type ImportMode = null | 'psd2' | 'stripe' | 'bank' | 'sie' | 'csv_data' | 'migration' export default function ImportPage() { - const { company } = useCompany() + const { isSandbox } = useCompany() const [mode, setMode] = useState(null) const [view, setView] = useState<'import' | 'export'>('import') const [sieDialogOpen, setSieDialogOpen] = useState(false) const [cloudOpen, setCloudOpen] = useState(false) const [userId, setUserId] = useState('') - const [isSandbox, setIsSandbox] = useState(false) const [exportPeriodId, setExportPeriodId] = useState(null) const [exportExcludeClosing, setExportExcludeClosing] = useState(true) const t = useTranslations('import') @@ -1969,21 +1968,11 @@ export default function ImportPage() { const hasCloudBackup = ENABLED_EXTENSION_IDS.has('cloud-backup') const hasBankSync = useCapability(CAPABILITY.bank_sync) - // Fetch authenticated user ID and sandbox status + // Fetch authenticated user ID (used by the migration wizard) useEffect(() => { const supabase = createClient() supabase.auth.getUser().then(({ data: { user } }) => { - if (!user) return - setUserId(user.id) - if (!company) return - supabase - .from('company_settings') - .select('is_sandbox') - .eq('company_id', company.id) - .single() - .then(({ data }) => { - if (data?.is_sandbox) setIsSandbox(true) - }) + if (user) setUserId(user.id) }) }, []) @@ -2039,10 +2028,8 @@ export default function ImportPage() { const hasBankingExtension = ENABLED_EXTENSION_IDS.has('enable-banking') const hasMigrationExtension = ENABLED_EXTENSION_IDS.has('arcim-migration') const hasStripeExtension = ENABLED_EXTENSION_IDS.has('stripe') - // Hosted: Stripe Connect has not launched, so the card is "coming soon". - // The panel carries the same gate internally for ?mode=stripe deep links. - const isSelfHosted = process.env.NEXT_PUBLIC_SELF_HOSTED === 'true' - const stripeDisabled = isSandbox || !isSelfHosted + // Stripe is enabled everywhere (hosted + self-hosted); only the sandbox blocks it. + const stripeDisabled = isSandbox return (
@@ -2109,13 +2096,7 @@ export default function ImportPage() { - {t('stripe_coming_soon')} - - ) : undefined - } + chips={} disabled={stripeDisabled} onClick={() => setMode('stripe')} /> diff --git a/extensions/general/stripe/components/StripeSettingsPanel.tsx b/extensions/general/stripe/components/StripeSettingsPanel.tsx index 87e71c99..808d1552 100644 --- a/extensions/general/stripe/components/StripeSettingsPanel.tsx +++ b/extensions/general/stripe/components/StripeSettingsPanel.tsx @@ -7,7 +7,6 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { Badge } from '@/components/ui/badge' import { Switch } from '@/components/ui/switch' -import { EmptyState } from '@/components/ui/empty-state' import { Skeleton } from '@/components/ui/skeleton' import { useToast } from '@/components/ui/use-toast' import { useFormat } from '@/lib/hooks/use-format' @@ -217,25 +216,6 @@ export default function StripeSettingsPanel() { } } - // Hosted: Stripe Connect is not launched yet, so the settings surface is - // "coming soon" even where the platform credentials are configured (test - // mode): users must not be able to connect or toggle transaction sync until - // launch. Self-hosted admins run their own keys and keep the full panel. - const isSelfHosted = process.env.NEXT_PUBLIC_SELF_HOSTED === 'true' - if (!isSelfHosted) { - return ( - - - - - - ) - } - if (loading) { return ( diff --git a/public/icons/stripe.webp b/public/icons/stripe.webp new file mode 100644 index 0000000000000000000000000000000000000000..ed9193cced0e9cdd3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