Getting paid
Learn how to get paid with Stripe or Polar

Lorenzo
Author
Stripe
Stripe is a payment processor that allows you to accept payments online. NuxtFast integrates Stripe for both one-time and recurring payments.
One-time payments
Payment links:
The app uses Stripe’s Payment Links to enable one-time payments. When a user initiates a purchase, the backend creates a Stripe Payment Link or Checkout Session and redirects the user to Stripe’s secure payment page. After payment, Stripe redirects the user back to your app, where the payment status is confirmed.
- Backend endpoint:
/server/api/create-checkout-session-payment.ts - Flow: User clicks “Buy” → App calls backend → Stripe Checkout page → User pays → Redirect to success/fail page
Recurring payments (SaaS subscriptions)
Create a checkout page
For subscriptions, the app uses Stripe Checkout Sessions configured for recurring products. When a user selects a subscription plan, the backend creates a Checkout Session with the appropriate Stripe product and price IDs. The user is redirected to Stripe’s hosted checkout page to complete the subscription.
- Backend endpoint:
/server/api/create-checkout-session.ts - Flow: User selects plan → App calls backend → Stripe Checkout page → User subscribes → Redirect to success/fail page
Webhooks:
Stripe webhooks are used to listen for payment and subscription events (e.g., payment succeeded, subscription canceled). The backend processes these events to update user access and billing status.
- Webhook handler:
/server/api/webhooks/stripe-webhook.ts
This webhook will modify the user's subscription status in the database.
Polar
Polar is also a payment processor that allows you to accept payments online. But is a new player in the market and it's built on top of Stripe. It's trying to make it easier to manage subscriptions and payments.
One-time payments
The app can generate Polar payment links for one-time purchases. Users are redirected to Polar’s payment page, and after payment, Polar notifies your backend via webhooks.
Recurring payments (SaaS subscriptions)
For subscriptions, the app creates recurring payment links or checkout pages using Polar’s API. Users complete the subscription on Polar, and the backend updates user access based on webhook notifications.
Payment links
Both Stripe and Polar support payment links, which are generated by the backend and sent to the frontend for user redirection.
Checkout pages
Checkout pages are hosted by Stripe or Polar, ensuring PCI compliance and a secure payment experience.
Webhooks
The app listens for webhook events from both Stripe and Polar to keep user payment status in sync.
- Stripe:
/server/api/webhooks/stripe-webhook.ts - Polar:
/server/api/webhooks/polar.post.ts
API
The backend exposes endpoints to create payment and subscription sessions, and to handle webhook notifications, ensuring seamless integration with both Stripe and Polar.