Adding Payments to Your App

A reference guide for when you're ready to accept payments. This isn't part of the core course build, but once your app needs billing, this is how to approach it.

Two Options: Stripe vs GoCardless

Stripe

Card Payments

Best for: One-off payments, international customers, getting started quickly

  • Accepts credit/debit cards, Apple Pay, Google Pay
  • Money arrives in your bank account in 2–3 days
  • Fees: ~2.5% + 20p per transaction (UK cards)
  • Very easy to integrate — Claude knows Stripe well
  • Test mode lets you simulate payments without real money
  • Stripe Checkout gives you a hosted payment page with zero frontend work

Use Stripe when: You're charging one-off fees, selling to international customers, or just getting started with payments.

GoCardless

Direct Debit

Best for: Recurring subscriptions, UK/EU customers, lower fees at volume

  • Collects payments directly from bank accounts via Direct Debit
  • Money arrives in 3–5 working days (slower than Stripe)
  • Fees: ~1% + 20p per transaction (significantly cheaper than cards)
  • Better for subscriptions because customers don't need to update expired cards
  • Requires customers to set up a Direct Debit mandate (slightly more friction upfront)
  • Less international coverage than Stripe

Use GoCardless when: You have recurring monthly charges, your customers are UK/EU based, and you want lower fees.

The Simple Answer

Start with Stripe. It's faster to set up, Claude handles it well, and it works for everything. If you later have enough subscription customers that the fee difference matters, add GoCardless alongside it.

How to Add Stripe to Your App

"I want to add payments to my app using Stripe Checkout. When a user clicks 'Subscribe' or 'Pay', redirect them to a Stripe-hosted checkout page. After payment, redirect them back to my app. Use Stripe's test mode first so I can test without real money."

What You'll Need

  1. 1A Stripe account (free to create at stripe.com)
  2. 2Your Stripe API keys (found in the Stripe dashboard under Developers → API Keys)
  3. 3Add these to your .env.local: STRIPE_SECRET_KEY, STRIPE_PUBLISHABLE_KEY, STRIPE_WEBHOOK_SECRET

What Claude Will Build

  • An API route that creates a Stripe Checkout session
  • A redirect to Stripe's hosted payment page
  • A success/cancel page for after payment
  • A webhook endpoint that listens for payment confirmations

How to Add GoCardless to Your App

"I want to add recurring payments using GoCardless. When a user subscribes, redirect them to GoCardless to set up a Direct Debit mandate. After setup, GoCardless will collect payments automatically each month. Use the sandbox environment first."

What You'll Need

  1. 1A GoCardless account (free to create at gocardless.com)
  2. 2Your GoCardless API keys (found in Developers section)
  3. 3Add to .env.local: GOCARDLESS_ACCESS_TOKEN, GOCARDLESS_WEBHOOK_SECRET

Testing

Both Stripe and GoCardless have test/sandbox modes. Always build and test in sandbox mode first. Stripe provides test card numbers (4242 4242 4242 4242 works for successful payments). GoCardless provides a sandbox with test bank details. Only switch to live mode when everything works in testing.