Justine Acosta
JUSTINE ACOSTA · GMT+8 ·
All services
SERVICES / 08

Stripe payment integration

Money movement that survives retries, disputes and the edge cases nobody demos.

StripeWebhooksBilling08 / 10

What you get

  • Checkout, subscriptions or invoices, built around the failure paths as well as the happy one
  • Webhook handling that is idempotent, so a retry never charges or fulfils twice
  • Stripe Connect payouts that match how your business splits money
  • Reconciliation that catches drift between your records and Stripe
  • A runbook for disputes, refunds and failed payouts

Stripe payment integration looks simple in the documentation and gets complicated the moment real money moves: retries, failed cards, refunds, disputes and payouts to other people. I build checkout, subscriptions, invoicing and Stripe Connect marketplaces around those failure cases, not just the happy path.

The problem

Taking a first payment with Stripe takes an afternoon. Running payments as part of a business is different work. A webhook arrives twice and an order is fulfilled twice. A customer's card fails on renewal and they keep access for months because nothing handled the failure. A refund is issued in Stripe but the app still shows the order as paid. A marketplace seller is paid before the buyer's payment has cleared, then the buyer disputes it. At the end of the month, your records and Stripe's disagree and nobody can say why.

None of these show up in a demo. They show up as support tickets, lost revenue and long afternoons with the accountant. The processing fee is rarely the real cost; I break down what is in what Stripe payment integration actually costs.

How I approach it

I start with how your business actually moves money. One-off purchases, subscriptions, usage-based billing, invoices, deposits, or a marketplace that splits payments between sellers and the platform. Who gets paid, when, and what happens when something goes wrong. That map decides which Stripe products fit: Checkout, Elements, Billing, Invoicing or Connect.

Then the integration, built around failure. Stripe's hosted Checkout or Elements keeps card data off your servers, which keeps your PCI scope at its smallest. Every webhook is verified, so nobody can fake one, and processed idempotently, so handling the same event twice has the same effect as handling it once. Retries never charge or fulfil twice. Events that arrive out of order are handled correctly.

For subscriptions, the app's idea of who has access is driven by Stripe's events: trials, upgrades, downgrades, failed renewals and cancellations all update access in one place. Failed payments trigger Stripe's retry schedule and a clear message to the customer.

For marketplaces, Stripe Connect handles onboarding sellers, verifying their identity, splitting each payment and paying out on a schedule that matches when you're confident the money is safe. The flows you must get right are covered in building a Stripe Connect marketplace.

Reconciliation closes the loop. A scheduled check compares your records with Stripe's and flags any difference, so drift is caught in a day, not at year end.

Everything is built and tested in Stripe's test mode, including declined cards, disputes and webhook retries, before a live key is used.

I work with SaaS products and marketplaces in the US, EU and Canada.

Where it usually goes wrong

The first mistake is trusting the browser. The redirect after checkout is a hint; the webhook is the truth. Fulfil on the webhook.

The second is assuming each event arrives exactly once and in order. Neither is guaranteed.

The third is storing subscription state in two places that drift apart. Let Stripe's events drive access.

The fourth is paying sellers too early. Payout timing is a risk decision, not a default setting.

What you walk away with

A payment integration that handles the failures as carefully as the successes. Checkout, subscriptions, invoices or Connect payouts that match how your business splits money. Verified, idempotent webhooks. A reconciliation check that catches drift. A short runbook for refunds, disputes and failed payouts, so your team knows what to do. And everything in your own Stripe account.

If you're adding payments to a product, or the ones you have keep surprising you, tell me how your money moves.

Questions

  • Yes, including PayPal and regional processors, but Stripe is usually the fastest route for SaaS and marketplaces. I will say if another fits your market better.