feat(stripe): automatically record Tempo session settlements - #892
Draft
ksn-stripe wants to merge 1 commit into
Draft
feat(stripe): automatically record Tempo session settlements#892ksn-stripe wants to merge 1 commit into
ksn-stripe wants to merge 1 commit into
Conversation
Committed-By-Agent: codex Co-authored-by: codex <noreply@openai.com>
commit: |
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.
Stripe Tempo sessions currently require merchants to create transaction-verification PaymentIntents in
onSessionSettlement. This wires confirmed settlement deltas into the same payment-success handler used by Stripe one-time Tempo charges, so the SDK records them automatically.Each transaction is recorded for its newly settled amount, rounded down to whole cents. Zero/sub-cent deltas are skipped. Both
tempo.session()anddefaultMethods().additional()inherit the change, including existing metadata, Connect mapping, transaction-hash idempotency, optional-field fallback, and logged Stripe-error behavior. Optional merchant callbacks still run after the recording attempt; existing callbacks should remove manual PI creation.Validation: 126 Stripe tests passed, 7 skipped (
VITE_TEMPO_NETWORK=none); TypeScript, scoped lint/format checks, andgit diff --checkpassed. New tests cover settlement triggers, delta rounding, repeated notifications, callback composition, and Stripe failures. No live payment or on-chain settlement was executed.