Menu

Case study (hypothetical): the customer who paid, but the app still said 'Free plan'
📰

Case study (hypothetical): the customer who paid, but the app still said 'Free plan'

DEV Community: backend·delay.run·2 days ago
#WhV8f7Uu
#devtobackend#devto#dev#event#subscription
Reading 0:00
15s threshold

Reliable HTTP cron and delayed-job scheduling with automatic retries and full run logs — delay.run

This is a hypothetical case study. The product, the numbers and the timeline are invented; the bug is one of the most common ones in subscription billing.

The setup

A small SaaS app sells a Pro plan through a payment provider's hosted checkout. The integration was built the way many tutorials show:

The user clicks "Upgrade", and the backend creates a checkout session.

The user pays on the provider's page and is sent back to the app.

The provider sends webhooks. The app's handler listens for subscription events and sets the account's plan from the subscription status in the payload.

The handler was short:

app . post ( "/webhooks/billing" , verifySignature , async ( req , res ) => { const event = req . body ; if ( event . type . startsWith ( "customer.subscription." ) ) { const sub = event . data . object ; const plan = sub . status === "active" || sub . status === "trialing" ? "pro" : "free" ; await db .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.