def admin(): """If merchant is logged in display billing plans in created and active states """ if session.get('logged_in') and session.get('merchant'): plans_created_query_dict = BillingPlan.all({ "status": "CREATED", "sort_order": "DESC" }) plans_created = plans_created_query_dict.to_dict().get('plans') if not plans_created: plans_created = [] plans_active_query_dict = BillingPlan.all({ "status": "ACTIVE", "page": 4, "total_required": "yes" }) plans_active = plans_active_query_dict.to_dict().get('plans') if not plans_active: plans_active = [] return render_template('admin.html', plans_created=plans_created, plans_active=plans_active) else: return redirect(url_for('login'))
def admin(): """If merchant is logged in display billing plans in created and active states """ if session.get('logged_in') and session.get('merchant'): plans_created = BillingPlan.all({"status": "CREATED", "sort_order": "DESC"})['plans'] plans_active = BillingPlan.all({"status": "ACTIVE", "sort_order": "DESC"})['plans'] return render_template('admin.html', plans_created=plans_created, plans_active=plans_active) else: return redirect(url_for('login'))
def subscriptions(): """If customer is logged in display active billing plans in descending order of creation time """ if session.get('logged_in') and session.get('customer'): plans_active = BillingPlan.all({"status": "ACTIVE", "sort_order": "DESC"})['plans'] return render_template('subscriptions.html', plans=plans_active) else: return redirect(url_for('login'))
def admin(): """If merchant is logged in display billing plans in created and active states """ if session.get('logged_in') and session.get('merchant'): plans_created_query_dict = BillingPlan.all({"status": "CREATED", "sort_order": "DESC"}) plans_created = plans_created_query_dict.to_dict().get('plans') if not plans_created: plans_created = [] plans_active_query_dict = BillingPlan.all({"status": "ACTIVE", "page_size": 5, "page": 0, "total_required": "yes"}) plans_active = plans_active_query_dict.to_dict().get('plans') if not plans_active: plans_active = [] return render_template('admin.html', plans_created=plans_created, plans_active=plans_active) else: return redirect(url_for('login'))
def get_billing_plans(self, status="ACTIVE"): """ status: CREATED, ACTIVE, INACTIVE, ALL :param status: :return: """ plans = BillingPlan.all({"status": status}) if 'plans' in plans: return plans["plans"] return []
def get(self): status = self.get_argument('status') # ACTIVE INACTIVE plans = [] plans_query_dict = BillingPlan.all({ "status": status, "sort_order": "DESC" }) if plans_query_dict: plans = plans_query_dict.to_dict().get('plans') self.write({'response': plans})
def get(self): plans_created = [] plans_active = [] plans_created_query_dict = BillingPlan.all({ "status": "CREATED", "sort_order": "DESC" }) plans_created = plans_created_query_dict.to_dict().get('plans') plans_active_query_dict = BillingPlan.all({ "status": "ACTIVE", "page_size": 5, "page": 0, "total_required": "yes" }) plans_active = plans_active_query_dict.to_dict().get('plans') self.write({ "response": { "plans_created": plans_created, "plans_active": plans_active } })
def subscriptions(): """If customer is logged in display active billing plans in descending order of creation time """ if session.get('logged_in') and session.get('customer'): plans_active_query_dict = BillingPlan.all({"status": "ACTIVE", "sort_order": "DESC"}) if plans_active_query_dict: plans_active = plans_active_query_dict.to_dict().get('plans') else: plans_active = [] return render_template('subscriptions.html', plans=plans_active) else: return redirect(url_for('login'))
from paypalrestsdk import BillingPlan import logging logging.basicConfig(level=logging.INFO) history = BillingPlan.all({"status": "CREATED", "page_size": 5, "page": 1, "total_required": "yes"}) print(history) print("List BillingPlan:") for plan in history.plans: print(" -> BillingPlan[%s]" % (plan.id))
def get_all_billing_plans(self): history = BillingPlan.all({"status": "ACTIVE", "sort_order": "DESC"}) #if history: # for plan in history.plans: # print("{}".format(plan.id)) return history
def getplans(): plans = BillingPlan.all(api=api) if 'plans' in plans: return plans['plans'] else: return None
from paypalrestsdk import BillingPlan import logging logging.basicConfig(level=logging.INFO) history = BillingPlan.all( {"status": "CREATED", "page_size": 5, "page": 1, "total_required": "yes"}) print(history) print("List BillingPlan:") for plan in history.plans: print(" -> BillingPlan[%s]" % (plan.id))
from paypalrestsdk import BillingPlan import logging logging.basicConfig(level=logging.INFO) history = BillingPlan.all({"status": "CREATED"}) print("List BillingPlan:") for plan in history.plans: print(" -> BillingPlan[%s]" % (plan.id))