Promo codes; purchases off in production
Admins make promo codes for a package (Admin → Promókódok: batch, note, copy all), list them filtered (unused by default, used, revoked; by package; by code, note or redeemer) and withdraw unused ones. A logged-in user redeems a code once (header link, /bevaltas?kod=... prefilled, packages page, and the analysis and question offers point there) and gets the package as an order with source 'promo'. Failed redemptions are rate limited. Production purchases are off: MOCK_PAYMENTS now defaults to false in the deploy compose, so package cards say 'Hamarosan'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import type { Metadata } from "next";
|
||||
|
||||
import { RedeemCode } from "@/components/RedeemCode";
|
||||
import { requireMe } from "@/lib/server";
|
||||
|
||||
export const metadata: Metadata = { title: "Promókód beváltása", robots: { index: false } };
|
||||
|
||||
type Props = { searchParams: Promise<{ kod?: string }> };
|
||||
|
||||
/** Redeeming a promo code; `?kod=` fills it in (links in invitations). */
|
||||
export default async function RedeemPage({ searchParams }: Props) {
|
||||
const { kod } = await searchParams;
|
||||
await requireMe(kod ? `/bevaltas?kod=${encodeURIComponent(kod)}` : "/bevaltas");
|
||||
return (
|
||||
<main className="page" style={{ maxWidth: 640 }}>
|
||||
<div className="page-head">
|
||||
<span className="eyebrow">Promókód</span>
|
||||
<h1>Promókód beváltása</h1>
|
||||
<p className="muted">
|
||||
Írd be a kapott kódot. A hozzá tartozó csomag azonnal a tiéd, az elemzései nem járnak le. Egy kód egyszer
|
||||
váltható be.
|
||||
</p>
|
||||
</div>
|
||||
<section className="card">
|
||||
<RedeemCode initial={kod ?? ""} />
|
||||
</section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user