June 14, 2026Engineering

How I Add Payments To A Product Without The Leaks

The checkout button is the easy 10% of payments. The other 90% is webhooks and edge cases, and it is where products quietly leak money or hand out access for free. Here is how I keep the money landing correctly.
Payments Integration
Stripe
Subscriptions
Webhooks
SaaS
There is a comforting lie in software that says adding payments is a one afternoon job. Drop in a checkout, take a card, ship it. The lie holds right up until the first card fails on renewal and the customer keeps full access, or a webhook fires twice and someone gets double the credits they paid for. The button was never the hard part. Keeping the money landing correctly in every messy case is, and here is how I handle it. Any payment provider will give you a checkout in an afternoon. That part is genuinely easy now, and it lulls people into thinking the whole job is easy. It is not. The checkout is maybe ten percent of a real integration. The other ninety percent is the part nobody demos, what happens after the payment, and around the payments that do not go cleanly. That ninety percent is failed renewals, refunds, upgrades and downgrades mid cycle, webhooks that arrive twice or out of order, and the eternal question of what your own database believes about who has paid. Skip it and you do not notice for a while. Then you find customers with access they are not paying for, or paying customers locked out, and you are reconciling it by hand. The single most common payments mistake is granting access based on the checkout redirect. The redirect only tells you the customer clicked the pay button and got bounced back to your site. It does not tell you the money actually moved, and it can be faked or interrupted. The webhook, sent server to server from the provider, is what tells you the payment truly succeeded. So the rule I build around is simple. Your own database is the source of truth for who has access, and it is kept honest by reconciling against webhooks, never by trusting a redirect. A customer gets access when the webhook confirms the money landed, and loses it when a webhook says the subscription lapsed. Everything flows from that. Webhooks are not reliable in the way you wish they were. They can arrive twice, arrive late, or arrive out of order. If your handler grants 100 credits every time it sees a payment event, a duplicated event just gave someone 200. So every webhook handler has to be idempotent, meaning processing the same event twice has the same result as processing it once. In practice that means recording which events you have already handled and refusing to act on a repeat. It is a small amount of code that prevents a whole category of money losing bugs, and it is the kind of thing that separates an integration that survives contact with reality from one that slowly corrupts your billing state. The cases that feel like edge cases are not rare, they are just inconvenient. Renewal cards fail constantly. People upgrade halfway through a cycle and expect fair proration. Refunds need to actually revoke access, not just return money. A customer portal, where people manage their own billing, saves you from being a manual billing department. None of these are optional if you want billing you can trust, so I build them on purpose rather than discovering them in a support ticket. I have shipped this on live products taking real money. Tool Index takes payment inline on the page and stays in sync through webhooks, and I built the subscription and usage credit billing for Apatero Studio, which has real paying customers. These are in production, charging real people, which is exactly where the ugly cases show up and have to be handled. If you are adding payments and want the money to land correctly instead of leaking, that is the work I do. The Payments and Subscriptions Integration service page is the place to start. Why is it harder than it looks? The checkout button is the easy ten percent. Webhooks and edge cases are the rest, and they are where products leak money or access. What is the most common mistake? Trusting the checkout redirect instead of the webhook. The webhook is what confirms the money actually moved. Stripe, Whop, or Lemon Squeezy? It depends on what you sell, your margins, and your country. I recommend from your specifics, not a default. Can you add this to my product? Yes, it is one of my services. The service page explains how it works.

Frequently asked questions

Why is adding payments harder than it looks?

Because the checkout button is the easy part. The hard part is everything after the payment, keeping your database in sync with what the provider actually did through webhooks, and handling failed renewals, refunds, duplicate events, and mid cycle upgrades. Get those wrong and you have customers who paid and got nothing, or stopped paying and kept everything.

What is the most common payments mistake?

Trusting the checkout redirect instead of the webhook. The redirect tells you the user clicked pay. The webhook tells you the money actually moved. If you grant access on the redirect, you can hand out paid features to people whose payment later failed. The database should be reconciled against webhooks, which are the source of truth.

Stripe, Whop, or Lemon Squeezy?

It depends on what you sell, your margins, and your country. They differ in fees, in how much they handle for you, and in what they support. The right answer comes from your specifics, not from a default, which is why I ask before recommending.

Can you add this to my product?

Yes, this is one of my services. The Payments and Subscriptions Integration service page explains how an engagement works, and you can book a call from there.
How I Add Payments To A Product Without The Leaks | Kevin Gabeci