ÁSZF consent on Stripe's page off until the opening (TERMS_CONSENT)
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:
@@ -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" && (
|
||||
|
||||
Reference in New Issue
Block a user