Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Console 2.0] Fiat Payments #247

Closed
12 of 17 tasks
baktun14 opened this issue Jun 24, 2024 · 4 comments
Closed
12 of 17 tasks

[Console 2.0] Fiat Payments #247

baktun14 opened this issue Jun 24, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request P1 priority 1 feature/ enhancement

Comments

@baktun14
Copy link
Contributor

baktun14 commented Jun 24, 2024

Overview and Problem Statement

One of the most, if not the most, requested feature of the Akash Console is to be able to pay with fiat, aka credit cards. The system will be credit based (pre-payment), which will easily allow for free trial through free credits, like all the other cloud platforms currently do.

The goal is to keep the current deployment UX the same and only abstract the wallet interactions with a managed wallet server side.

This is a high level specification of the order and how we will implement the system.

  • API to interact with the managed wallet
    • Class to manage wallets (Create wallet derived from main seed, Authz from main wallet to user wallet, sign transactions)
    • [ ] Class to manage deployments (send manifest to provider, interact with provider for logs/shell, write tests, need to think about network upgrades)
    • Generic signing tx endpoint, instead of creating specific endpoints for each of the transactions from the frontend
    • User service to assign wallet/deployments (Update the db schema, write tests)
    • Structure the payment API module/router
  • Credit manager; scheduled tasks to manage user credits
    • [ ] Auto-refill deployment deposits
    • Auto-refill authz for the user managed wallets
    • Implement Stripe integration
    • [ ] Auto-refill account credits with credit card
    • Improve logging
    • Free trial
  • Frontend
    • Deployment detail, and everywhere we display the balance, modify to hide balance of the deployment since it's handled for the user
  • Sign in with Github
  • Email notifications
    • Credit purchase confirmation
  • Billing section
    • Credit transaction history

Db Schema changes

v1.0

  • user_payment

    • user_id? null when anonymous
    • AddressIndex (hdpath)
    • Address
    • StripeCustomerId
    • CreditAmount
  • user_certificate

    • cert
    • cert_key (Encrypted)
  • UserDeployment

    • Name
    • Dseq
    • SDL (Encrypted)
  • CreditActivity (For integrity and debug + billing)

    • Add/Remove credit
    • Authz Tx hash
    • StripePaymentId
@baktun14 baktun14 added enhancement New feature or request P1 priority 1 feature/ enhancement labels Jun 24, 2024
@github-project-automation github-project-automation bot moved this to Backlog (not prioritized) in Core Product and Engineering Roadmap Jun 24, 2024
@baktun14 baktun14 moved this from Backlog (not prioritized) to Up Next (prioritized) in Core Product and Engineering Roadmap Jun 24, 2024
@ygrishajev ygrishajev moved this from Up Next (prioritized) to In Progress (prioritized) in Core Product and Engineering Roadmap Jun 26, 2024
ygrishajev added a commit that referenced this issue Jun 27, 2024
ygrishajev added a commit that referenced this issue Jun 27, 2024
ygrishajev added a commit that referenced this issue Jun 28, 2024
ygrishajev added a commit that referenced this issue Jun 28, 2024
ygrishajev added a commit that referenced this issue Jul 3, 2024
as a part of this:
- implement transactions to hide from business logic layer
- cover the endpoint with functional tests

refs #247
ygrishajev added a commit that referenced this issue Jul 4, 2024
ygrishajev added a commit that referenced this issue Jul 9, 2024
As a part of this add:
- DI container
- Drizzle ORM
- logging

refs #247
ygrishajev added a commit that referenced this issue Jul 9, 2024
As a part of this add:
- DI container
- Drizzle ORM
- logging

refs #247
ygrishajev added a commit that referenced this issue Jul 9, 2024
As a part of this add:
- DI container
- Drizzle ORM
- logging

refs #247
ygrishajev added a commit that referenced this issue Jul 9, 2024
As a part of this add:
- DI container
- Drizzle ORM
- logging

refs #247
ygrishajev added a commit that referenced this issue Jul 9, 2024
As a part of this add:
- DI container
- Drizzle ORM
- logging

refs #247
ygrishajev added a commit that referenced this issue Jul 9, 2024
As a part of this add:
- DI container
- Drizzle ORM
- logging

refs #247
@ygrishajev
Copy link
Contributor

At the moment, initial wallet creation is implemented on the backend, allowing for the creation of a wallet for a user and granting it a defined trial spending limit. The next steps involve using that wallet to create deployments. The following steps are currently in progress:
1. A generic sign endpoint is being added so we can sign transactions from the console UI as usual but on our backend (~1-2 days).
2. Updates to the console UI to use that endpoint (~1 week).

With the above, we should be able to adjust the UI to allow users to choose fiat payments, receive a wallet with trial allowance, and create deployments.

Upcoming tasks:
1. Billing setup in the UI (~1 week).
2. Implementing fiat billing endpoints on the backend (likely webhooks) (~1 week).
3. Regular jobs to refill wallets and charge users (~2-4 days).
4. Critical notifications (~2-4 days).

Note: all the estimates are approximate as I personally see them.

ygrishajev added a commit that referenced this issue Aug 29, 2024
ygrishajev added a commit that referenced this issue Aug 29, 2024
ygrishajev added a commit that referenced this issue Aug 30, 2024
ygrishajev added a commit that referenced this issue Aug 30, 2024
ygrishajev added a commit that referenced this issue Aug 30, 2024
ygrishajev added a commit that referenced this issue Aug 30, 2024
ygrishajev added a commit that referenced this issue Aug 30, 2024
ygrishajev added a commit that referenced this issue Sep 2, 2024
@baktun14
Copy link
Contributor Author

baktun14 commented Oct 7, 2024

I will close this issue as completed and create separate issues for the other features.

@baktun14 baktun14 closed this as completed Oct 7, 2024
@github-project-automation github-project-automation bot moved this from In Progress (prioritized) to Released (in Prod) in Core Product and Engineering Roadmap Oct 7, 2024
@alexx855
Copy link

Mind if i suggest to use stripe elements instead of redirecting the user to stripe? Stripe does also support payments with crypto now, maybe the UI can be simplified and we can just allow user to top up crypto using stripe, without leaving the console or switching modes

@ygrishajev
Copy link
Contributor

hey @alexx855 thanks for the suggestion. This can make sense for sure. The current implementation is an first easiest MVP, so we're going to be improving this with time. This kind of feedback is helpful.

@anilmurty FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P1 priority 1 feature/ enhancement
Projects
Status: Released (in Prod)
Development

No branches or pull requests

4 participants