---
id: FAS-COM-ORD-02
title: Sale completion and payment
feature: FEAT-COM-ORD-02
product_area: commerce
module: orders
revision: 1
status: proposed
product_intent: proposed
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
capabilities:
  - CAP-COM-ORD-005
  - CAP-COM-ORD-006
  - CAP-COM-ORD-007
  - CAP-COM-ORD-008
  - CAP-COM-ORD-009
scenarios:
  - id: FAS-COM-ORD-02-01
    title: A pay-now purchase bills before it accepts payment
    kind: behaviour
    exercises:
      - CAP-COM-ORD-005
      - CAP-COM-ORD-006
      - CAP-COM-ORD-007
    relies_on:
      - ATS-COM-ORD-005-09
      - ATS-COM-ORD-006-01
      - ATS-COM-ORD-007-05
    preconditions: The fixture buyer has a reviewed shirt and an approved card response.
    steps:
      - do: 'Place, inspect the issued pro forma and pay the total.'
        provenance: test
        source:
          - >-
            services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at
            placement: billed, placed, one pro forma sale invoice linked under the first bill key, the
            line carrying its invoice line
          - >-
            services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#answers 200: the
            attempt succeeded with Accounting’s payment, the order accepted, the pro forma converted by
            that first money
    expected: One order is billed and accepted with its Accounting payment linked.
    negative: false
    data_needs: 'An isolated workspace with the records, permissions and controlled outcomes named above.'
    bound_to:
      - TST-COM-ORD-075
    provenance: test
    source:
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at
        placement: billed, placed, one pro forma sale invoice linked under the first bill key, the line
        carrying its invoice line
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#answers 200: the
        attempt succeeded with Accounting’s payment, the order accepted, the pro forma converted by that
        first money
    expected_provenance: test
    expected_source:
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at
        placement: billed, placed, one pro forma sale invoice linked under the first bill key, the line
        carrying its invoice line
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#answers 200: the
        attempt succeeded with Accounting’s payment, the order accepted, the pro forma converted by that
        first money
  - id: FAS-COM-ORD-02-02
    title: A funded but unaccepted sale returns money on void
    kind: interaction
    exercises:
      - CAP-COM-ORD-006
      - CAP-COM-ORD-007
      - CAP-COM-ORD-008
    relies_on:
      - ATS-COM-ORD-007-07
      - ATS-COM-ORD-008-06
      - ATS-COM-ORD-008-07
    preconditions: A pay-now sale has a partial card payment and applied credit.
    steps:
      - do: Void and replay its settlement.
        provenance: test
        source:
          - >-
            services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#refunds nothing
            twice: a second void is 409, a re-run of the plan sends nothing and a replayed request
            answers the same plan
    expected: Captured card money is refunded before crediting and no money command is repeated.
    negative: false
    data_needs: 'An isolated workspace with the records, permissions and controlled outcomes named above.'
    bound_to:
      - TST-COM-ORD-075
    provenance: test
    source:
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#refunds nothing twice:
        a second void is 409, a re-run of the plan sends nothing and a replayed request answers the same
        plan
    expected_provenance: test
    expected_source:
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#refunds nothing twice:
        a second void is 409, a re-run of the plan sends nothing and a replayed request answers the same
        plan
  - id: FAS-COM-ORD-02-03
    title: A decline does not force another purchase
    kind: lifecycle
    exercises:
      - CAP-COM-ORD-005
      - CAP-COM-ORD-006
      - CAP-COM-ORD-007
    relies_on:
      - ATS-COM-ORD-005-01
      - ATS-COM-ORD-007-05
    preconditions: The first card is declined and the second is approved within the window.
    steps:
      - do: 'Place once, pay with both cards in order and read the sale.'
        provenance: test
        source:
          - >-
            services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#answers 200
            declined with the processor’s code, the order still placed with its pro forma, the attempt
            declined
          - >-
            services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#accepts the order
            on the next attempt, under the next sequence and key
    expected: The same order contains both attempts and becomes accepted after the second.
    negative: false
    data_needs: 'An isolated workspace with the records, permissions and controlled outcomes named above.'
    bound_to:
      - TST-COM-ORD-075
    provenance: test
    source:
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#answers 200 declined
        with the processor’s code, the order still placed with its pro forma, the attempt declined
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#accepts the order on
        the next attempt, under the next sequence and key
    expected_provenance: test
    expected_source:
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#answers 200 declined
        with the processor’s code, the order still placed with its pro forma, the attempt declined
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#accepts the order on
        the next attempt, under the next sequence and key
  - id: FAS-COM-ORD-02-04
    title: An editor cannot place or void a purchase
    kind: permission
    exercises:
      - CAP-COM-ORD-005
      - CAP-COM-ORD-008
      - CAP-COM-ORD-011
    relies_on:
      - ATS-COM-ORD-005-12
      - ATS-COM-ORD-008-01
    preconditions: A clerk can update carts and read orders but lacks placing and void authority.
    steps:
      - do: 'Change a cart item, try placement and try to void a separate placed sale.'
        provenance: proposed
        source:
          - ATS-COM-ORD-005-12
          - ATS-COM-ORD-008-01
    expected: The edit succeeds and both order mutations are refused.
    negative: true
    data_needs: 'An isolated workspace with the records, permissions and controlled outcomes named above.'
    bound_to: []
    provenance: proposed
    source:
      - ATS-COM-ORD-005-12
      - ATS-COM-ORD-008-01
    expected_provenance: proposed
    expected_source:
      - ATS-COM-ORD-005-12
      - ATS-COM-ORD-008-01
  - id: FAS-COM-ORD-02-05
    title: Uncertain payment resumes before any fresh card charge
    kind: regression
    exercises:
      - CAP-COM-ORD-006
      - CAP-COM-ORD-007
      - CAP-COM-ORD-009
    relies_on:
      - ATS-COM-ORD-007-01
      - ATS-COM-ORD-007-06
      - ATS-COM-ORD-009-04
    preconditions: A billed deposit sale has a lost Accounting response.
    steps:
      - do: 'Retry with a different token, recover the original attempt and read the schedule.'
        provenance: proposed
        source:
          - ATS-COM-ORD-007-01
          - ATS-COM-ORD-007-06
          - ATS-COM-ORD-009-04
    expected: One captured attempt accepts the deposit sale and one schedule is linked after recovery.
    negative: true
    data_needs: 'An isolated workspace with the records, permissions and controlled outcomes named above.'
    bound_to: []
    provenance: proposed
    source:
      - ATS-COM-ORD-007-01
      - ATS-COM-ORD-007-06
      - ATS-COM-ORD-009-04
    expected_provenance: proposed
    expected_source:
      - ATS-COM-ORD-007-01
      - ATS-COM-ORD-007-06
      - ATS-COM-ORD-009-04
