A few years ago, I helped a friend launch a side hustle selling online coaching programs.
We built her site, styled the brand, and set up her store.
But when it came time to actually accept payments, the magic started to feel... technical. 🤯
"Wait, how do I collect credit cards?" she asked.
That moment introduced me to Stripe — the tool that now powers payments for millions of businesses online, from side hustles to massive marketplaces.
So, in this post, I’m walking you through how to accept payments using Stripe, step by step — with the same approach I took to help her.
For this example, we'll create a checkout experience for a handmade lavender candle.
After clicking the "Checkout Now" button, you’re directed to a secure payment page to complete your purchase.
Instead of redirecting the user to a separate page, the checkout process will appear in a pop-up.
This allows users to stay on the same page while completing their purchase.
Now that you've seen how the checkout looks, let's dive into what Stripe is and how it makes this possible.
Stripe is a developer-first payments platform.
It's like the engine behind checkout buttons on websites and apps you probably use every day — like Notion, Substack, or Kickstarter.
The best part? You don’t need to reinvent the wheel.
Stripe gives you:
Let’s dive into setting this up like a pro — without getting overwhelmed.
First things first: Create a Stripe account if you haven’t already.
Once you're in, head over to your Dashboard to grab your API keys. These are like passwords that let your app talk to Stripe.
In test mode, you'll see two keys:
# In your .env file STRIPE_SECRET_KEY=sk_test_51...
Let’s get our backend set up. In this tutorial, we’re using Node.js, but you can adapt this for Python, Ruby, PHP, or whatever backend you’re comfortable with.
npm install stripe
Then, in your backend server:
// server.js or api/checkout.js import Stripe from 'stripe'; const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
Cool, Stripe’s installed and ready to go.
Let’s say you’re selling one product — like a candle. Here’s how you can kick off a Stripe Checkout session.
export default async function handler(req, res) { const session = await stripe.checkout.sessions.create({ payment_method_types: ['card'], mode: 'payment', line_items: [ { price_data: { currency: 'usd', product_data: { name: 'Handmade Lavender Candle', }, unit_amount: 2500, // in cents = $25.00 }, quantity: 1, }, ], success_url: 'https://yourdomain.com/success', cancel_url: 'https://yourdomain.com/cancel', }); res.status(200).json({ url: session.url }); }
That’s it. You call this endpoint from your frontend, and Stripe gives you a link that opens a secure, beautifully designed checkout page.
Pro tip: Use Stripe’s test card numbers to simulate payments. No real money involved.
Imagine your user pays — how does your backend know?
That’s where webhooks come in. Stripe pings your server when events happen, like a payment succeeding.
ou can listen for those and trigger actions (e.g., send a confirmation email or unlock access).
import { buffer } from 'micro'; export const config = { api: { bodyParser: false, }, }; const endpointSecret = 'whsec_...'; export default async function handler(req, res) { const buf = await buffer(req); const sig = req.headers['stripe-signature']; let event; try { event = stripe.webhooks.constructEvent(buf, sig, endpointSecret); } catch (err) { return res.status(400).send(`Webhook error: ${err.message}`); } if (event.type === 'checkout.session.completed') { const session = event.data.object; console.log('✅ Payment succeeded for session:', session.id); // Do something awesome here } res.status(200).json({ received: true }); }
You can set up webhooks in your Stripe dashboard or locally using the Stripe CLI:
stripe listen --forward-to localhost:3000/api/webhook
If you followed along, you’ve:
Now you’re not just selling products — you're building real commerce workflows.
Stripe does an amazing job of letting you focus on what makes your business great — not just on the plumbing underneath.
So go ahead, build that custom store, sell those digital downloads, or launch that course.
And if you ever get stuck? I’ve been there. I can help.
Want to see how I can help? Let’s build something together →
Stay updated with the latest trends in web design and development. Our newsletter delivers expert insights, tips, and industry news to help your business thrive online.