fix(console): account for partial Zen refunds#34227
Conversation
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
|
Merge review result: not merging yet. Validation/status checked:
Merge blockers:
Suggested fix: persist the refunded amount already accounted for, or process individual refund events with refund-id idempotency, then deduct only the new delta: Reference docs:
|
|
Merge review result: still not merging. Validation evidence from a fresh isolated worktree on current
Merge blockers remain:
Needed before merge: store or ledger the already-accounted refunded amount/refund IDs, deduct only the new refund delta up to |
|
Merge review refresh for task 95480452: still not merging. Current state checked on 2026-06-28:
Merge blockers remain:
Needed before merge: persist the already-accounted refunded amount or process refund IDs idempotently, deduct only the new delta up to the original payment amount, represent partial vs full refunds accurately, and add targeted tests for duplicate events, first partial refund, sequential partial refunds, and full refund idempotency. Existing follow-up task: |
|
Merge review refresh for task 99f73a07: not merging. Current state checked on 2026-06-28 at 13:52 +03:00:
Merge blockers remain:
Needed before merge: persist the already-accounted refunded amount or process refund IDs idempotently, deduct only the new delta up to the original payment amount, avoid treating partial refunds as full refunds, and add targeted tests for duplicate events, first partial refund, sequential partial refunds, and full-after-partial refund capping. |
Summary
charge.refundedwebhook deduct the actual refunded amount instead of always deducting the original top-up amountpayment.time_refunded is null, so webhook retries do not double-deductValidation
bun run typecheckfrompackages/console/appNote: local
git pushpre-push hook runs full monorepobun turbo typecheck; that failed outside this change in@opencode-ai/serverviapackages/core/src/tool/{apply-patch,edit}.tsmissingdifftype declarations. Branch was pushed withHUSKY=0after the targeted Console app typecheck passed.