Add the business plans in.

This commit is contained in:
yackob03 2013-11-05 14:40:45 -05:00
parent 1cd4fa8d9b
commit b11ab44285
6 changed files with 145 additions and 46 deletions

View file

@ -1,4 +1,5 @@
import json
import itertools
USER_PLANS = [
{
@ -27,21 +28,60 @@ USER_PLANS = [
'price': 2200,
'privateRepos': 20,
'stripeId': 'medium',
'audience': 'For medium-sized teams',
'audience': 'For medium teams',
},
{
'title': 'Large',
'price': 5000,
'privateRepos': 50,
'stripeId': 'large',
'audience': 'For larger teams',
},
]
BUSINESS_PLANS = [
{
'title': 'Open Source',
'price': 0,
'privateRepos': 0,
'stripeId': 'bus-free',
'audience': 'Committment to FOSS',
},
{
'title': 'Skiff',
'price': 2500,
'privateRepos': 10,
'stripeId': 'bus-micro',
'audience': 'For startups',
},
{
'title': 'Yacht',
'price': 5000,
'privateRepos': 20,
'stripeId': 'bus-small',
'audience': 'For small businesses',
},
{
'title': 'Freighter',
'price': 10000,
'privateRepos': 50,
'stripeId': 'bus-medium',
'audience': 'For normal businesses',
},
{
'title': 'Tanker',
'price': 20000,
'privateRepos': 125,
'stripeId': 'bus-large',
'audience': 'For large businesses',
},
]
def getPlan(id):
def get_plan(id):
""" Returns the plan with the given ID or None if none. """
for plan in USER_PLANS:
for plan in itertools.chain(USER_PLANS, BUSINESS_PLANS):
if plan['stripeId'] == id:
return plan
return None
def isPlanActive(stripe_subscription):
""" Returns whether the plan is active. """
# TODO: this.
return True