Show minimum_subscription_period only for recurring products
This commit is contained in:
parent
72d651ea76
commit
8da25be8b8
1 changed files with 7 additions and 4 deletions
|
@ -64,15 +64,18 @@ def get_pricing(price_in_chf_cents, product_type, recurring_period):
|
|||
return "CHF {} (One time charge)".format(price_in_chf_cents/100)
|
||||
|
||||
def get_user_friendly_product(product_dict):
|
||||
return {
|
||||
uf_product = {
|
||||
"name": product_dict["name"],
|
||||
"description": product_dict["description"],
|
||||
"product_id": product_dict["product_id"],
|
||||
"pricing": get_pricing(product_dict["price"], product_dict["type"],
|
||||
product_dict["recurring_period"]),
|
||||
"minimum_subscription_period":
|
||||
product_dict["minimum_subscription_period"]
|
||||
product_dict["recurring_period"])
|
||||
}
|
||||
if product_dict["type"] == "recurring":
|
||||
uf_product["minimum_subscription_period"] = (
|
||||
product_dict["minimum_subscription_period"]
|
||||
)
|
||||
return uf_product
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue