Documentation
PaymentsOverview

Overview

Learn how to integrate payment processing in your application using various payment providers.

The packages/payments package provides a unified interface for handling payments across multiple payment providers. This allows you to easily switch between providers or support multiple providers simultaneously without changing your application code.

Supported Providers

The payments package supports the following payment providers:

  • Stripe - The most popular payment processor with comprehensive features for subscriptions, one-time payments, and seat-based billing.
  • Lemon Squeezy - Merchant of record platform with automatic tax handling, perfect for digital products and global sales.
  • Dodo Payments - Modern payment infrastructure for SaaS with subscription and usage-based pricing support.
  • Polar - Open-source payment platform built for developers with transparent pricing and developer-friendly APIs.

Features

All payment providers support the following core features through a unified API:

  • Checkout Links: Create payment checkout sessions
  • Customer Portal: Allow customers to manage their subscriptions
  • Subscription Management: Cancel, update, and manage subscriptions
  • Seat Management: Adjust subscription quantities (provider-dependent)
  • Webhook Handling: Process payment events automatically
  • Trial Periods: Offer free trials (provider-dependent)
  • Affiliate Tracking: Track referrals with Rewardful or PromoteKit (Stripe only)

Quick Start

  1. Choose your payment provider in config/index.ts
  2. Configure environment variables for your chosen provider in .env.local
  3. Set up webhook endpoints to receive payment events
  4. Start accepting payments!