# Defect: Capture fee truncates instead of rounding half up

**Severity:** P1-high
**Related Feature:** [payments](../product/payments.md)
Related Features: payments
**Reproducibility:** always
**Last Known Working:** Commit 34a4e40 (parent of 965029f): capture used applyRate for the scheme fee.
Source: define
Source Feature: payments
Intake Request: 4c08a5e7-a70f-4c3c-bee5-924cdd448968

## Observed Behavior

src/payments/service.ts:119 uses Math.floor(requested * SCHEME_FEE_RATE). At rate 0.0149 and a capture of 200 minor units, it posts fee 2 and net 198. The [RISK-02] test fails at test/service.test.ts:112 because it expects fee 3.

## Expected Behavior

Per specs/tech/payments.md TR4 and specs/tests/payments.md RISK-02, round the scheme fee half up at capture: amount 200 yields fee 3/net 197; amount 9999 yields fee 149/net 9850. Fee plus net must equal the capture.

## Reproduction Steps

1. In the 301-config round-0 fixture, run `node --test test/service.test.ts`.
2. Observe [RISK-02] fail at test/service.test.ts:112 with `2 !== 3`.
3. Inspect src/payments/service.ts:119: the scheme fee is calculated with Math.floor instead of half-up rounding.

## Environment

301-config payments fixture, round-0 at commit 969f558; macOS (Darwin), Node v26.5.0; node:test runner.

## Error Output

[RISK-02] the scheme fee rounds half up at the capture boundary
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
2 !== 3
at test/service.test.ts:112:12

## Additional Context

Review task 1 finding finding-9fec9618519e39f4. Source evidence: .speed/features/payments/evidence/clean_review/1/07c57915-e332-40c8-a297-b17df7f31d45.json.

Planning scope: `test/service.test.ts` already contains the `[RISK-02]` assertions for both captures (200 -> fee 3/net 197 and 9,999 -> fee 149/net 9,850). Use that test unchanged as regression evidence. `src/domain/money.ts` already exports `applyRate`, which returns 3 and 149 for those amounts at rate 0.0149; do not modify the shared money helper. The only implementation file to change is `src/payments/service.ts`: make `capture()` use the existing half-up helper instead of `Math.floor`. Run the existing tests for verification, but do not list the test or money files as files to modify.

## Provenance

Source finding: `finding-9fec9618519e39f4`

Evidence:
- `.speed/features/payments/evidence/clean_review/1/07c57915-e332-40c8-a297-b17df7f31d45.json`

Filing decision: `4c08a5e7-a70f-4c3c-bee5-924cdd448968`

Filed by: sanjay <sanjay@local> at 2026-09-23T16:53:17.548950Z
