Templates / sequenceDiagram

Payment checkout sequence

An order confirmation flow through a payment provider, with authorized and declined branches driven by webhooks.

Open in studio

Preview

Mermaid 11 renderer

Rendering preview...

Mermaid source

sequenceDiagram

sequenceDiagram
    autonumber
    actor Shopper
    participant Shop as Storefront
    participant Pay as Payment provider
    participant Bank

    Shopper->>Shop: Confirm order
    Shop->>Pay: Create payment intent
    Pay-->>Shop: Client secret
    Shopper->>Pay: Submit card details
    Pay->>Bank: Authorize charge
    alt Authorized
        Bank-->>Pay: Approved
        Pay-->>Shop: Webhook payment_succeeded
        Shop-->>Shopper: Order confirmed
    else Declined
        Bank-->>Pay: Declined
        Pay-->>Shop: Webhook payment_failed
        Shop-->>Shopper: Ask for another method
    end

More templates