48 lines
873 B
Python
48 lines
873 B
Python
|
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
|