Skip to content
arch-lab

Payment capture — the money leg

Where an order stops being a promise: authorise, capture, and the two ways it does not finish.

rectcritical[Capture within 7 days][processor unreachable][already captured]break[card declined]Order API[Go]Hide the 3 services only Order API usesLedger[PostgreSQL]Card Processor[Stripe]Hide the 1 service only Card Processor usesFraud ScoringThe authorisation holds; only the captureis late1. Authorise the card [REST]2. Score the attempt3. requires_capture4. Capture the intent [REST]5. succeeded6. Post the entry [SQL]7. Schedules a retry with backoff8. Reconciles against the existing entry [SQL]9. Void the authorisation [REST]10. Posts nothing — there is no money to record [SQL]
  1. Order API to Card Processor (sync): Authorise the card [REST]
  2. Card Processor to Fraud Scoring (async): Score the attempt
  3. Card Processor to Order API (reply): requires_capture
  4. Order API to Card Processor (sync): Capture the intent [REST]
  5. Card Processor to Order API (reply): succeeded
  6. Order API to Ledger (sync): Post the entry [SQL]
  7. Order API to Order API (sync, self-message): Schedules a retry with backoff
  8. Order API to Ledger (sync): Reconciles against the existing entry [SQL]
  9. Order API to Card Processor (reply): Void the authorisation [REST]
  10. Order API to Ledger (sync): Posts nothing — there is no money to record [SQL]