---
id: JNY-COM-ORD-001
title: A phone purchase succeeds after a declined card
feature: FEAT-COM-ORD-02
product_area: commerce
module: orders
revision: 1
status: draft
product_intent: confirmed
implementation_evidence: observed
supersedes:
  - COM-ACC-0856
  - COM-ACC-0857
  - COM-ACC-0280
  - COM-ACC-0281
  - COM-ACC-0029
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
actor: ACT-COM-014
goal: 'Complete a correctly priced phone purchase with its promotion, recovering from an initial card decline.'
capabilities:
  - CAP-COM-ORD-001
  - CAP-COM-ORD-003
  - CAP-COM-ORD-004
  - CAP-COM-ORD-005
  - CAP-COM-ORD-007
  - CAP-COM-ORD-010
screens:
  - '/console/{tenantId}/crm/contacts/{id}/orders/new'
  - '/console/{tenantId}/orders/{orderId}'
steps:
  - 'n': 1
    surface: '/console/{tenantId}/crm/contacts/{id}/orders/new'
    action: Choose Create Order on the customer’s contact record.
    capability: CAP-COM-ORD-001
    expected: 'The composer uses that contact and the CRM address, and identifies the policy governing the new cart.'
    provenance: test
    source: >-
      react-console:components/order-composer/__tests__/new-order-screen.test.tsx#renders the workspace with
      the contact as the bill-to customer and the address CRM holds
  - 'n': 2
    surface: addCheckoutItem
    action: Select one Style Guide from the store.
    capability: CAP-COM-ORD-001
    expected: Item validation completes and the cart contains the selected product.
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#adds after the last, changes the
      intent and clears what was advised, removes, each bumping the version
  - 'n': 3
    surface: previewCheckout
    action: Review the purchase preview.
    capability: CAP-COM-ORD-003
    expected: 'The displayed price, tax and total match Commerce’s response.'
    provenance: test
    source: >-
      react-console:components/order-composer/__tests__/live-composer.test.tsx#shows exactly the figures
      Commerce's preview answered
  - 'n': 4
    surface: applyCheckoutPromotionCode
    action: Submit the customer’s promotion code.
    capability: CAP-COM-ORD-004
    expected: >-
      An accepted code displays its discount and promotion name; a refused code explains the refusal without
      changing the total.
    provenance: test
    source: >-
      react-console:components/order-composer/__tests__/live-composer.test.tsx#applies a code Commerce accepts
      and shows what it took off
  - 'n': 5
    surface: placeCheckout
    action: Submit the cart for placement.
    capability: CAP-COM-ORD-005
    expected: The sale receives an order number and a pay-now deadline while billing remains pending.
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 200 with the order: numbered
      10000, placed, pending billing, pay now with a thirty-minute tender window, created
  - 'n': 6
    surface: tenderOrder
    action: Enter the first card through Accounting’s payment window.
    capability: CAP-COM-ORD-007
    expected: A decline leaves the placed purchase available for another payment attempt.
    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
  - 'n': 7
    surface: tenderOrder
    action: Submit the replacement card.
    capability: CAP-COM-ORD-007
    expected: >-
      The successful attempt pays the purchase in full and acceptance follows, with a single charge for that
      attempt.
    provenance: test
    source: >-
      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
  - 'n': 8
    surface: '/console/{tenantId}/orders/{orderId}'
    action: Inspect the order detail.
    capability: CAP-COM-ORD-010
    expected: >-
      The tender panel lists the successful payment and the struck-through decline, with the payment linked to
      Accounting.
    provenance: test
    source: >-
      react-console:components/console/order/__tests__/order-360-live-cards.test.tsx#lists each tender with
      its status, the declined one struck through and a payment linked to Accounting
alternates:
  - from_step: 6
    condition: The payment window is dismissed before payment
    path: Keep the existing placed purchase in the composer
    outcome: Staff can resume payment from the order during its tender window
    provenance: test
    source: >-
      react-console:components/order-composer/__tests__/live-composer.test.tsx#keeps the placed order,
      awaiting payment, when the card pop-up is closed unpaid
  - from_step: 6
    condition: The customer chooses a check
    path: Enter the check reference against the placed purchase
    outcome: The recorded check accepts the purchase
    provenance: test
    source: >-
      react-console:components/order-composer/__tests__/live-composer.test.tsx#records a check against the
      placed order with its number
