← All field notes

5 SaaS Billing Bugs a Successful Checkout Won't Catch

Test Stripe webhook idempotency, customer mapping, credits and cancellation rules. A successful SaaS checkout can still leave billing bugs behind.

Nov 13, 2026 · 5 min read · Updated Nov 14, 2026


Field Notes from Thunkle, a studio that takes AI-built apps from prototype to secure, production-ready software.

A customer pays for credits. The app adds them, then the handler times out before acknowledging the event. The provider retries. The app adds the credits again. This hypothetical failure is one reason to test Stripe webhook idempotency: repeating delivery should not repeat the purchase benefit.

That is a hypothetical failure, but it is a useful billing test. One purchase should not create two allocations merely because delivery happened twice.

In a Thunkle review, I follow the payment into the internal account and the feature it unlocks. The checkout screen is only part of that path.

1. Access is granted before the payment is established

A success-page visit is not proof of payment. Neither is a browser-supplied value saying checkout completed.

Write down what qualifies the account for access, including deliberate trials and delayed-payment rules. Check the protected backend operation before checkout, after abandonment and after a successful test purchase.

Then complete a test payment and close the tab before the return page loads. The purchase still needs to reach the account. Tomorrow's login should not require another purchase to recover it.

A paid badge and a refused API request can disagree. Test the thing the customer bought, not only the account label.

2. A retry creates another benefit

Stripe documents retries, duplicate events and non-guaranteed event ordering. The application needs a way to handle them without granting the same purchase again.

Use the provider's supported test tools to deliver relevant events more than once. Record the starting balance, allocation and resulting balance.

Deduplicating an event ID and identifying a business purchase are related but different decisions. Different event types may refer to one purchase. Define which operation is allowed to create the benefit and what makes another attempt recognize it.

A successful response on every attempt does not prove the balance is correct.

3. A real payment upgrades the wrong account

Trace the relationship between the signed-in buyer, provider customer, checkout, internal account and workspace receiving access.

Use two ordinary test customers with separate purchases. Check whether one can supply the other's identifier when initiating checkout.

An administrator deliberately buying for a workspace is different from accepting any account ID sent by the browser. The permitted relationship needs to be enforced.

Do not infer identity solely from an editable email address or an untrusted return URL. The mapping should be explainable from authenticated application state and the verified purchase.

4. Cancellation and expiry mean the same thing in the code

A customer who cancels renewal may retain access until the end of a paid period. Immediate expiry would break that promise. Never expiring the account would create a different problem.

Define access for trials, active subscriptions, failed renewals, grace periods, scheduled cancellations, expiry and reactivation where applicable.

Test transitions, not just isolated labels. Existing files might remain downloadable after new processing stops. A downgrade should not silently change record ownership. Reactivation should not leave two competing subscription states.

These are product rules. A single isPaid flag cannot explain them all.

5. An interrupted handler leaves the purchase unfinished

Suppose the handler records an event as processed, then fails before allocating credits. A retry sees the processed flag and does nothing.

Reversing those steps can duplicate credits if the allocation succeeds but recording completion fails.

In a separate test environment, interrupt processing between meaningful state changes. Retry and inspect both the purchase record and the account benefit.

A database transaction may cover local changes. External side effects may need durable work and reconciliation. The implementation should demonstrate recovery from the actual failure points rather than promise that a flag makes processing exactly once.

Keep an account history support can use

An authorized operator should be able to answer: this customer paid, which account received the purchase, and what remains unfinished?

Keep provider identifiers, internal mappings, allocation outcomes and deliberate manual corrections connected. Avoid storing payment secrets or unnecessary personal details in logs.

A reconciliation process can compare provider purchases with internal benefits. That is particularly useful when delivery or processing has failed. It should identify discrepancies without blindly granting everything again.

Verify the repair without changing real money

Use provider test mode, synthetic customers and an isolated application environment. Do not charge or refund a real customer just to explore the handler.

For a confirmed defect, retain the failing example and show the repaired version handles it. Also check an ordinary successful purchase, because a repair that refuses every event is not useful.

A public webhook endpoint is expected in many integrations. It still needs the provider's verification mechanism; a normal user session is not a substitute. Likewise, hiding the URL is not verification.

When to bring in a review

If purchases, credits or subscription access repeatedly disagree, another success-screen test will not settle it.

A Thunkle security audit can include account mapping, entitlement boundaries and authorized billing tests. Implementation work is scoped separately. Bring the expected purchase flow and the failures you can reproduce; I can then agree what the review needs to establish.

If you already know what needs changing, Thunkle's SaaS billing and integration development can scope the implementation and regression checks. A review of the existing behaviour and a build of the replacement are different deliverables.

Questions about Stripe webhook idempotency

Do Stripe API idempotency keys deduplicate webhook deliveries?

No. API idempotency keys address retries of supported requests you send to Stripe. Your incoming webhook processing still needs to recognize repeated deliveries and avoid granting the same purchase benefit again. Keep the event identity and the business purchase relationship clear.

How should I test duplicate processing?

Use Stripe's supported test tooling with synthetic customers. Deliver the relevant event again, then inspect the purchase record, balance and access. Also interrupt the handler between meaningful state changes and check recovery. An acknowledgement by itself does not establish that the customer received exactly the intended benefit.

If you want to start with the checks yourself, read the free three-page security sample. It covers scanner scope and safe two-account setup, with no email required. For the full checklist, worked examples and coding prompts, get the Vibe Coding Security Launch Kit. The guide is a self-serve resource, not a review of your app.

Follow each payment into the correct account.

I can scope a review of webhook verification, duplicate handling and entitlement rules. You receive reproduced findings and practical retest criteria.