Stripe Payments
Accept card payments from your clients using Stripe Checkout.
Overview
BilloraX uses Stripe Checkout (hosted payment page) to collect payments. When a client clicks "Pay now" on an unpaid invoice, they are redirected to Stripe.
After a successful payment, the webhook marks the invoice as PAID, records the transaction, and advances the service renewal date.
Setup
Add your Stripe keys to .env:
STRIPE_SECRET_KEY="sk_live_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_live_..."Webhook
Register the webhook endpoint in your Stripe Dashboard β Developers β Webhooks. The endpoint URL is:
- Event to listen: checkout.session.completed
- Copy the webhook signing secret into STRIPE_WEBHOOK_SECRET
https://your-domain.com/api/webhooks/stripe Pay button
The "Pay now" button appears automatically on invoice detail pages when the invoice status is UNPAID or OVERDUE.
It submits a server action that creates a Stripe Checkout session and redirects the client.
Success page
After a successful payment, Stripe redirects to /portal/pay/success?invoice={id}. This page shows a confirmation and links back to the invoice.