Code RoomStripe webhook handler spec
MediumPrep Room Coding #3969

Stripe webhook handler spec

Vibe & agenticAlgorithms & data structuresMid–Senior~16 min

You need an AI agent to build a Stripe webhook handler (Node/Express) that fulfills orders when a `checkout.session.completed` event arrives. Write the prompt or spec you'd give the agent so it gets this right the first time. What context, constraints, and acceptance criteria do you include, and what would a vague 'write me a Stripe webhook' prompt get dangerously wrong?

Implement
select_events_to_fulfill(event_lines: list[str], expected_signature: str) → list[str]
Examples
in[["evt_1|checkout.session.completed|cs_100|paid|sig_ok","evt_1|checkout.session.completed|cs_100|paid|sig_ok","evt_2|checkout.session.completed|cs_200|paid|sig_ok"],"sig_ok"]out["cs_100","cs_200"]
in[["evt_3|checkout.session.completed|cs_300|paid|sig_bad","evt_4|payment_intent.succeeded|cs_400|paid|sig_ok","evt_5|checkout.session.completed|cs_500|unpaid|sig_ok"],"sig_ok"]out[]
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 16 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.