Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Server-only Paystack secret. Never expose this with a NEXT_PUBLIC_ prefix.
PAYSTACK_SECRET_KEY=sk_test_replace_me

# Student ticket settings. The price is entered in whole Kenyan shillings.
STUDENT_TICKET_PRICE_KES=1000
STUDENT_TICKET_CURRENCY=KES
STUDENT_TICKET_SALES_ENABLED=false
STUDENT_EMAIL_DOMAIN_SUFFIXES=ac.ke,edu
# Optional comma-separated additions to the built-in public provider blocklist.
STUDENT_EMAIL_BLOCKED_DOMAINS=

NEXT_PUBLIC_BASE_URL=http://localhost:3000
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ yarn-error.log*

# env files (can opt-in for committing if needed)
.env*
!.env.example

# vercel
.vercel
Expand Down
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,33 @@ bun dev
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `src/app/page.tsx`. The page auto-updates as you edit the file.

## Student ticket payments

Student checkout is available at `/tickets/student` and uses Paystack InlineJS,
so payment opens in a modal without redirecting away from the website. Copy
`.env.example` to `.env.local`, add a Paystack test secret key and ticket price,
then set `STUDENT_TICKET_SALES_ENABLED=true` to enable checkout.

The ticket amount is configured in whole Kenyan shillings and converted to
Paystack's subunit amount on the server. The Paystack secret is server-only and
must never use a `NEXT_PUBLIC_` prefix.

Configure this webhook URL in the Paystack dashboard:

```text
https://pycon.ke/api/payments/paystack/webhook
```

For local webhook testing, expose the local server through an HTTPS tunnel and
temporarily register the resulting `/api/payments/paystack/webhook` URL in the
Paystack test dashboard. The endpoint validates the `x-paystack-signature`
header before acknowledging an event.

Run the project checks with:

```bash
npm test
npm run lint
npm run build
```
Loading