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
def list_plans():
    """
    List all existing plans on Stripe.

    :return: Stripe plans
    """
    return logging.info(PaymentPlan.list())
Ejemplo n.º 4
0
def list_plans():
    """
    List all existing plans on Stripe.

    :return: Stripe plans
    """
    return logging.info(PaymentPlan.list())
Ejemplo n.º 5
0
def sync_plans():
    """
    Sync (upsert) STRIPE_PLANS to Stripe.

    :return: None
    """
    if STRIPE_PLANS is None:
        return None

    for _, value in STRIPE_PLANS.iteritems():
        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)

    return None
def sync_plans():
    """
    Sync (upsert) STRIPE_PLANS to Stripe.

    :return: None
    """
    if STRIPE_PLANS is None:
        return None

    for _, value in STRIPE_PLANS.iteritems():
        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)

    return None