Add proper messaging if an organization has gone over the repo limit. This change also moves plan information into the server
This commit is contained in:
parent
1f0b142535
commit
9fa77aaa48
6 changed files with 226 additions and 99 deletions
47
data/plans.py
Normal file
47
data/plans.py
Normal file
|
@ -0,0 +1,47 @@
|
|||
import json
|
||||
|
||||
USER_PLANS = [
|
||||
{
|
||||
'title': 'Open Source',
|
||||
'price': 0,
|
||||
'privateRepos': 0,
|
||||
'stripeId': 'free',
|
||||
'audience': 'Share with the world',
|
||||
},
|
||||
{
|
||||
'title': 'Micro',
|
||||
'price': 700,
|
||||
'privateRepos': 5,
|
||||
'stripeId': 'micro',
|
||||
'audience': 'For smaller teams',
|
||||
},
|
||||
{
|
||||
'title': 'Basic',
|
||||
'price': 1200,
|
||||
'privateRepos': 10,
|
||||
'stripeId': 'small',
|
||||
'audience': 'For your basic team',
|
||||
},
|
||||
{
|
||||
'title': 'Medium',
|
||||
'price': 2200,
|
||||
'privateRepos': 20,
|
||||
'stripeId': 'medium',
|
||||
'audience': 'For medium-sized teams',
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
def getPlan(id):
|
||||
""" Returns the plan with the given ID or None if none. """
|
||||
for plan in USER_PLANS:
|
||||
if plan['stripeId'] == id:
|
||||
return plan
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def isPlanActive(stripe_subscription):
|
||||
""" Returns whether the plan is active. """
|
||||
# TODO: this.
|
||||
return True
|
Reference in a new issue