failures:
  - from_step: 5
    condition: The reviewed price is no longer current
    path: Stop placement and return the old and current prices
    outcome: Staff review a new preview before trying placement again
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#refuses PRICE_CHANGED with both
      prices when the price rose since a preview of a moment ago, the checkout left open
  - from_step: 7
    condition: The processor response is unavailable
    path: Retain an uncertain result and resume the existing attempt on retry
    outcome: Acceptance follows the resolved response without an additional charge
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#resumes the same attempt on a
      retry, whatever card the retry names, and moves nothing while the intent is processing
rules_in_play:
  - BR-CAP-COM-ORD-001-02
  - BR-CAP-COM-ORD-003-01
  - BR-CAP-COM-ORD-003-12
  - BR-CAP-COM-ORD-004-06
  - BR-CAP-COM-ORD-005-01
  - BR-CAP-COM-ORD-005-03
  - BR-CAP-COM-ORD-006-01
  - BR-CAP-COM-ORD-007-01
  - BR-CAP-COM-ORD-007-04
  - BR-CAP-COM-ORD-007-05
  - BR-CAP-COM-ORD-007-13
  - BR-CAP-COM-ORD-010-08
assertions:
  - id: AS-JNY-COM-ORD-001-01
    statement: The successful retry accepts the existing order and records one charge for that attempt.
    provenance: test
    source: >-
      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: AS-JNY-COM-ORD-001-02
    statement: The first payment converts the pro forma and the mirrored financial position shows full payment.
    provenance: test
    source: >-
      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: AS-JNY-COM-ORD-001-03
    statement: 'The detail view retains the decline and success, with the successful payment linked to Accounting.'
    provenance: test
    source: >-
      react-console:components/console/order/__tests__/order-360-live-cards.test.tsx#lists each tender with
      its status, the declined one struck through and a payment linked to Accounting
e2e_policy: required
e2e_reason: >-
  A browser scenario must connect the composer, card window and order detail to prove the staff can recover
  from a decline without initiating an unintended additional charge.
evidence:
  - >-
    Examined reference: react-console:components/console/order/__tests__/order-360-live-cards.test.tsx#lists
    each tender with its status, the declined one struck through and a payment linked to Accounting
  - >-
    Examined reference: react-console:components/order-composer/__tests__/live-composer.test.tsx#applies a
    code Commerce accepts and shows what it took off
  - >-
    Examined reference: react-console:components/order-composer/__tests__/live-composer.test.tsx#keeps the
    placed order, awaiting payment, when the card pop-up is closed unpaid
  - >-
    Examined reference: react-console:components/order-composer/__tests__/live-composer.test.tsx#records a
    check against the placed order with its number
  - >-
    Examined reference: react-console:components/order-composer/__tests__/live-composer.test.tsx#shows exactly
    the figures Commerce's preview answered
  - >-
    Examined reference: react-console:components/order-composer/__tests__/new-order-screen.test.tsx#renders
    the workspace with the contact as the bill-to customer and the address CRM holds
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#adds after the
    last, changes the intent and clears what was advised, removes, each bumping the version
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 200 with
    the order: numbered 10000, placed, pending billing, pay now with a thirty-minute tender window, created
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#refuses
    PRICE_CHANGED with both prices when the price rose since a preview of a moment ago, the checkout left open
  - >-
    Examined reference: 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
  - >-
    Examined reference: 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
  - >-
    Examined reference: 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
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#resumes the
    same attempt on a retry, whatever card the retry names, and moves nothing while the intent is processing
---
# A phone purchase succeeds after a declined card

## Story

A customer phones for the Style Guide and supplies a promotion code. The clerk assembles the cart, reviews the returned amounts and places the purchase. A declined card leaves the order available for payment; a replacement card succeeds. The clerk uses the order detail to explain the completed payment and the earlier decline.
