{
  "schema_version": 1,
  "diagram_type": "sequence",
  "meta": {
    "title": "iSpeed.my — Cash Deposit & Payment Flow",
    "subtitle": "Online deposit via eGHL payment gateway",
    "output": "ispeed-cash-payments.html",
    "viewBox": [1080, 590],
    "column_fit": "spread",
    "animation": "trace",
    "quality_profile": "showcase",
    "views": [
      { "id": "initiate", "label": "Initiate Payment", "focus": ["user", "app", "mobile-api", "eghl"], "note": "Request gateway details and vendor URL" },
      { "id": "callback", "label": "Payment & Callback", "focus": ["eghl", "mobile-api", "vbroker"], "note": "Gateway callback and ledger persistence" },
      { "id": "full-flow", "label": "Full Flow", "focus": ["user", "app", "mobile-api", "vbroker", "eghl"], "note": "Complete deposit lifecycle" }
    ]
  },
  "participants": [
    { "id": "user", "type": "external", "label": "User", "sublabel": "Trader" },
    { "id": "app", "type": "frontend", "label": "React Native App", "sublabel": "Expo SDK 56" },
    { "id": "mobile-api", "type": "backend", "label": "Mobile API", "sublabel": "rt-mx-mobile-api" },
    { "id": "vbroker", "type": "backend", "label": "VBroker API", "sublabel": "/cash/deposit" },
    { "id": "eghl", "type": "external", "label": "eGHL Gateway", "sublabel": "payment gateway" }
  ],
  "segments": [
    { "from": 150, "to": 295, "label": "Initiate Deposit" },
    { "from": 305, "to": 535, "label": "Payment & Callback" }
  ],
  "messages": [
    { "id": "cp1", "from": "user", "to": "app", "y": 160, "label": "Enter deposit amount", "variant": "default" },
    { "id": "cp2", "from": "app", "to": "mobile-api", "y": 190, "label": "CashDepositOnline (12433)", "variant": "emphasis" },
    { "id": "cp3", "from": "mobile-api", "to": "eghl", "y": 220, "label": "getGHLResponse", "variant": "dashed" },
    { "id": "cp4", "from": "eghl", "to": "mobile-api", "y": 250, "label": "paymentGatewayDetails + vendorURL", "variant": "return" },
    { "id": "cp5", "from": "mobile-api", "to": "app", "y": 280, "label": "vendorURL", "variant": "return" },
    { "id": "cp6", "from": "app", "to": "user", "y": 310, "label": "Open payment page", "variant": "return" },
    { "id": "cp7", "from": "user", "to": "eghl", "y": 340, "label": "Complete payment", "variant": "default" },
    { "id": "cp8", "from": "eghl", "to": "mobile-api", "y": 370, "label": "server callback", "variant": "dashed" },
    { "id": "cp9", "from": "mobile-api", "to": "vbroker", "y": 400, "label": "/cash/deposit", "variant": "emphasis" },
    { "id": "cp10", "from": "vbroker", "to": "mobile-api", "y": 430, "label": "cashTranId", "variant": "return" },
    { "id": "cp11", "from": "mobile-api", "to": "app", "y": 460, "label": "deposit result", "variant": "return" },
    { "id": "cp12", "from": "app", "to": "user", "y": 490, "label": "Show receipt", "variant": "return" }
  ],
  "activations": [
    { "participant": "app", "from": 155, "to": 500, "type": "frontend" },
    { "participant": "mobile-api", "from": 185, "to": 475, "type": "backend" },
    { "participant": "vbroker", "from": 395, "to": 440, "type": "backend" },
    { "participant": "eghl", "from": 215, "to": 375, "type": "external" }
  ],
  "cards": [
    {
      "dot": "emerald",
      "title": "eGHL Gateway",
      "items": [
        "Deposit builds CashDepositOnlineRequest",
        "Hash is SHA-256 of password+serviceId+paymentId+amount+currencyCode",
        "Callbacks return OK or FAIL"
      ]
    },
    {
      "dot": "violet",
      "title": "Ledger",
      "items": [
        "Deposits persist to vb_cash_tran",
        "Status polled via UPDATE_EGHL_PAYMENT_COUNT",
        "deposit.max_amount is 30000"
      ]
    },
    {
      "dot": "rose",
      "title": "Client Notes",
      "items": [
        "Offline deposit page posts the online RequestID 12433",
        "FPX page is UI-only",
        "Inter-cash transfer uses RequestID 12354"
      ]
    }
  ]
}
