Create sequence diagrams with simple online tool

Swimlanes.io is a free webapp for making sequence diagrams. You simply edit the text on the left and the diagram is updated in real time. You can download your sequence diagrams as images or distribute with a link.

title: Brite - Bank Account Selection order: Customer, Brite Client, Merchant, Brite Client // Adding the SDK to your client _: **1. Display Brite's Assets** (Brite and bank logos) note: Go to [swimlanes for Brite's Assets](https://swimlanes.io/u/TfVopPMotO) _: **2. Merchant authorisation** note: Go to [swimlanes for Merchant Authorisation](https://swimlanes.io/u/knxhtrUHAW) _: **3. Create a session** Merchant -> Brite: `POST /api/session.create_bank_account_selection` Brite -> Merchant: Response with `url`, `token` and `id`. _: **4. Render Client and complete the bank account selection** // Server -> Merchant: Share with the front-end `token` Merchant -> Brite Client: Initiate Brite Client `new Brite([token])` Brite Client -> Customer: Render Brite Client note_: Please follow [recommendations for rendering](https://docs.britepayments.com/technical-documentation/rendering-the-brite-client/). Note that the client should close once the session completes. Customer -> Brite Client: Select customer's bank Brite Client -> Brite: Authentication with bank _: **5. Handling callbacks** Brite -> Merchant: Notification to `callback[].url` note_: Notification about a change in session state with `session_id` _: **6. Collect the customer's bank account details** Merchant -> Brite: `POST /session.get` with `session_id` from the notification Brite -> Merchant: Response with bank account details // //////////////////////////////////////////////////// // Notify about the session state if: Session notification with `session_state: 10` (`STATE_ABORTED`) and `11` (`STATE_FAILED`) Merchant -> Customer: Notify about failed attempt to collect the bank account information Merchant -> Customer: Return to bank account selection options else: Session notification with `session_state: 12` (`STATE_COMPLETED`) // //////////////////////////////////////////////////// // STATE_COMPLETED (12): The bank selection flow has finished without errors in the customer bank. // Store the session_id to refer to Brite's system Merchant -> Merchant: Update customer's bank account details based on the `session_id` response Merchant -> Brite Client: Close Brite Client Brite Client -> Merchant: Removes Brite Client Merchant -> Customer: Confirm collection of bank account details Customer -> Merchant: Continues on merchant's flow end