Task flow · Calculator deposit

Calculator deposit

A visitor confirms a mission interest and pays the quoted deposit through the calculator flow.

Status Implemented Last reviewed 2026-08-06 All task flows →

Flow

flowchart TD
      A["Visitor opens /outils/calculator/"] --> B{"Access granted?"}
      B -- No --> C["Show access gate form"]
      C --> D["Visitor states professional email"]
      D --> E{"Domain allowed?"}
      E -- No --> F["Refuse + explain"]
      E -- Yes --> G["Open calculator access"]
      B -- Yes --> G
      G --> H["Visitor fills 5-step mission form"]
      H --> I["POST /api/quote"]
      I --> J{"Payload valid?"}
      J -- No --> K["400 + errors"]
      J -- Yes --> L{"Mandate required?"}
      L -- Yes --> M["400 mandate_required"]
      L -- No --> N["Run pricing engine + optimiser"]
      N --> O["Store QuoteRequest + public projection"]
      O --> P["Return public JSON"]
      P --> Q["Visitor reviews quote"]
      Q --> R["Visitor clicks confirm interest"]
      R --> S["POST contact with confirm_devis=1"]
      S --> T["Render detailed quote + deposit button"]
      T --> U["Visitor clicks pay deposit"]
      U --> V["POST /paiement/devis/acompte/"]
      V --> W["Recompute deposit server-side"]
      W --> X["Create Payment row"]
      X --> Y["Create Stripe Checkout session"]
      Y --> Z["Redirect to Stripe"]
      Z --> AA{"Buyer action"}
      AA -- "Pays" --> AB["Webhook settles + grant entitlement"]
      AA -- "Cancels" --> AC["Nothing charged"]
            

Security and integrity rules

RuleEnforcement
Amount authorityDeposit is recomputed server-side from stored qualification and the published deposit ladder.
Terms freezeterms_version is stamped at payment creation.
Settlement authorityOnly the signed Stripe webhook writes PAID.
Domain gateThe calculator refuses disposable and non-routable domains before any engine or quote is touched.
ThrottlingMax 10 pending payments per email per hour.

Validation and recovery

ConditionSystem response
Calculator domain is blockedAccess gate refuses the email and explains why. No engine is touched.
Calculator payload is invalid400 with field errors; no quote is stored, no quota is consumed.
Mandate missing for facility rental400 with mandate_required; visitor must declare a signed mandate or select a different responsibility.
Devis token is invalid or expiredRedirect to /contact with an error; the visitor must restart qualification.
Webhook signature is invalid400; nothing is written. Stripe retries.

Entitlement and delivery

When the webhook records a settled deposit, grant_entitlements() creates the corresponding Entitlement row. The buyer receives a Stripe receipt by email and a personal delivery link.