Repository navigation
PAY-005A2: validate Stripe refund results - #205
Merged
Merged
Conversation
✅ Deploy Preview for luminous-fox-7c393f ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
daliu
marked this pull request as ready for review
July 14, 2026 02:13
This was referenced Jul 14, 2026
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.
Closes #204
Outcome
Both current admin refund Functions now reject an invalid stored refund target before constructing Stripe. After one refund request, they record local success only from a plain, final
succeededRefund bound to the expected PaymentIntent,usdcurrency, and permitted amount.A partial must return the exact requested cents. A full action still omits
amountand records Stripe's validated remaining cents. Provider uncertainty and local-save uncertainty return the same fixed do-not-retry message without provider or storage detail.The local-save boundary is explicit:
Officer continuity
Officer impact: Refunds cannot be recorded as successful from malformed, mismatched, pending, action-required, failed, cancelled, or unknown provider results. An unclear outcome tells the officer not to retry and to escalate.
Officer documentation:
docs/officers/EVENTS_SHOP_MEMBERS.md,OPERATIONS_RUNBOOK.md,SECURITY.md,GITHUB_ISSUES.md, andGITHUB_ISSUE_SLICES.md.Deployment evidence: Source, tests, and commit are proven. Website publication, runmprc.com verification, Firebase Functions deployment, Stripe provider configuration/request, production data behavior, and live refund behavior are not performed or proven. The officer procedure remains NOT AVAILABLE YET.
Safety invariants
object: refund,status: succeeded, matching primitive PaymentIntent/currency, and permitted positive safe-integer cents can reach the local write.Verification
Exact reviewed head:
fbc9494c60b22f25c3c30134580f4bd93a02a715Exact base:
2c7332ca547ba98a57863a6f2f41849ffb386e9fDiff SHA-256:
f193a0b8b9e4731ff92d20f141e889e2abe345fbf3cea46107cd87397f46ca42Red proof:
Green local proof on Node 20:
npm --prefix functions run lintgit diff --checkpassedRemaining risk
This is immediate containment, not the complete safe refund system. It does not add durable refund commands, Stripe idempotency keys, remaining-balance retrieval, concurrency fences, webhook-finalized totals, reconciliation, finance capabilities/MFA/recent-auth, approved policy, protected Firebase deployment, or provider/live proof. Never retry an ambiguous result blindly.
Stripe references:
Exact-head hosted evidence
fbc9494c60b22f25c3c30134580f4bd93a02a715: frontend lint/build/Jest/SPA/workflow checks, Functions lint/tests, Firestore Rules, artifact scrubber, and commerce-journal emulator.6a559ad0a9ece400087af1cfsucceeded for PR review only.