|
|
@ -148,7 +148,7 @@ def get_plans(app_name) :
|
|
|
|
# This function returns the plans for a given application
|
|
|
|
# This function returns the plans for a given application
|
|
|
|
# We assume the application name is the prefix of the plan identifier in stripe
|
|
|
|
# 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 = stripe.Plan.list(limit=10)
|
|
|
|
|
|
|
|
|
|
|
|
# plans = handler.cast(plans.data)
|
|
|
|
# plans = handler.cast(plans.data)
|
|
|
@ -158,10 +158,16 @@ def get_plans(app_name) :
|
|
|
|
if uid is not None:
|
|
|
|
if uid is not None:
|
|
|
|
couchdb = Couchdb(uri=CONFIG['couchdb']['uri'],dbname=app_name,uid=uid,create=False)
|
|
|
|
couchdb = Couchdb(uri=CONFIG['couchdb']['uri'],dbname=app_name,uid=uid,create=False)
|
|
|
|
handler = Domain.User(couchdb.dbase,stripe)
|
|
|
|
handler = Domain.User(couchdb.dbase,stripe)
|
|
|
|
|
|
|
|
if handler.getId(uid) is not None:
|
|
|
|
handler.init(uid,[])
|
|
|
|
handler.init(uid,[])
|
|
|
|
subs = handler.subscriptions().data
|
|
|
|
subs = handler.subscriptions().data
|
|
|
|
ids = [item.id for item in subs]
|
|
|
|
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
|
|
|
|
# @TODO: Mark the plans the current user is signed up for
|
|
|
|