diff --git a/app/api/create-checkout-session/route.ts b/app/api/create-checkout-session/route.ts index ed436f5..6950d59 100644 --- a/app/api/create-checkout-session/route.ts +++ b/app/api/create-checkout-session/route.ts @@ -11,8 +11,19 @@ function getMollie() { return mollieClient } -// Dynamic pricing configuration (in EUR) -const TICKET_PRICE = 80 // €80 early bird +// Dynamic pricing tiers (in EUR) +const PRICING_TIERS = [ + { label: "Early bird", price: 80, cutoff: "2026-03-31" }, + { label: "Regular", price: 120, cutoff: "2026-07-01" }, + { label: "Late", price: 150, cutoff: "2099-12-31" }, +] + +function getCurrentTicketPrice(): number { + const now = new Date().toISOString().slice(0, 10) + const tier = PRICING_TIERS.find((t) => now < t.cutoff) ?? PRICING_TIERS[PRICING_TIERS.length - 1] + return tier.price +} + const PROCESSING_FEE_PERCENT = 0.02 // 2% to cover Mollie payment processing fees // Accommodation prices per person for 7 nights @@ -39,8 +50,9 @@ export async function POST(request: NextRequest) { const registrationData = registrationDataStr ? JSON.parse(registrationDataStr) : null // Calculate subtotal - let subtotal = TICKET_PRICE - const descriptionParts = ["CCG 2026 Ticket (€80)"] + const ticketPrice = getCurrentTicketPrice() + let subtotal = ticketPrice + const descriptionParts = [`CCG 2026 Ticket (€${ticketPrice})`] if (includeAccommodation) { const accom = ACCOMMODATION_PRICES[accommodationType] diff --git a/app/register/page.tsx b/app/register/page.tsx index 071bbbb..3608f8e 100644 --- a/app/register/page.tsx +++ b/app/register/page.tsx @@ -30,7 +30,15 @@ export default function RegisterPage() { dietaryOther: "", crewConsent: "", }) - const baseTicketPrice = 80 // Early bird price €80 + // Dynamic pricing tiers + const pricingTiers = [ + { label: "Early bird", price: 80, cutoff: "2026-03-31" }, + { label: "Regular", price: 120, cutoff: "2026-07-01" }, + { label: "Late", price: 150, cutoff: "2099-12-31" }, + ] + const now = new Date().toISOString().slice(0, 10) + const currentTier = pricingTiers.find((t) => now < t.cutoff) ?? pricingTiers[pricingTiers.length - 1] + const baseTicketPrice = currentTier.price const accommodationPrices: Record = { "ch-multi": { label: "Bed in shared room (Commons Hub)", price: 279.30 }, @@ -133,7 +141,7 @@ export default function RegisterPage() { Event Registration - Early bird pricing available until March 31, 2026 + {currentTier.label} pricing — €{currentTier.price} @@ -143,7 +151,9 @@ export default function RegisterPage() {
CCG 2026 Ticket
- €80 Early bird (until Mar 31) · €120 Regular (Apr-Jun) · €150 Late (after Jul 1) + {pricingTiers.map((t, i) => ( + {i > 0 ? " · " : ""}€{t.price} {t.label}{t === currentTier ? " (current)" : ""} + ))}
CCA members: Bring two newcomers, get a free ticket!