evidence:
  - provenance: documented
    source: >-
      rhythm-v2-docs:specs/commerce/orders/planning/features/FEAT-COM-ORD-02-placing-and-paying-for-orders.md
  - provenance: observed
    source:
      - >-
        rhythm-v2-docs:specs/commerce/orders/planning/capabilities/CAP-COM-ORD-005-place-the-order-once-at-the-price-the-buyer-saw.md
      - >-
        rhythm-v2-docs:specs/commerce/orders/planning/capabilities/CAP-COM-ORD-006-bill-the-order-through-accounting.md
      - >-
        rhythm-v2-docs:specs/commerce/orders/planning/capabilities/CAP-COM-ORD-007-take-payment-on-an-order.md
      - >-
        rhythm-v2-docs:specs/commerce/orders/planning/capabilities/CAP-COM-ORD-008-void-an-unpaid-order-and-give-back-what-it-held.md
      - >-
        rhythm-v2-docs:specs/commerce/orders/planning/capabilities/CAP-COM-ORD-009-spread-a-purchase-over-a-deposit-and-installments.md
---

# Sale completion and payment: Feature Acceptance Suite

## What the Feature Must Do as a Whole

Sale completion connects one placed purchase to its invoice, payment attempts and eventual acceptance or void. The suite follows the same purchase through those outcomes so a successful retry cannot conceal a second order or charge.

## Interactions Between Capabilities

Billing precedes collection in the pay-now fixture. A declined attempt permits a later attempt on the same order, while a partly funded void reverses captured money through the adjustment worker. Uncertain-payment recovery remains a proposed combined chain.

## Regression Record

| Revision | Change | Scenario | Why |
|---|---|---|---|
| 1 | initial | all | Establish the feature’s combined outcomes from the pinned specification and executable evidence. |
