Skip to content

ATS-ACC-TRX-007Collect processor payments and resolve uncertainty: Capability Test Specification

Markdown

ATS-ACC-TRX-007

Collect processor payments and resolve uncertainty: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaAccountingModuleTransactionsRevision1

Read atservices-accounting f47cb263react-console baf6dae3

Coverage

  • Rule covered
  • Transition gap: FND-ACC-TRX-072
  • Validation covered
  • Permission covered
  • Edge gap: FND-ACC-TRX-072
  • Failure covered
  • Boundary covered
  • Concurrency covered
  • Invariant covered
  • Interaction covered

Test Scenarios

12 scenarios proving CAP-ACC-TRX-007; 11 bound to an existing test.

01 Invalid merchant destinations cannot chargevalidationapinegativetest
Proves
BR-CAP-ACC-TRX-007-01
Preconditions
Inactive and foreign-unit merchant accounts exist.
Steps
[ { "do": "Tender through each and then omit the merchant account.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it refuses an inactive merchant account (merchant_account_inactive), charging nothing" } ]
Expected
Every request fails before any charge.
Data
Merchant destination variants.
Bound to
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it refuses an inactive merchant account (merchant_account_inactive), charging nothing
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it refuses a merchant account of another unit (cash_account_mismatch)
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it refuses a card payment with no merchant account (cash_account_mismatch)
Source
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it refuses an inactive merchant account (merchant_account_inactive), charging nothing
02 Eligibility precedes repeat-safe captureinvariantapitest
Proves
BR-CAP-ACC-TRX-007-02 BR-CAP-ACC-TRX-007-03 INV-DOM-ACC-TRX-003-06
Preconditions
The invoice line owes 70.00.
Steps
[ { "do": "Plan 70.01, then capture 70.00 and repeat its request.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it resolves the intent succeeded, naming the payment, claimed and resolved, with the batch chosen at initiation" } ]
Expected
Excess fails without charging; the eligible request captures once and replays its receipt.
Data
A scripted development processor.
Bound to
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it refuses a planned allocation over the line’s balance (over_application), charging nothing
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it resolves the intent succeeded, naming the payment, claimed and resolved, with the batch chosen at initiation
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it replays the same key and body as the same payment, charging nothing more
Source
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it resolves the intent succeeded, naming the payment, claimed and resolved, with the batch chosen at initiation
03 Definite failures permit another attemptfailureapinegativetest
Proves
BR-CAP-ACC-TRX-007-04
Preconditions
The test processor supplies a declining card and unavailable mode.
Steps
[ { "do": "Repeat a declining request, substitute a valid card under its key and test unavailability.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it frees the key: the same key sent again is tendered again, as a new intent (declined again here)" } ]
Expected
Failed intents remain recorded, valid retry succeeds and unavailable capture records no collected money.
Data
Decline and availability processor scripts.
Bound to
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it refuses processor_declined and fails the intent with the processor’s code, writing no payment
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it frees the key: the same key sent again is tendered again, as a new intent (declined again here)
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it takes the same key with another card: the payment is made, the failed intents kept as history
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it refuses processor_unavailable and fails the intent: nothing was charged
Source
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it frees the key: the same key sent again is tendered again, as a new intent (declined again here)
04 Concurrent settlement cannot reject captured valueconcurrencyapitest
Proves
BR-CAP-ACC-TRX-007-05 INV-DOM-ACC-TRX-003-07
Preconditions
Another receipt settles the target before card capture returns.
Steps
[ { "do": "Complete the card capture.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it is capped at what the line owes then and the rest stays unapplied: the charged money is never refused" } ]
Expected
Recorded money is capped against current debt and otherwise retained unapplied.
Data
A processor callback that introduces competing payment.
Bound to
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it is capped at what the line owes then and the rest stays unapplied: the charged money is never refused
Source
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it is capped at what the line owes then and the rest stays unapplied: the charged money is never refused
05 Uncertain capture is recovered by lookuptransitionapitest
Proves
BR-CAP-ACC-TRX-007-06
Preconditions
The scripted card captures while losing its response.
Steps
[ { "do": "Tender and repeat the identical request.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it answers the payment to a replay of the same key, from what the processor holds, with no second charge" } ]
Expected
The initial intent processes and lookup recovers the existing payment.
Data
A lost-response processor script.
Bound to
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it refuses tender_uncertain and leaves the intent processing, the charge made once
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it answers the payment to a replay of the same key, from what the processor holds, with no second charge
services-accounting:modules/transactions/tests/e2e/service-functions-gateway-lost-answer.e2e.spec.js#it finds the one capture with the lookup and answers the succeeded payment
Source
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it answers the payment to a replay of the same key, from what the processor holds, with no second charge
06 Lookup exhaustion produces reviewboundaryapitest
Proves
BR-CAP-ACC-TRX-007-07
Preconditions
A processing charge has no provider reference and key lookup stays inconclusive under the development recovery schedule.
Steps
[ { "do": "Sweep at thirty, sixty, ninety and one hundred eighty seconds.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/payments/lost-answers.integration.spec.js#it hands the intent to a person at the last lookup: needs_review, the item published with its facts" } ]
Expected
Only due key lookups count; their absent answers retain processing, and the last due lookup hands the attempt to review.
Data
An overridden lookup cadence.
Bound to
services-accounting:modules/transactions/tests/integration/services/payments/lost-answers.integration.spec.js#it asks at the first step (30 s) and counts it: a not_found changes nothing else
services-accounting:modules/transactions/tests/integration/services/payments/lost-answers.integration.spec.js#it hands the intent to a person at the last lookup: needs_review, the item published with its facts
services-accounting:modules/transactions/tests/integration/services/payments/lost-answers.integration.spec.js#it stops looking once it is with a person: further sweeps do not touch it
Source
services-accounting:modules/transactions/tests/integration/services/payments/lost-answers.integration.spec.js#it hands the intent to a person at the last lookup: needs_review, the item published with its facts
07 Human decisions require review eligibilitypermissionapitest
Proves
BR-CAP-ACC-TRX-007-08
Preconditions
One uncertain attempt awaits review and another is still scheduled.
Steps
[ { "do": "Resolve with a reference, repeat resolution and decide the early attempt.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/payments/lost-answers.integration.spec.js#it refuses both decisions before the last lookup (lost_answer_not_in_review)" } ]
Expected
One receipt and resolved attention item result; repeat and early decisions fail.
Data
Attempts in review and pre-review states.
Bound to
services-accounting:modules/transactions/tests/integration/services/payments/lost-answers.integration.spec.js#it is settled by a person under the processor’s reference: the payment recorded, the item resolved settled
services-accounting:modules/transactions/tests/integration/services/payments/lost-answers.integration.spec.js#it refuses a second decision once it is settled (lost_answer_not_processing)
services-accounting:modules/transactions/tests/integration/services/payments/lost-answers.integration.spec.js#it refuses both decisions before the last lookup (lost_answer_not_in_review)
services-accounting:modules/transactions/tests/integration/services/payments/lost-answers.integration.spec.js#it fails the intent with the person’s reason, frees its key and resolves the item failed
Source
services-accounting:modules/transactions/tests/integration/services/payments/lost-answers.integration.spec.js#it refuses both decisions before the last lookup (lost_answer_not_in_review)
08 Unqueryable old intent becomes abandonedtransitionapitest
Proves
BR-CAP-ACC-TRX-007-09
Preconditions
A processing intent is more than twenty-four hours old, is outside human review and uses a processor that supplies no lookup function.
Steps
[ { "do": "Sweep its outstanding work.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it is abandoned by the sweeper after 24 hours, with its event (FC-17)" } ]
Expected
Abandonment and its retained event are recorded.
Data
A controlled twenty-four-hour clock advance.
Bound to
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it is abandoned by the sweeper after 24 hours, with its event (FC-17)
Source
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it is abandoned by the sweeper after 24 hours, with its event (FC-17)
09 Bank clearing finishes pending receiptstransitionapitest
Proves
BR-CAP-ACC-TRX-007-10 BR-CAP-ACC-TRX-007-13 INV-DOM-ACC-TRX-003-19
Preconditions
Three gateway electronic checks await outcomes.
Steps
[ { "do": "Inspect, report clearing and return, deliver a clearing event and repeat settlement.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/payments/integrations-electronic-check.integration.spec.js#it settles the one the authorization reads cleared: succeeded, its capture item eligible" } ]
Expected
Clearing releases reconciliation eligibility, return reverses the receipt, event settles once and repeated settlement fails.
Data
Gateway clearing and return responses.
Bound to
services-accounting:modules/transactions/tests/integration/services/payments/integrations-electronic-check.integration.spec.js#it records the payment pending_settlement on the electronic_check method: the account’s last four, no card brand
services-accounting:modules/transactions/tests/integration/services/payments/integrations-electronic-check.integration.spec.js#it settles the one the authorization reads cleared: succeeded, its capture item eligible
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it refuses settling a payment not awaiting settlement (payment_not_pending_settlement)
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it records the capture as one eligible settlement item keyed payment:<id>:capture, on Stripe’s timing (the account names no processor)
Source
services-accounting:modules/transactions/tests/integration/services/payments/integrations-electronic-check.integration.spec.js#it settles the one the authorization reads cleared: succeeded, its capture item eligible
10 Customer administration cannot mark system clearingpermissionapinegativetest
Proves
BR-CAP-ACC-TRX-007-11
Preconditions
The caller administers the customer workspace.
Steps
[ { "do": "Invoke the manual settlement system operation.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/e2e/payment-reversals.e2e.spec.js#it is refused the settled route as a console administrator: it is a system route (403)" } ]
Expected
Access is denied.
Data
A customer administrator identity.
Bound to
services-accounting:modules/transactions/tests/e2e/payment-reversals.e2e.spec.js#it is refused the settled route as a console administrator: it is a system route (403)
Source
services-accounting:modules/transactions/tests/e2e/payment-reversals.e2e.spec.js#it is refused the settled route as a console administrator: it is a system route (403)
11 Bank entry follows processor capabilityruleapitest
Proves
BR-CAP-ACC-TRX-007-12
Preconditions
Payrix installations differ in electronic-check support.
Steps
[ { "do": "Request hosted-entry information for both instrument choices.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/stripe/payment-client-side-info.integration.spec.js#it offers the card alone for mode both when the installation has electronic checks off: asked again once, no failure" } ]
Expected
Enabled installation offers card and bank; disabled installation offers card alone.
Data
Gateway capability responses.
Bound to
services-accounting:modules/transactions/tests/integration/services/stripe/payment-client-side-info.integration.spec.js#it offers the bank account beside the card for mode both when the installation takes electronic checks
services-accounting:modules/transactions/tests/integration/services/stripe/payment-client-side-info.integration.spec.js#it offers the card alone for mode both when the installation has electronic checks off: asked again once, no failure
Source
services-accounting:modules/transactions/tests/integration/services/stripe/payment-client-side-info.integration.spec.js#it offers the card alone for mode both when the installation has electronic checks off: asked again once, no failure
12 Recovery feeds the same financial records as immediate captureinteractionapiproposed
Proves
BR-CAP-ACC-TRX-007-03 BR-CAP-ACC-TRX-007-06 BR-CAP-ACC-TRX-007-10 BR-CAP-ACC-TRX-008-04 BR-CAP-ACC-TRX-008-07 BR-CAP-ACC-TRX-009-09 BR-CAP-ACC-TRX-009-10 BR-CAP-ACC-TRX-012-08 BR-CAP-ACC-TRX-012-09 BR-CAP-ACC-TRX-013-03 BR-CAP-ACC-TRX-013-06 BR-CAP-ACC-TRX-020-05 BR-CAP-ACC-TRX-020-08 BR-CAP-ACC-TRX-011-03 BR-CAP-ACC-TRX-011-04
Preconditions
An isolated workspace has eligible customers, products, matching accounts, an open period and two open batches. Each branch owns separate financial records.
Steps
[ { "do": "Capture a card payment with a lost answer, recover it by lookup, allocate its remaining value and complete a second invoice through settlement. Request a return and deliver its confirmation; in a separate branch deliver a bank return. Include a settlement that reserves customer credit during processor uncertainty.", "provenance": "proposed", "source": "services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it resolves the intent succeeded, naming the payment, claimed and resolved, with the batch chosen at initiation; services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it answers the payment to a replay of the same key, from what the processor holds, with no second charge; services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it settles the one the bank cleared: succeeded, settled_at, its capture item eligible, the settle event; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-006-take-a-card-or-bank-payment-through-the-processor.md#WF-ACC-TRX-006; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-007-resolve-lost-processor-answers-and-clear-bank-debits.md#WF-ACC-TRX-007; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-008-settle-a-customer-s-invoices-with-credit-and-money.md#WF-ACC-TRX-008; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-013-apply-payment-events-from-the-integration-platform.md#WF-ACC-TRX-013; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-06; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-10; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-008-put-a-payment-s-money-on-the-right-invoices.md#BR-CAP-ACC-TRX-008-04; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-008-put-a-payment-s-money-on-the-right-invoices.md#BR-CAP-ACC-TRX-008-07; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-09; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-10; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-08; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-09; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-06; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-020-let-commerce-and-the-processor-work-with-accounting-safely.md#BR-CAP-ACC-TRX-020-05; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-020-let-commerce-and-the-processor-work-with-accounting-safely.md#BR-CAP-ACC-TRX-020-08; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-04" } ]
Expected
Recovery creates one receipt; settlement retains its linked components; confirmed refund returns held value and bank return restores debt without duplicate event effects.
Data
Separate command keys, two customers, invoice lines, receipts and credit; controlled processor outcomes and a fixed calendar where the branch requires them.
Source
services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it resolves the intent succeeded, naming the payment, claimed and resolved, with the batch chosen at initiation; services-accounting:modules/transactions/tests/integration/services/payments/tender.integration.spec.js#it answers the payment to a replay of the same key, from what the processor holds, with no second charge; services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it settles the one the bank cleared: succeeded, settled_at, its capture item eligible, the settle event; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-006-take-a-card-or-bank-payment-through-the-processor.md#WF-ACC-TRX-006; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-007-resolve-lost-processor-answers-and-clear-bank-debits.md#WF-ACC-TRX-007; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-008-settle-a-customer-s-invoices-with-credit-and-money.md#WF-ACC-TRX-008; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-013-apply-payment-events-from-the-integration-platform.md#WF-ACC-TRX-013; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-06; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-10; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-008-put-a-payment-s-money-on-the-right-invoices.md#BR-CAP-ACC-TRX-008-04; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-008-put-a-payment-s-money-on-the-right-invoices.md#BR-CAP-ACC-TRX-008-07; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-09; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-10; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-08; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-09; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-06; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-020-let-commerce-and-the-processor-work-with-accounting-safely.md#BR-CAP-ACC-TRX-020-05; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-020-let-commerce-and-the-processor-work-with-accounting-safely.md#BR-CAP-ACC-TRX-020-08; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-04

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.