---
id: WF-MBR-MEM-015
title: Suspend and restore on a payment problem
trigger: Commerce delivers enforcement or restoration for a purchased line.
product_area: membership
module: memberships
revision: 1
status: draft
design_intent: proposed
implementation_evidence: observed
inference: []
source_sha:
  services-membership: 5994c270e8a37a30f848e99ba5b5ee6b87c08893
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
implements:
  - CAP-MBR-MEM-010
  - CAP-MBR-MEM-004
moves:
  - STATE-MBR-MEM-001
  - STATE-MBR-MEM-010
crosses:
  - SVC-MBR-MEM-commerce-participant
  - SVC-MBR-MEM-memberships
  - SVC-MBR-MEM-events
idempotency: >-
  Enforcement and restoration identifiers recognize repeats. A new restoration
  for an already-restored enforcement is refused.
concurrency: >-
  Each operation locks the membership. Restoration counts remaining open
  suspension enforcements before clearing a Commerce hold.
hops:
  - 'n': 1
    actor_or_service: Commerce
    action: >-
      Validate the enforcement action and locate the holding; direct line
      cancellation is refused here.
    anchor: >-
      services-membership:modules/commerce-participant/services/enforcement/enforcement.ts:enforce
    seam: queue
    on_failure: >-
      Let Commerce retry errors; reject direct cancellation through the
      enforcement path.
    left_inconsistent: The previous standing remains effective before successful suspension.
    observer: Commerce enforcement evidence
    provenance: observed
    source: >-
      services-membership:modules/commerce-participant/services/enforcement/enforcement.ts
      (header)
  - 'n': 2
    actor_or_service: Commerce participant
    action: >-
      Record enforcement and, for a suspend action on an unsuspended holding,
      suspend it and its derived children.
    anchor: >-
      services-membership:modules/memberships/services/operations/staff-operations.ts:suspendChildren
    seam: sync
    on_failure: Roll back local changes and await Commerce retry.
    left_inconsistent: No partial local change remains.
    observer: Suspension lifecycle and event records
    provenance: test
    source: >-
      services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#suspends
      on a reversed payment, idempotently, and restores on
  - 'n': 3
    actor_or_service: Commerce participant
    action: >-
      Record restoration and clear eligible suspension only after the last
      Commerce suspension ends, then recompute standing.
    anchor: >-
      services-membership:modules/commerce-participant/services/enforcement/enforcement.ts:restore
    seam: queue
    on_failure: Roll back local changes and await Commerce retry.
    left_inconsistent: Coverage remains suspended before eligible restoration succeeds.
    observer: Restoration lifecycle entries
    provenance: test
    source: >-
      services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#suspends
      on a reversed payment, idempotently, and restores on
branches:
  - Notify and review enforcement records have no suspension effect.
waits: []
evidence:
  - >-
    services-membership at 5994c270:
    modules/commerce-participant/services/enforcement/enforcement.ts;
    services/persistence/commerce-enforcements.ts
controls: [TC-AVL-002, TC-AVL-003, TC-AVL-004, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-005, TC-AZ-006, TC-CHG-001, TC-CHG-002, TC-CHG-003, TC-CHG-004, TC-CRY-001, TC-CRY-002, TC-CRY-003, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-DAT-004, TC-DAT-007, TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-IAM-006, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-MON-001, TC-MON-002, TC-MON-004, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-PRV-001, TC-PRV-002, TC-SEC-001, TC-SEC-004, TC-TEN-001, TC-TEN-002, TC-TEN-003]
---

# Suspend and restore on a payment problem

## What It Does

Payment enforcement withholds membership rights while a Commerce payment problem remains. Restoration closes the enforcement and clears only eligible Commerce suspension.

## The Flow

```mermaid
flowchart TD
  H1["Validate the enforcement action and locate the holding; direct line cancellation is refused here"]
  H2["Record enforcement and, for a suspend action on an unsuspended holding, suspend it and its derived children"]
  H1 --> H2
  H3["Record restoration and clear eligible suspension only after the last Commerce suspension ends, then recompute standing"]
  H2 --> H3
```

## When Something Fails

Each local change rolls back on error and depends on Commerce redelivery. Rights remain available before successful enforcement and withheld before successful restoration. A staff reason prevents Commerce from clearing the suspension.
