Ejemplo n.º 1
0
def delete_plans(plan_ids):
    """
    Delete 1 or more plans from Stripe.
    :return: None
    """
    for plan_id in plan_ids:
        PaymentPlan.delete(plan_id)

    return None
Ejemplo n.º 2
0
def delete_plans(plan_ids):
    """
    Delete 1 or more plans from Stripe.

    :return: None
    """
    for plan_id in plan_ids:
        PaymentPlan.delete(plan_id)

    return None
Ejemplo n.º 3
0
def list_plans():
    """
    List all existing plans on Stripe.

    :return: Stripe plans
    """
    click.echo(PaymentPlan.list())
def delete_plan(plans=None):
    """
    Delete plan or plans 
    : param plan : plan name
    : type : str

    :return : none

    """
    del_plan = []
    if plans:
        del_plan.append(plans)
        for plan in del_plan:
            PaymentPlan.delete(plan)

    return None
Ejemplo n.º 5
0
def sync_plans():
    """
    Sync (upset) STRIPE_PLANS to Stripe.

    :return: None
    """
    if app.config['STRIPE_PLANS'] is None:
        return None

    for _, value in app.config['STRIPE_PLANS'].items():
        plan = PaymentPlan.retrieve(value.get('id'))

        if plan:
            PaymentPlan.update(id=value.get('id'),
                               name=value.get('name'),
                               metadata=value.get('metadata'),
                               statement_descriptor=value.get('statement_descriptor'))
        else:
            PaymentPlan.create(**value)
def list_plan():
    """List all the plans"""

    return PaymentPlan.list()