How to accept payments on your website. Payment providers, checkout flows, and subscription billing. You'll need authentication so you know who's paying.
Don't worry — you won't write any payment code by hand. Your AI tool handles all the technical parts. This guide helps you understand the concepts so you can describe what you want.
The industry standard for online payments. Beautiful APIs, pre-built checkout pages, subscription billing, invoicing. Works globally.
All-in-one payments + tax handling. Acts as Merchant of Record so they handle sales tax globally. Great for digital products.
The original online payment. Huge user base. Good for international payments where users already have PayPal accounts.
Merchant of Record like Lemon Squeezy. Handles payments, taxes, and compliance. Popular for SaaS.
Redirect users to Stripe's checkout page. Easiest to implement, handles all compliance.
Pro Plan
One-time purchase
$29.00
"Add Stripe Checkout — redirect users to a hosted payment page when they click Buy."
Payment form embedded directly in your page. More control over the look and feel.
Payment Details
"Embed a Stripe payment form directly in our checkout page using Stripe Elements."
Fully custom payment UI. Most work but total design control. Requires PCI compliance.
Billing Address
Card Details
Order Summary
"Build a custom checkout form with card number, expiry, and CVV using Stripe's PaymentIntent API."
Automatically charge users monthly or yearly.
Let users try before paying. Usually 7 or 14 days.
Free, Basic, Pro, Enterprise — each with different features.
Charge based on usage (API calls, storage, seats).
Let users change their plan. Prorate the difference.
Handle gracefully. Often allow access until period ends.
Stripe sends events (payment succeeded, subscription canceled) to your server.
Let users manage their subscription, update payment, download invoices.
Automatic retries when a payment fails. Send emails to update card.
A visual mockup of a typical 3-tier pricing table you can ask AI to build:
Step-by-step AI prompts to set up each provider. Copy the prompts, paste into your AI tool, and follow along. Make sure your site is deployed before testing with real payments.
Stripe is the most popular choice. You'll create a Stripe account, get your API keys, and use AI to wire everything up. No coding needed on your part.
Step 1 — Set up Stripe Checkout
"Install Stripe in my Next.js app (npm install stripe @stripe/stripe-js). Create an API route at /api/checkout that creates a Stripe Checkout Session for a product called [Product Name] priced at [amount] USD. When the user clicks 'Buy Now', redirect them to the Stripe-hosted checkout page. After payment, redirect to /success. Use environment variables for the Stripe secret key."
Step 2 — Handle payment confirmation
"Create a /success page that shows a thank-you message after payment. Also create an API route at /api/webhooks/stripe that listens for Stripe webhook events. Handle 'checkout.session.completed' to confirm the payment went through. Log the customer email and amount paid. Use the Stripe webhook secret from environment variables to verify the request is real."
Step 3 — Add a customer portal
"Add a 'Manage Subscription' button that creates a Stripe Customer Portal session and redirects the user to it. The portal lets customers update their payment method, view invoices, and cancel their subscription. Create an API route at /api/portal to handle this. After they're done, redirect them back to /account."
Lemon Squeezy handles sales tax worldwide so you don't have to. Create your products in the Lemon Squeezy dashboard first, then use these prompts to connect it to your app.
Step 1 — Add checkout links
"I'm using Lemon Squeezy for payments. I already created a product in the Lemon Squeezy dashboard. Add a 'Buy Now' button to my pricing page that opens the Lemon Squeezy checkout overlay. My checkout URL is [paste your checkout URL from Lemon Squeezy dashboard]. Pass the customer's email if they're logged in so the checkout form is pre-filled."
Step 2 — Handle webhooks
"Set up a webhook endpoint at /api/webhooks/lemonsqueezy to receive Lemon Squeezy events. Handle 'order_created' to confirm a purchase and 'subscription_updated' to track plan changes. Verify the webhook signature using my LEMONSQUEEZY_WEBHOOK_SECRET environment variable. Save the customer's subscription status to my database."
Step 3 — Add a customer portal link
"Add a 'Manage Subscription' button on the account page. Use the Lemon Squeezy API to generate a customer portal URL for the current user. The portal lets them update payment info, switch plans, and cancel. My Lemon Squeezy API key is stored in the LEMONSQUEEZY_API_KEY environment variable."
PayPal is great when your customers already have PayPal accounts. Get your Client ID and Secret from the PayPal Developer Dashboard, then use these prompts.
Step 1 — Add PayPal buttons
"Add PayPal Smart Payment Buttons to my checkout page using the @paypal/react-paypal-js package. Show both the PayPal button and a Debit/Credit Card button. When the user clicks Pay, create an order for [amount] USD with the description [Product Name]. After payment is approved, capture the payment and redirect to a success page. Use my PayPal Client ID from the NEXT_PUBLIC_PAYPAL_CLIENT_ID environment variable."
Step 2 — Verify payment on server
"Create an API route at /api/paypal/capture-order that verifies and captures a PayPal payment on the server side. Accept the PayPal order ID from the frontend, call PayPal's API to confirm the payment is legitimate, and save the order details (customer email, amount, PayPal transaction ID) to my database. Use the PAYPAL_CLIENT_ID and PAYPAL_CLIENT_SECRET environment variables."
Step 3 — Add PayPal subscriptions
"Set up PayPal subscription billing. I already created a subscription plan in the PayPal dashboard with Plan ID [plan_id]. Add a 'Subscribe' button using the PayPal React SDK that starts the subscription flow. Handle the 'onApprove' callback to save the subscription ID. Create a webhook endpoint at /api/webhooks/paypal to handle PAYMENT.SALE.COMPLETED and BILLING.SUBSCRIPTION.CANCELLED events."
Paddle handles payments, taxes, and invoicing as a Merchant of Record. Create your products in the Paddle dashboard, grab your API key and Client Token, then use these prompts.
Step 1 — Add Paddle checkout
"Add Paddle.js checkout to my Next.js app. Load the Paddle script and initialize it with my client-side token from the NEXT_PUBLIC_PADDLE_CLIENT_TOKEN environment variable. Add a 'Buy Now' button that opens the Paddle checkout overlay for my product with price ID [price_id]. Pass the customer's email to pre-fill the form. After successful payment, redirect to /success."
Step 2 — Handle Paddle webhooks
"Create an API route at /api/webhooks/paddle to handle Paddle webhook events. Verify the webhook signature using my PADDLE_WEBHOOK_SECRET environment variable. Handle 'transaction.completed' for one-time purchases and 'subscription.activated' for new subscriptions. Save the customer's Paddle customer ID and subscription status to my database."
Step 3 — Manage subscriptions
"Add subscription management to my app using the Paddle API. Create an API route that generates a Paddle update payment method URL and a cancel subscription URL for the current user. Add 'Update Payment Method' and 'Cancel Subscription' buttons on the account page that redirect to these URLs. Use the PADDLE_API_KEY environment variable for server-side API calls."