How to build a system in the vibe coding era · Site post

How do you connect payments to an app? The button is the easy part.

"Connect Stripe for me" is a prompt that works. Within minutes there's a pay button, a checkout page, and someone pays and gets access. It's an exciting moment, because suddenly there's a business.

A post written for the site. Beside it, the lines I want to stay with you after reading.

But almost everything that matters about money happens after the button. When the card is declined in the second month. When the customer asks for a refund. When two people pay for the same place. When the payment went through, and the confirmation wasn't recorded.

What happens when someone pays, in one line

The customer pays at the payment provider, not with you. The payment provider sends your system a message that the payment went through. Your system updates what it remembers. Those are three steps, and at each of them something can go wrong silently.

That message is called a webhook. It's how the payment provider tells you what happened. And if the system doesn't listen to it, or listens the first time and not the second, it doesn't know.

Decision 1: who knows the payment failed

A subscription system. The customer signed up, paid, got access. The next month the charge fails, and nobody knows: not the customer, not the system, not you. Access continues, and the money doesn't. The full case here.

And the question after it is entirely a business one: block immediately, or give a few days of grace? Immediate blocking protects revenue, and loses customers whose card simply expired. Grace keeps them, and costs a few days of free use. There's no single right answer. There's your answer.

Decision 2: what was promised, and what the system enforces

The pricing page is a promise. "Cancel anytime", "full refund within 14 days", "instant upgrade". Every such sentence is a rule the system has to enforce. And very often, what the page says and what the system does are two different things.

The pricing page isn't marketing. It's the system's rulebook, written by someone who didn't ask the system.

What happens on a mid-month cancellation? What happens to credits when someone downgrades? What happens on an upgrade, do they pay the difference? All of these are business decisions. The AI will implement whatever it guesses, if you don't tell it. The Rulebook skill goes through them one by one.

Decision 3: what happens when two people want the same thing

At two thirty, two people clicked "book" on the same slot in the same second. Both got a confirmation. And for a third, the payment went through and the confirmation failed: the money left, the booking wasn't recorded, and nobody knew. The full case here.

In the demo this doesn't happen, because the demo has one user. In the world it happens on the busiest day, exactly when you least want it to.

What's a pipe and what's a wall

  • Pipe: which payment provider, what the checkout page looks like, which payment methods you accept.
  • Wall: what's the source of truth for payment, what happens when it fails, what was promised to the customer, and what happens when two compete for the same thing. Once real money moves, a mistake here is a refund, an angry customer, or money that wasn't collected and nobody noticed.

And one more thing, which is a wall in itself: don't collect credit card details in your own system. A checkout page hosted by the payment provider takes a large part of the responsibility off you, and on some free services it's also a term of use.

What to ask the AI

Before you connect payment, write me: what's the source of truth for every payment, what happens when a payment fails, when a customer cancels, when a refund is requested, and when two people pay for the same thing. For each, suggest options with their price, and don't choose for me.

How you know it holds

In the payment provider's test environment, not with real money:

  • Pay with a test card that gets declined, and check what the user sees and what the system remembers.
  • Send the same webhook twice, and check the subscription wasn't extended twice.
  • Two users book the same place at the same moment. Only one succeeds.
  • Cancel mid-month, and check that what happened is what the pricing page says.

Money doesn't break on the day you connect it. It breaks in the second month.

Previous in the series: users and permissions. Next: AI inside the product.

A question for you

What's written on your pricing page that you're not sure the system actually enforces?

Did a post meet you in your system?

Half an hour, the system open, free. You leave with your open decisions.

or on WhatsApp, if it's a single question. Nothing is stored on the site.