feat(stripe): automatically record Tempo session settlements - #892
Draft
ksn-stripe wants to merge 3 commits into
Draft
ksn-stripe wants to merge 3 commits into
ksn-stripe wants to merge 3 commits into
Conversation
Committed-By-Agent: codex Co-authored-by: codex <noreply@openai.com>
commit: |
Committed-By-Agent: codex Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex Co-authored-by: codex <noreply@openai.com>
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.
Tempo session settlements need to be recorded as Stripe PaymentIntents. This connects confirmed settlement deltas to the same recorder used by one-time Tempo payments, automatically creating transaction-verification PIs through both
tempo.session()anddefaultMethods().additional().Each transaction's delta is rounded down to whole cents; zero/sub-cent amounts are skipped. Recording includes
mpp_intent=session, and optional merchant settlement callbacks run afterward. The shared recorder's existing idempotency, routing, and metadata behavior are reused.Scope is automatic PI creation and readily available basic data. Customer and metadata customization work, tax, receipt email, opening challenge ID, channel ID, and richer analytics are deferred to dedicated follow-on PRs.
Validation: 38 tests passed across
Methods.test.tsandanalytics.test.tsusing a temporary isolated configuration with the repository aliases and without chain global setup. TypeScript, scoped lint/format, and diff checks passed. The default test configuration was blocked by the unavailable local Tempo node; no live payment was executed.