Mermaid sequence diagram in Markdown to PDF

Participants, messages, activation bars, notes and frames for alternatives, loops and parallel steps are drawn as vector art in the document.

Participants, request and reply arrows, activation bars, notes, and alt, else, loop and par frames, in a payment operations note for an online shop.

Markdown source

Markdown · 79 lines
---
title: Operations note, card payment at checkout
author: Payments team
---

# Operations note: card payment at checkout

For the payments team and for agents who take calls about a declined or duplicated payment. It describes the checkout flow in use since 1 March 2026 and stays the reference until it is replaced.

A payment is authorized when the order is placed and captured when the parcel is handed to the carrier. Nothing is captured before dispatch, so a cancelled order never needs a refund, only a release of the authorization.

## The flow

```mermaid
sequenceDiagram
  autonumber
  actor C as Customer
  participant S as Shop
  participant P as Payment provider
  participant B as Card issuer

  C->>S: Place order
  activate S
  S->>P: Authorize amount
  activate P
  P->>B: Authorization request
  B-->>P: Approved or declined
  deactivate P

  alt Approved
    P-->>S: Authorization code
    S-->>C: Order confirmed
    Note over S,P: Capture happens at dispatch, up to 7 days later
  else Declined
    P-->>S: Decline reason
    S-->>C: Ask for another card
  else Needs customer verification
    P-->>C: Verification challenge
    C->>P: Code from the banking app
    P-->>S: Authorization code
    S-->>C: Order confirmed
  end
  deactivate S

  loop Each evening until the parcel ships
    S->>P: Is the authorization still valid
    P-->>S: Days remaining
  end

  par At dispatch
    S->>P: Capture amount
    P-->>S: Captured
  and
    S->>C: Dispatch email with tracking
  end
```

## What can go wrong

| Symptom the customer reports | What happened | What the agent does |
|------------------------------|---------------|---------------------|
| "I was charged but have no order" | The authorization succeeded, the order step failed | Release the authorization. The hold disappears within 5 working days |
| "I see two charges" | The customer retried after a verification timeout | Check both authorizations. Release the one without an order |
| "My card was declined" | The issuer declined | Say only the reason the issuer gave. Never guess at the cause |

> [!WARNING]
> Never capture by hand before dispatch. A capture without a dispatch scan is a chargeback waiting to happen, and the carrier's scan is the evidence we rely on.

## Figures for March 2026

| Line | March 2026 |
|------|-----------:|
| Authorizations requested | 412,300 |
| Approved at the first attempt | 93.4 % |
| Sent to customer verification | 4.8 % |
| Declined | 1.8 % |
| Captured within 7 days | 99.1 % |

*All organizations in the sample documents are invented. Names and figures are illustrative.*

Rendered pages

PDF · 2 pages · 17 KB
  1. Sequence diagrams, page 1 of 2
  2. Sequence diagrams, page 2 of 2

The sample documents describe invented organizations in several countries. All names and figures are illustrative.

Mermaid diagrams in Markdown to PDF: every sampleIn the Markdown reference