Payments
Saves up to 60 hours

Payments

Handle payments such as one-time, or recurring payments with Stripe..

Installed by Default

Table of Contents

Overview

The Payments Plugin lets you integrate Stripe into your FastStartup project quickly and easily.

It handles:

  • Stripe webhook events
  • Creating subscription checkout sessions

If you need to monetize your SaaS with subscriptions or one-time payments, this plugin has you covered.

Key Features

  • Built-in Stripe integration.
  • Supports subscription-based payments.
  • Webhook already setup.
  • Ready to use in FastStartup monetization templates.

Use Cases

  1. Subscription Plans: Offer premium access for different user roles.
  2. Monetize Fast: Connect Stripe and start accepting payments in minutes.
  3. Webhooks: Automate Stripe events like successful payments or subscription cancellations.

If you're using the monetization template, this plugin works out-of-the-box.

Getting Started

  1. Set up your Stripe keys:

    • Go to your Stripe dashboard and get these keys:
      • STRIPE_PUBLISHABLE_KEY
      • STRIPE_SECRET_KEY
      • STRIPE_WEBHOOK_SECRET
  2. Add environment variables:

    STRIPE_PUBLISHABLE_KEY=your-publishable-key
    STRIPE_SECRET_KEY=your-secret-key
    STRIPE_WEBHOOK_SECRET=your-webhook-secret
    
  3. Register your webhook:

    • Visit the Stripe Webhook Docs.
    • Set the webhook URL to https://<your domain>/stripe/webhook in Stripe.
  4. Use the plugin in your code:

    import { createSubscriptionCheckoutSession } from "@/plugins/payments";
    
    • createSubscriptionCheckoutSession creates Stripe checkout sessions.
  5. Test and Deploy:

    • Run locally, test payments with Stripe test cards, and deploy when ready.
  6. After Successful Payment

    • User is upgraded to the entered role when creating the checkout session.

API Overview

FunctionDescription
webhookHandlerHandles incoming Stripe webhook events.
createSubscriptionCheckoutSessionCreates a Stripe checkout session for subscriptions.

Comparison to Alternatives

Instead of building a Stripe integration from scratch, this plugin saves you:

  • Time: No need to configure Stripe events manually.
  • Errors: Built-in webhook handling ensures reliability.
  • Setup Hassle: Environment variables and templates simplify the process.

Other tools like Paddle or Lemon Squeezy work for some, but this plugin is tailor-made for Stripe and FastStartup projects.

FAQ

1. How do I test Stripe payments?
Use Stripe test cards. Visit Stripe's Testing Guide for card details.

2. What happens if the webhook fails?
Stripe retries webhooks automatically. Make sure your webhook endpoint is correctly set up.

3. Can I use this for one-time payments?
Yes. While the main focus is subscriptions, you can use Stripe checkout sessions for one-time purchases.

4. Is the plugin customizable?
Yes. You can customize checkout sessions, user roles, and success/cancel pages.


Start accepting payments with Stripe in your FastStartup project today!

Tech Stack



Save 1,000+ Hours

By signing up, you agree with our Privacy Policy.

Build, Launch, and Grow Your SaaS

Get everything you need to launch your SaaS and land your first paying user—starting today.