Skip to content

Billing Portal: Phase 1 UI#170

Draft
overheadhunter wants to merge 2 commits into
developfrom
feature/store-migration-phase1
Draft

Billing Portal: Phase 1 UI#170
overheadhunter wants to merge 2 commits into
developfrom
feature/store-migration-phase1

Conversation

@overheadhunter

Copy link
Copy Markdown
Member

Add UI for phase 1 of Hub self-service billing portal

sequenceDiagram
    participant Hub as Cryptomator Hub
    participant Web as Billing Page
    participant API as API<br/>(api.cryptomator.org)
    actor Mail as User's inbox

    Hub-)Web: redirect /hub/billing#35;?hub_id=42&return_url=xyz
    activate Web

    %% PHASE 1
    note over Hub,Mail: PHASE 1
    Web->>+API: GET /billing/customers/challenge
    API-->>-Web: challenge
    activate Web
    Web->>Web: Solve Challenge
    deactivate Web

    Web->>+API: GET /billing/customers/by-hub-id/42?captcha=...
    alt 404
        API-->>Web: 404: hub_id not found
        activate Web
        Web->>Web: Enter Email Address
        deactivate Web
    else 200
        API-->>-Web: 200: h***r@e***e.com
    end

    Web->>+API: GET /billing/session/challenge
    API-->>-Web: challenge
    activate Web
    Web->>Web: Solve Challenge
    deactivate Web
    Web->>+API: POST /billing/session<br/>{hub_id=42, return_url=..., fragment_or_query=..., email?=...}
    API->>API: Create Session
    API--)+Mail: email with link
    API-->>-Web: 204
    deactivate Web

    Mail->>-Web: open /hub/billing?session=1337
    activate Web
    Web->>+API: GET /billing/session/1337
    alt 200
        API-->>-Web: {return_url, fragement_or_query, ...}
    else 404
        note right of Web: Link Expired
    end
Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants