Stripe Payments


Overview

Slotara uses Stripe Checkout to collect subscription payments from your tenants (the businesses that sign up on your platform). When a new business registers on a paid plan, they are redirected to a Stripe-hosted checkout page to enter their card details.

{success.fa-shield} Stripe Checkout is fully hosted by Stripe โ€” PCI compliance, 3D Secure, and error handling are included. You never touch raw card data.

Stripe handles:

  • New tenant subscription sign-up (checkout redirect at registration)
  • Subscription renewal (automatic recurring billing)
  • Subscription cancellation and plan changes
  • Sending invoices and payment receipts to tenants

{primary.fa-credit-card} Stripe is the default, but not the only choice. Under Admin โ†’ Settings โ†’ Payments you can select the platform gateway โ€” Stripe, Razorpay, PayPal, Paddle, or Paystack โ€” for tenant subscriptions. Paystack subscriptions use a per-plan Plan code (PLN_โ€ฆ, set in Admin โ†’ Subscription Plans) and a full lifecycle webhook at /paystack/webhook (subscription.create, charge.success, invoice.payment_failed, subscription.disable) that activates, renews, and suspends tenants automatically.


Credentials Setup

Admin โ†’ Settings โ†’ Payments

Enter your Stripe keys in the Admin Settings panel and your .env file:

Field Where to Find It Example
Stripe Publishable Key Stripe Dashboard โ†’ API Keys pk_live_...
Stripe Secret Key Stripe Dashboard โ†’ API Keys sk_live_...
Webhook Signing Secret Stripe Dashboard โ†’ Webhooks โ†’ Signing Secret whsec_...
STRIPE_KEY=pk_live_...
STRIPE_SECRET=sk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...

{danger.fa-ban} Keep your Secret Key (sk_live_...) private. Never commit it to version control or expose it in client-side code.


How Subscription Billing Works

When a business registers on a paid plan:

Business owner fills in registration form
          โ†“
Selects a paid subscription plan
          โ†“
Redirected to Stripe Checkout (hosted payment page)
          โ†“
         / \
   Payment   Payment
   Succeeds  Fails / Abandoned
       โ†“           โ†“
  Stripe sends   Registration
  webhook event  not completed
       โ†“
  Tenant automatically provisioned
  Welcome email sent to owner
  Business Panel accessible

For subscription renewals, Stripe handles billing automatically on the renewal date. If a payment fails, Stripe retries according to your Stripe Dashboard dunning settings.

When a subscription is cancelled or expires:

  • The tenant's booking page is suspended automatically
  • Clients visiting the booking page see an unavailable message
  • The business owner receives a notification to resubscribe

Creating Paid Plans

You do not create the Stripe product yourself. When you save a paid plan, Slotara creates the Stripe Product and one recurring Price for each paid billing cycle, then stores the Price ID on the plan.

  1. Add your Stripe secret key under Admin โ†’ Settings โ†’ Payments
  2. Go to Admin โ†’ Subscription Plans and create or edit a plan
  3. Set the price and billing cycle. Leave Stripe Price ID empty
  4. Save. Slotara creates the product and price in the Stripe account those keys belong to, and fills in the Price ID

The Price ID field is read-only after that. It is there so you can see the ID Stripe assigned. Prices are created in USD, matching the plan price field.


Webhook Configuration

Slotara listens for Stripe events at:

https://yourdomain.com/stripe/webhook

Step 1 โ€” Register the webhook in Stripe:

  1. Go to Stripe Dashboard โ†’ Developers โ†’ Webhooks
  2. Click + Add endpoint
  3. Enter your endpoint URL: https://yourdomain.com/stripe/webhook
  4. Under Events to send, add:
    • checkout.session.completed
    • customer.subscription.updated
    • customer.subscription.deleted
  5. Click Add endpoint

Step 2 โ€” Copy the signing secret:

  1. Click on your newly created webhook
  2. Under Signing secret, click Reveal
  3. Copy the whsec_... value
  4. Paste it into Admin โ†’ Settings โ†’ Payments โ†’ Webhook Secret and your .env

{danger.fa-ban} Without a valid Webhook Secret, Slotara cannot verify that events genuinely came from Stripe. Tenant provisioning after payment will not work.


Testing Payments

Use Stripe test mode keys (pk_test_... / sk_test_...) during development. Test transactions don't charge real cards.

Test card numbers:

Card Number Scenario
4242 4242 4242 4242 Payment succeeds immediately
4000 0000 0000 9995 Card declined
4000 0025 0000 3155 3D Secure authentication required

Expiry: any future date (e.g. 12/34) ยท CVC: any 3 digits ยท ZIP: any 5 digits

For local webhook testing, use the Stripe CLI:

# Install Stripe CLI, then:
stripe listen --forward-to http://localhost:8000/stripe/webhook

The CLI prints a local signing secret (whsec_test_...) โ€” use this in your local .env.


Troubleshooting

Symptom Likely Cause Fix
Tenant not provisioned after payment Webhook not reaching server Check Stripe Dashboard โ†’ Webhooks โ†’ recent deliveries
Webhook signature verification failed Wrong STRIPE_WEBHOOK_SECRET Re-copy the signing secret from Stripe and update .env
Webhook fails with 419 (CSRF) Webhook route not CSRF-excluded The /stripe/webhook route is excluded from CSRF in bootstrap/app.php โ€” confirm it is present
Redirect back from Stripe shows error APP_URL mismatch Ensure APP_URL in .env matches your actual domain
Plan's Stripe Price ID missing Stripe keys were empty when the plan was saved, or the Stripe API returned an error Add the secret key, edit the plan and save again. The Price ID is filled in automatically