Reformat plan helper

This commit is contained in:
Mark Veidemanis 2022-07-21 13:48:34 +01:00
parent 56f5b07540
commit 0b6f3ae129
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,6 @@
from core.models import Plan from core.models import Plan
def assemble_plan_map(product_id_filter=None): def assemble_plan_map(product_id_filter=None):
""" """
Get all the plans from the database and create an object Stripe wants. Get all the plans from the database and create an object Stripe wants.
@ -9,8 +10,10 @@ def assemble_plan_map(product_id_filter=None):
if product_id_filter: if product_id_filter:
if plan.product_id != product_id_filter: if plan.product_id != product_id_filter:
continue continue
line_items.append({ line_items.append(
{
"price": plan.product_id, "price": plan.product_id,
"quantity": 1, "quantity": 1,
}) }
)
return line_items return line_items