ÁSZF consent on Stripe's page off until the opening (TERMS_CONSENT)
CI / test (push) Successful in 1m28s
CI / build (push) Successful in 5m2s
CI / deploy (push) Skipped

Stripe refuses the terms consent until the terms URL is set in its
Public details, so purchases would fail. TERMS_CONSENT=false (the
default) leaves the consent out; then the package cards do not mention
the withdrawal waiver and no purchase confirmation is sent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-20 14:03:12 +00:00
co-authored by Claude Opus 5.5
parent e326095f3f
commit 54af54cd39
9 changed files with 58 additions and 16 deletions
@@ -5,7 +5,7 @@ import { useRouter } from "next/navigation";
import { useEffect, useState } from "react";
import { api, errorText } from "@/lib/api";
import type { Package, PayMethod } from "@/lib/types";
import type { Package, PayMethod, PublicConfig } from "@/lib/types";
export const huf = (n: number) => `${n.toLocaleString("hu-HU")} Ft`;
@@ -54,6 +54,16 @@ export function PackageCards({
window.addEventListener("pageshow", reset);
return () => window.removeEventListener("pageshow", reset);
}, []);
// Whether Stripe's page asks for the ÁSZF and the withdrawal waiver
// (TERMS_CONSENT, off until the opening).
const stripe = canPay === "stripe" || canPay === "stripe_test";
const [termsConsent, setTermsConsent] = useState(false);
useEffect(() => {
if (!stripe) return;
api<PublicConfig>("/config")
.then((c) => setTermsConsent(c.terms_consent === true))
.catch(() => {});
}, [stripe]);
const shown = ids
? ids.map((id) => packages.find((p) => p.id === id)).filter((p): p is Package => p !== undefined)
: packages.filter((p) => p.tier === "main");
@@ -149,12 +159,17 @@ export function PackageCards({
</p>
)}
{canPay === "mock" && <p className="hint">Tesztüzem: a fizetés még nincs bekötve, a gomb nem terhel semmit.</p>}
{(canPay === "stripe" || canPay === "stripe_test") && (
{stripe && (
<p className="hint">
<span aria-hidden="true">🔒</span> A fizetés a Stripe biztonságos oldalán történik (bankkártya, Apple Pay,
Google Pay). A kártyaadataidat közvetlenül a Stripe-nak adod meg: mi nem látjuk és nem tároljuk őket. A
csomagot azonnal megkapod, ezért a fizetésnél kéred a teljesítés megkezdését, és ezzel lemondasz a 14 napos
elállási jogról. <Link href="/aszf">ÁSZF</Link>
Google Pay). A kártyaadataidat közvetlenül a Stripe-nak adod meg: mi nem látjuk és nem tároljuk őket.
{termsConsent && (
<>
{" "}
A csomagot azonnal megkapod, ezért a fizetésnél kéred a teljesítés megkezdését, és ezzel lemondasz a 14
napos elállási jogról. <Link href="/aszf">ÁSZF</Link>
</>
)}
</p>
)}
{canPay === "stripe_test" && (
+2
View File
@@ -102,6 +102,8 @@ export interface PublicConfig {
payments_test: boolean;
/** "AAM": alanyi adómentes, the prices carry no VAT; otherwise the rate, e.g. "27%". */
vat: string;
/** Stripe's page asks for the ÁSZF and the withdrawal waiver (off until the opening). */
terms_consent?: boolean;
/** "invite": new accounts need an invitation. */
signup_mode: "invite" | "open";
/** Users may invite others (off until the launch; admins always may). */