providers.tsx
: Configures OnchainKit providers.page.tsx
: Main ticketing page and UI..env
: Stores API keys..env
:
productId
.page.tsx
:
"YOUR_PRODUCT_ID"
with your actual product ID.page.tsx
, add inputs for name, email, and ticket count:
useSearchParams
to get user data:
app/api/createCharge/route.ts
:
confirmation/page.tsx
, add a handler to call the backend:
Name
: Ticket namePrice
: Price per ticketInventory
: Available quantity of ticketsImage
: Event or ticket imageDescription
: Brief description of the ticket or event.env.local
:app/api/fetchTickets/route.ts
:
app/api/updateInventory/route.ts
to reduce inventory:
useEffect
, displaying available tickets and marking sold-out items:
confirmation/page.tsx
, after successful payment, reduce inventory: