---
id: TST-ACC-TRX-108
title: Refund timeout before send suite
kind: integration
product_area: accounting
module: transactions
revision: 1
status: draft
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
repository: services-accounting
files:
  - >-
    modules/transactions/tests/integration/services/refunds/refund-timeout-before-send.integration.spec.js
implements:
  - ATS-ACC-TRX-012-08
  - ATS-ACC-TRX-012-09
implements_parts:
  - scenario: ATS-ACC-TRX-012-08
    assertion: >-
      it is failed processor_unavailable at once, the pending money released,
      nothing refunded
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/refunds/refund-timeout-before-send.integration.spec.js#it
      is failed processor_unavailable at once, the pending money released,
      nothing refunded
  - scenario: ATS-ACC-TRX-012-09
    assertion: >-
      it leaves the refund processing a day on, never failed as never received
      and never abandoned
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/refunds/refund-timeout-before-send.integration.spec.js#it
      leaves the refund processing a day on, never failed as never received and
      never abandoned
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 3
isolation: >-
  Suite-marked records in the prepared local test database; fixture teardown
  removes owned records.
provenance: test
source: >-
  services-accounting:modules/transactions/tests/integration/services/refunds/refund-timeout-before-send.integration.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/refunds/refund-timeout-before-send.integration.spec.js
    assertion_titles:
      - a processor refund that timed out (integration; DEF-ACT-0875)
      - before the send
      - >-
        is failed processor_unavailable at once, the pending money released,
        nothing refunded
      - replayed under the same key answers processor_unavailable
      - after the send
      - 'is found by the lookup, and the sweeper completes it with one refund'
      - a lookup that finds nothing or cannot answer
      - >-
        leaves the refund processing a day on, never failed as never received
        and never abandoned
      - leaves it processing too when the lookup cannot say
    imports:
      - 'const { sql } = require(''drizzle-orm'');'
      - >-
        const { manualClock } =
        require('@rhythmsoftware/macroservice-time/clock');
      - 'const { stage } = require(''@rhythmsoftware/macroservice-testing/stage'');'
      - >-
        const { TEST_NOW } =
        require('@rhythmsoftware/macroservice-testing/execution-context');
      - >-
        const { sweepProcessingIntents } =
        require('../../../../services/payments/intent-sweeper');
      - >-
        const { receivePayment } =
        require('../../../../services/payments/payment-receive');
      - '} = require(''../../../../services/payments/ports/payment-processor'');'
      - >-
        const { executeRefund, requestRefund } =
        require('../../../../services/refunds/refund-commands');
      - '} = require(''../../payments-fixtures'');'
      - "\t\t\tconst { payment } = world.require();"
      - "\t\t\tconst { payment } = world.require();"
      - "\t\t\tconst { requested, refusal } = before_send.require();"
      - "\t\t\tconst { requested } = before_send.require();"
      - "\t\t\tconst { payment } = world.require();"
      - "\t\t\tconst { requested, refusal } = after_send.require();"
      - "\t\t\tconst { payment } = world.require();"
      - "\t\t\tconst { requested } = silent.require();"
      - "\t\t\tconst { requested } = silent.require();"
    test_double_declarations: []
---

# Refund timeout before send suite

## Verification Boundary

The suite exercises transaction commands and database protections in the local prepared test environment. Registration records the existing executable file; it does not report a run or establish product approval.

## What This Suite Proves

Its cited assertions contribute evidence for definite processor failure restores local position; uncertain refund waits for a definite outcome. The structured assertion bindings identify which parts of combined scenarios it executes.

## What It Does Not Prove

Local commands and route invocations do not establish deployed routing, live processor guarantees or the complete staff browser experience. An unbound feature chain remains proposed, and this registration carries no execution result.

## Real Dependencies and Test Doubles

The suite uses the imported commands, route handlers or persistence code against the local test database. Fixture helpers supply accounting context; any stepped clock, dummy processor or substituted external client is retained in the evidence declarations.

## Must Not Be Doubled

The command or persistence behavior under assertion and its relevant database protections must remain real. Substituting the final financial result removes evidence of transactional effects.
