From cb3fdc52f07e66ff3d6b4835b2cc75f845fe1a4b Mon Sep 17 00:00:00 2001
From: "gpt-engineer-app[bot]"
<159125892+gpt-engineer-app[bot]@users.noreply.github.com>
Date: Sat, 11 Jul 2026 13:14:25 +0000
Subject: [PATCH 1/3] Changes
Co-authored-by: wolfoftyreso-debug <250630591+wolfoftyreso-debug@users.noreply.github.com>
---
src/pages/OrderConfirmation.tsx | 108 ++++++++++++++++++++++++++++++++
1 file changed, 108 insertions(+)
create mode 100644 src/pages/OrderConfirmation.tsx
diff --git a/src/pages/OrderConfirmation.tsx b/src/pages/OrderConfirmation.tsx
new file mode 100644
index 0000000..44d7bc9
--- /dev/null
+++ b/src/pages/OrderConfirmation.tsx
@@ -0,0 +1,108 @@
+import { useSearchParams, useNavigate } from "react-router-dom";
+import { CheckCircle2, Truck, Mail, Calendar } from "lucide-react";
+import Header from "@/components/Header";
+import { Button } from "@/components/ui/button";
+
+const OrderConfirmation = () => {
+ const [searchParams] = useSearchParams();
+ const navigate = useNavigate();
+
+ const method = searchParams.get("method") ?? "card";
+ const kg = searchParams.get("kg");
+ const email = searchParams.get("email");
+ const sessionId = searchParams.get("session_id");
+
+ return (
+
+
+
+
+
+
+
+
+
+
+ Tack för din beställning!
+
+
+ Goda saker är på väg.
+
+
+
+
+ {kg && (
+
+
+ Ditt abonnemang
+
+
+ {kg} kg kakor / vecka
+
+
+ )}
+
+
+
+
+
Leverans varje tisdag
+
+ Vi levererar färska kakor till er adress inom Storstockholm varje tisdag
+ morgon. Första leveransen kommer inom kort.
+
+
+
+
+
+
+
+
+ {method === "invoice" ? "Faktura varje månad" : "Månatlig kortdragning"}
+
+
+ {method === "invoice"
+ ? "Faktura skickas till er e-post varje månad med 30 dagars betalningsvillkor."
+ : "Beloppet dras automatiskt från ert kort en gång i månaden. Du kan säga upp när som helst."}
+
+
+
+
+
+
+
+
Orderbekräftelse
+
+ En bekräftelse{email ? <> skickas till {email} > : " skickas till din e-post"} inom kort.
+
+
+
+
+ {sessionId && (
+
+
+ Referens: {sessionId}
+
+
+ )}
+
+
+
+ navigate("/")}
+ variant="outline"
+ className="font-display"
+ >
+ Tillbaka till startsidan
+
+
+
+
+ Äkta svenskt konditorhantverk
+
+
+
+
+ );
+};
+
+export default OrderConfirmation;
From 66e631706b627e205fd5b46b8fe7141d85bc705c Mon Sep 17 00:00:00 2001
From: "gpt-engineer-app[bot]"
<159125892+gpt-engineer-app[bot]@users.noreply.github.com>
Date: Sat, 11 Jul 2026 13:14:31 +0000
Subject: [PATCH 2/3] Changes
Co-authored-by: wolfoftyreso-debug <250630591+wolfoftyreso-debug@users.noreply.github.com>
---
src/App.tsx | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/App.tsx b/src/App.tsx
index ca8c2f4..ba9379f 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -12,6 +12,7 @@ import AccountConfirmation from "./pages/AccountConfirmation";
import Contact from "./pages/Contact";
import Admin from "./pages/Admin";
import FAQ from "./pages/FAQ";
+import OrderConfirmation from "./pages/OrderConfirmation";
import { PaymentTestModeBanner } from "@/components/PaymentTestModeBanner";
const queryClient = new QueryClient();
@@ -29,6 +30,7 @@ function AppContent() {
} />
} />
} />
+ } />
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
} />
From 01695609bb4a6197f5a6b533dd5916ce9aa2e1d7 Mon Sep 17 00:00:00 2001
From: "gpt-engineer-app[bot]"
<159125892+gpt-engineer-app[bot]@users.noreply.github.com>
Date: Sat, 11 Jul 2026 13:14:38 +0000
Subject: [PATCH 3/3] Changes
Co-authored-by: wolfoftyreso-debug <250630591+wolfoftyreso-debug@users.noreply.github.com>
---
src/components/PlansSection.tsx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/components/PlansSection.tsx b/src/components/PlansSection.tsx
index 3432392..dd1ad13 100644
--- a/src/components/PlansSection.tsx
+++ b/src/components/PlansSection.tsx
@@ -122,7 +122,7 @@ const PlansSection = () => {
postal_code: result.data.postnummer,
city: "Storstockholm",
comments: result.data.kommentarer ?? "",
- return_url: `${window.location.origin}/?checkout=success&session_id={CHECKOUT_SESSION_ID}`,
+ return_url: `${window.location.origin}/order-confirmation?session_id={CHECKOUT_SESSION_ID}&method=card&kg=${recommendedKg}&email=${encodeURIComponent(result.data.epost)}`,
environment: getStripeEnvironment(),
};
@@ -134,7 +134,8 @@ const PlansSection = () => {
if (!(data as any)?.clientSecret) throw new Error("Kunde inte skapa checkout-session");
setClientSecret((data as any).clientSecret);
} else {
- setSubmitted("invoice");
+ window.location.href = `/order-confirmation?method=invoice&kg=${recommendedKg}&email=${encodeURIComponent(result.data.epost)}`;
+ return;
}
} catch (err: any) {
console.error(err);