Packages paid through Stripe Checkout
The catalog stays in packages.rs: every checkout session carries the package's name and gross price, nothing has to be kept in Stripe. The package is granted once, when Stripe confirms the payment: by the signed webhook, or by the return page asking Stripe when the webhook is late. With a test key only admins can buy, so Stripe's test cards give nobody free packages. Without the keys nothing changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -4,7 +4,7 @@ import Link from "next/link";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import { api, errorText } from "@/lib/api";
|
||||
import type { Analysis } from "@/lib/types";
|
||||
import type { Analysis, PayMethod } from "@/lib/types";
|
||||
|
||||
import { AI_SHORT } from "./AiNote";
|
||||
import { AnalysisLoading } from "./AnalysisLoading";
|
||||
@@ -96,8 +96,8 @@ export function DetailedAnalysis({
|
||||
initial: Analysis | null;
|
||||
left: number;
|
||||
isAdmin: boolean;
|
||||
/** The stand-in payment is on (MOCK_PAYMENTS). */
|
||||
canPay: boolean;
|
||||
/** How the user can buy a package (null: purchases are off). */
|
||||
canPay: PayMethod | null;
|
||||
/** Shown above a finished analysis (e.g. who is the first and the second person). */
|
||||
note?: string;
|
||||
/** Questions left; given where questions can be asked. */
|
||||
@@ -245,7 +245,11 @@ export function DetailedAnalysis({
|
||||
step === "pay" ? (
|
||||
<div className="pay-box">
|
||||
<p className="pay-lead">
|
||||
Válassz csomagot. A vásárlás után az elemzés azonnal elindul, a maradék elemzések pedig nem járnak le.
|
||||
Válassz csomagot.{" "}
|
||||
{canPay === "mock"
|
||||
? "A vásárlás után az elemzés azonnal elindul"
|
||||
: "A fizetés után visszajössz ide, és rögtön elindíthatod az elemzést"}
|
||||
, a maradék elemzések pedig nem járnak le.
|
||||
</p>
|
||||
<PackageChooser ids={t.packages} canPay={canPay} onBought={start} />
|
||||
<div className="form-actions">
|
||||
|
||||
Reference in New Issue
Block a user