One-Time Payments
This guide explains how to configure one-time payments in your SaaS using Stripe. One-time payments are ideal for products or services that require a single payment, rather than recurring subscriptions.
Create Product and Pricing in Stripe
- Log in to your Stripe Dashboard.
- Navigate to Products and click Add Product.
- Fill in your product details (name, description, images).
- Create a Price for the product:
- Set Pricing model to One-time.
- Enter the price in your preferred currency.
- Click Save to generate a price ID.
Copy Price ID to .env.local
After creating the product and price, Stripe will generate a Price ID (e.g., price_1MjK2x2eZvKYlo2C3G7abcde).
Add this price ID to your .env.local file:
NEXT_PUBLIC_STRIPE_ONETIME_PRICE_ID=price_1MjK2x2eZvKYlo2C3G7abcde
This allows the to reference the price when creating Stripe Checkout sessions.
Remove Unneeded Subscription Price IDs (Optional)
If your project does not require subscriptions, you can safely remove any subscription price IDs from .env.local and configuration files.
This keeps your project clean and avoids accidental subscription creation.
Include OnetimePricingSection in Landing Page
To display the one-time payment option on your landing page, import and include the OnetimePricingSection component in:
app/(public)/(landing)/page.tsx
Example usage:
import { OnetimePricingSection } from "@/components/landing/OnetimePricingSection"
export default function LandingPage() {
return (
<>
{/* Other landing sections */}
<OnetimePricingSection />
</>
)
}
This component automatically pulls the price ID from your environment variables and renders the checkout button for users.
Tips
- Always test one-time payments in Stripe test mode before going live.
- Ensure the
.env.localprice ID matches the product in your Stripe dashboard. - Customize the
OnetimePricingSectionUI as needed to match your branding.