AI Folks
  • Courses
  • Web Of AI
  • Pricing
  • Enterprise
Log in
PreviousTransactional email with ResendNextWebhooks: know who paid

Vibe Coder · Unit 18: Email, Payments and Commerce · Lesson 2 of 5

Taking payments with Stripe

Charge for your product without touching a card number. Products and prices, a Stripe-hosted checkout page, test mode, and one-time payments versus subscriptions.

Read the short notes and pictures.Do everything inside a blue frame.

Charging without handling cards

Taking payments sounds like the hardest part of a product. It used to be. With a payment provider you never store or even see a card number. The customer types it into a page the provider runs, and the provider tells your app what happened. Your job is to describe what you sell and to react correctly when someone has paid.

A dark wooden desk, hand-drawn. Three boxes: your app’s buy button, Stripe’s page that takes the card, and back to your app with the result.
The card is entered on Stripe’s page, not yours.

Products and prices

Product

What you sell: "Tally Studio plan".

Price

An amount and a currency attached to a product. A product can have several.

One-time

Charged once.

Recurring

Charged every month or year: a subscription.

Customer

Stripe’s record of a person who has paid you.

The checkout

Stripe Checkout is built on the Checkout Sessions API and comes in three forms: a full page, an embedded form and custom Elements. Stripe recommends the full page, which is hosted by Stripe or embedded, and it needs the least upkeep. Use that.

A dark wooden desk, hand-drawn. Four nodes: buy button, create a checkout session on your server, Stripe checkout page, success page.
Your server creates a session; Stripe hosts the page.
  1. 1

    The user clicks "buy"

    In your app.

  2. 2

    Your server creates a checkout session

    It tells Stripe which price, and which of your users is paying.

  3. 3

    The user is sent to Stripe’s page

    They pay there.

  4. 4

    Stripe sends them back

    To a success page in your app.

  5. 5

    Stripe also tells your server

    Through a webhook. That is the next lesson, and it is the part that matters.

No-code start

Create a product and price in the
dashboard.
Create a Payment Link.
Put the link on your landing page.

In your app

Ask your builder or coding agent:
"Add Stripe Checkout for the Studio
plan. Create the session on the server.
Attach the signed-in user’s id.
Send them to a success page after."
A Payment Link is enough to make a first sale. An account-based product needs the session, so you know who paid.

Builders and agents know Stripe

Lovable and Bolt both have Stripe integrations: you connect your own Stripe account. For coding agents, Stripe publishes agent skills; its docs say to install the Stripe CLI and run "stripe agent setup".

Keys and test mode

Publishable key

Safe in the browser.

Secret key

Server only. It can charge and refund. Treat it like a password.

Test mode

A separate set of keys and data. No real money moves.

Test card

In test mode, 4242 4242 4242 4242 with any future date succeeds.

The success page proves nothing

A person can open your success page address without paying. Never unlock a paid feature because someone reached that page. Unlock it only when Stripe’s webhook tells your server the payment succeeded.

Before you charge real money

  1. 1

    Decide what you sell and for how much

    One plan is enough to start.

  2. 2

    Know your tax position

    Rules depend on where you and your customers are. Stripe has tax tools, and a Managed Payments option that takes on tax compliance. Ask an accountant.

  3. 3

    Write a refund policy

    And link it at checkout.

  4. 4

    Complete Stripe’s account verification

    Before you can accept live payments.

ActivityYour turnWrite it yourself first, then compare.

Your product has a free plan and one paid plan at a monthly price. What do you create in Stripe, and what does your app need to remember about each user?

ActivityBuild stepA product that can charge

Add a checkout in test mode

In Stripe test mode, create your product and price. Add a buy button to your app that opens Stripe Checkout for the signed-in user and returns to a success page. Pay with the test card.

Done when

Paid features must stay locked for now. The next lesson unlocks them properly.

Keep these

  • The customer pays on Stripe’s page; you never see the card.
  • A product has prices: one-time or recurring.
  • Build in test mode, and never trust the success page.
Previous lessonTransactional email with ResendNext lessonWebhooks: know who paid