|
|
|
@ -148,7 +148,7 @@ def get_plans(app_name) :
|
|
|
|
|
# This function returns the plans for a given application
|
|
|
|
|
# We assume the application name is the prefix of the plan identifier in stripe
|
|
|
|
|
#
|
|
|
|
|
uid = session['uid'] if 'uid' in session else 'nyemba@gmail.com'
|
|
|
|
|
uid = session['uid'] if 'uid' in session else None
|
|
|
|
|
plans = stripe.Plan.list(limit=10)
|
|
|
|
|
|
|
|
|
|
# plans = handler.cast(plans.data)
|
|
|
|
@ -158,10 +158,16 @@ def get_plans(app_name) :
|
|
|
|
|
if uid is not None:
|
|
|
|
|
couchdb = Couchdb(uri=CONFIG['couchdb']['uri'],dbname=app_name,uid=uid,create=False)
|
|
|
|
|
handler = Domain.User(couchdb.dbase,stripe)
|
|
|
|
|
|
|
|
|
|
handler.init(uid,[])
|
|
|
|
|
subs = handler.subscriptions().data
|
|
|
|
|
ids = [item.id for item in subs]
|
|
|
|
|
if handler.getId(uid) is not None:
|
|
|
|
|
handler.init(uid,[])
|
|
|
|
|
subs = handler.subscriptions().data
|
|
|
|
|
ids = [item.id for item in subs]
|
|
|
|
|
else:
|
|
|
|
|
# #
|
|
|
|
|
# This should address any case of the database of customers being out of sync
|
|
|
|
|
# @TODO: Have a log suggesting a utility imports the customer
|
|
|
|
|
#
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# @TODO: Mark the plans the current user is signed up for
|
|
|
|
|