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:
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
|
||||
|
||||
import { AiNote } from "@/components/AiNote";
|
||||
import { PackageCards } from "@/components/PackageCards";
|
||||
import { RedeemCode } from "@/components/RedeemCode";
|
||||
import { backendGet, requireMe } from "@/lib/server";
|
||||
import type { Package, PublicConfig } from "@/lib/types";
|
||||
|
||||
@@ -68,6 +69,16 @@ export default async function PackagesPage() {
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section className="card redeem-card" aria-labelledby="redeem-title">
|
||||
<h2 id="redeem-title">Van promókódod?</h2>
|
||||
<p className="muted">
|
||||
{canPay
|
||||
? "Váltsd be itt: a hozzá tartozó csomag azonnal a tiéd."
|
||||
: "A csomagok hamarosan megvásárolhatók. Addig promókóddal juthatsz hozzájuk: a hozzá tartozó csomag azonnal a tiéd."}
|
||||
</p>
|
||||
<RedeemCode />
|
||||
</section>
|
||||
|
||||
<PackageCards packages={packages} canPay={canPay} />
|
||||
|
||||
<section className="field" aria-labelledby="addon-title" style={{ gap: 12 }}>
|
||||
|
||||
Reference in New Issue
Block a user