Home » Building a SaaS Product » Payment Processing

How to Add Payment Processing to Your SaaS

Payment processing is what turns your SaaS from a free tool into a business. The platform supports both Stripe and PayPal for accepting payments, with built-in support for one-time charges, recurring subscriptions, and credit-based billing. Your customers pay through a branded checkout experience on your domain.

Choosing a Payment Provider

Stripe

Stripe is the most popular payment processor for SaaS products. It handles credit card payments, subscriptions, invoicing, and international currencies. Stripe charges 2.9% + $0.30 per transaction in the US. Setup requires creating a Stripe account and connecting your API keys to the platform.

PayPal

PayPal is a good secondary option because some customers prefer it, especially international customers who do not have credit cards with their bank. PayPal charges similar fees to Stripe. The platform supports PayPal through its IPN (Instant Payment Notification) webhook system.

For most SaaS products, start with Stripe and add PayPal later if customers request it. Stripe has better developer tools, more flexible subscription management, and is the standard in the SaaS industry.

Payment Flow

Step 1: Customer selects a plan.
Your pricing page (either on your marketing site or within the admin panel) shows available plans with prices and features. The customer clicks to subscribe.
Step 2: Redirect to payment.
The customer is redirected to a Stripe or PayPal checkout page to enter their payment details. For Stripe, you can use Stripe Checkout (a hosted payment page) or Stripe Elements (embedded card fields on your own page).
Step 3: Payment confirmation.
After successful payment, the customer is redirected back to your admin panel. The platform records the transaction and updates the account's credit balance or subscription status.
Step 4: Webhook processing.
The payment provider sends a webhook to your app confirming the payment. Your webhook handler processes this notification, updates the account, and logs the transaction for dispute tracking.

Billing Models on the Platform

Credit-Based Billing

The simplest model for usage-based SaaS products. Customers buy credits that are consumed as they use features. The platform tracks credit balances automatically and can check the balance before allowing operations. This works well for products where usage varies significantly between customers.

Subscription Billing

For fixed monthly or annual plans, use Stripe Subscriptions. Stripe handles recurring charges, failed payment retries, and subscription management. You store the subscription status in the customer's account record and check it before granting access to plan-specific features.

Hybrid Model

Many SaaS products combine subscriptions with usage credits. A monthly subscription gives access to the product and includes a base amount of credits. Additional credits can be purchased as needed. This provides predictable revenue from subscriptions while allowing heavy users to pay more through credit purchases.

Handling Failed Payments and Disputes

Stripe automatically retries failed subscription payments over a configurable period (typically 3-4 attempts over 2 weeks). You should handle the "payment_failed" webhook to notify the customer and optionally restrict access after repeated failures.

For disputes (chargebacks), the platform stores a transaction index that maps transaction IDs to account IDs. This lets you look up which customer a disputed transaction belongs to and provide evidence to the payment provider.

Important: Never store credit card numbers in your own database. Stripe and PayPal handle all sensitive payment data. Your application only stores tokens and transaction references.

Accept payments for your SaaS with Stripe and PayPal integration. One-time charges, subscriptions, and credit-based billing supported.

Get Started Free