Improve Stripe webhook reconciliation, logging, and launch diagnostics#64
Merged
SaltProphet merged 1 commit intomainfrom Mar 6, 2026
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
paymentsrows bytransaction_idfor live troubleshooting without introducing a new admin endpoint.Description
src/app/page.tsxthat only runs forpayment=successreturns, introducesPAYMENT_RECONCILE_MAX_ATTEMPTSandPAYMENT_RECONCILE_INTERVAL_MS, and refreshestokens,plan, andlast_payment_atfrom theprofilesrow.src/app/api/webhooks/stripe/route.tswith structured logs for missing signature, signature verification failures, missing checkout metadata, and payment ledger transitions (transitions toreceived,fulfilled,replayed, and failure states).src/app/api/webhooks/stripe.test.tsto assert replay idempotency, rejection of paid sessions with missing metadata, and behavior when profile updates fail (ensuring ledger is transitioned to a failure state).paymentsbytransaction_idtoSTRIPE_CHECKLIST.mdand added a webhook diagnostics runbook todocs/launch/PRODUCTION_LAUNCH_GUIDE.md.Testing
npm test -- src/app/api/webhooks/stripe.test.tsand all tests passed (6 passed, 0 failed).Codex Task