Add minimum_subscription_duration to recurring products
This commit is contained in:
parent
5e4b105b97
commit
b93aefa607
1 changed files with 6 additions and 2 deletions
|
@ -85,7 +85,8 @@ class ListProducts(Resource):
|
||||||
"product_id": product_id,
|
"product_id": product_id,
|
||||||
"pricing": get_pricing(p_json["price"], p_json["type"],
|
"pricing": get_pricing(p_json["price"], p_json["type"],
|
||||||
p_json["recurring_duration"]),
|
p_json["recurring_duration"]),
|
||||||
"minumum_subscription_duration": "1 month"
|
"minimum_subscription_duration":
|
||||||
|
p_json["minumum_subscription_duration"]
|
||||||
}
|
}
|
||||||
prod_dict[product_id] = actual_product
|
prod_dict[product_id] = actual_product
|
||||||
logging.debug("Products = {}".format(prod_dict))
|
logging.debug("Products = {}".format(prod_dict))
|
||||||
|
@ -119,7 +120,10 @@ class AddProduct(Resource):
|
||||||
"price": data["product_price"],
|
"price": data["product_price"],
|
||||||
"recurring_duration": data["product_recurring_duration"],
|
"recurring_duration": data["product_recurring_duration"],
|
||||||
"recurring_duration_units":
|
"recurring_duration_units":
|
||||||
data["product_recurring_duration_units"]
|
data["product_recurring_duration_units"],
|
||||||
|
"minimum_subscription_duration":
|
||||||
|
data["product_minimum_subscription_duration"] if
|
||||||
|
data["product_type"] == "recurring" else 0
|
||||||
}
|
}
|
||||||
logging.debug("Adding product data: {}".format(str(product_value)))
|
logging.debug("Adding product data: {}".format(str(product_value)))
|
||||||
client.put(product_key, product_value, value_in_json=True)
|
client.put(product_key, product_value, value_in_json=True)
|
||||||
|
|
Loading…
Reference in a new issue