Skip to content

fiat payment #638

@rawdaGastan

Description

@rawdaGastan

Requirements

  • Remove VMs and IPs from quota
  • Remove quota and introduce balance and voucher balance for user
  • VMs will have a state (in progress, success, failed)

Payment scenario

Vouchers

  • user model will have a voucher balance can be used to deploy
  • Voucher balanced is charged only from vouchers
  • when a voucher is applied, voucher balance should be updated
  • Once user has applied a voucher we should settle pending payments (invoices)
  • Check If voucher user has enough money to continue his/her deployment (If no we should inform her/him that we will delete the VM after x months)

Admin

  • Admin will set prices for vms and k8s
  • list all invoices

Periodic Invoices

  • User can get, pay an invoice
  • support balance, voucher and card methods to pay invoices and the ability to mix between them
  • User can list invoices
  • Every month, we should create an invoice for each user with active deployments (containing all vms consumed during the month)
  • Invoices are charged from balance
  • If no balance? invoices are paid from user default payment method - If no card balance? use another card
  • If no default card for user, check all user cards
  • Settle invoices according to their total cost (sort)

Cards

  • Each user should add valid card
  • cards should be unique
  • we should verify cards (I think stripe do?)
  • Old users should provide their credit card too, except they use vouchers
  • user cannot delete all cards while having active deployments
  • Add an option to add more than one credit card
  • User can list his cards
  • User can set default card
  • Once user has added a new card we settle pending payments (invoices)

User can deploy?

  • When user has a valid card
  • When user has enough voucher balance (excluding other active deployments)

VMs price increase

  • If an admin increased the price of a vm, old vms should be paid according to its old prices
  • new vms should be paid according to new prices
  • save prices with each deployment

Balance

  • Each user can charge his balance
  • Once user has charged his/her balance we settle pending payments (invoices)
  • Debt balance is updated every month with total usage of deployments

Delay

  • If the user didn't pay for his/her deployment - no credit (we will remove it after 3 months)
  • If the user didn't pay for his/her deployment (no credit), a reminder email will be sent every week including his invoice

Notes

  • DB will record vms/hr used per user
  • VM/K8S will have around 6 items (small/medium/larger with/without public IP)

Investigation

  • stripe usage
  • alternative API

Questions

  • should I allow user to delete Invoices? (No)
  • what if user with voucher money didn't delete the vm at the end of the month? should we delete it? (After grace period we will delete it)
  • should we add if invoice paid using voucher balance?
  • should we check debts on adding cards?
  • should we add customer support chat?

Metadata

Metadata

Assignees

Labels

featureNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions