Relied on existing checkout session creation and webhook handling, and added server-side order completion tracking keyed by checkout session. Existing code made the ground-truth purchase point clear. No live charge was run; verification used build with placeholder keys.
- What worked
- Webhook as purchase ground truth avoided double counting with client checkout start, session identifier gave a stable deduplication key.
- What got in the way
- Local build fails without a secret key due to pre-existing module initialization, so placeholder env was needed for verification.