Add minimum_subscription_duration for product

This commit is contained in:
PCoder 2019-09-19 10:54:36 +05:30
parent 2b5262f530
commit a8a53ff28f

View file

@ -32,9 +32,13 @@ def list():
type=int) type=int)
@click.option("--product-recurring-duration-units", required=False, type=int, @click.option("--product-recurring-duration-units", required=False, type=int,
help="Unit of the recurring costs", default=0) help="Unit of the recurring costs", default=0)
@click.option("--product-minimum-subscription-duration", required=False,
type=int, help="Minimum duration for which a user needs to "
"subscribe the product for", default=0)
def add(name, realm, seed, product_name, product_description, product_type, def add(name, realm, seed, product_name, product_description, product_type,
product_price, product_recurring_duration, product_price, product_recurring_duration,
product_recurring_duration_units): product_recurring_duration_units,
product_minimum_subscription_duration):
data = { data = {
**OTPCredentials(name, realm, seed).get_json(), **OTPCredentials(name, realm, seed).get_json(),
"product_name": product_name, "product_name": product_name,
@ -42,7 +46,9 @@ def add(name, realm, seed, product_name, product_description, product_type,
"product_type": product_type, "product_type": product_type,
"product_price": product_price, "product_price": product_price,
"product_recurring_duration": product_recurring_duration, "product_recurring_duration": product_recurring_duration,
"product_recurring_duration_units": product_recurring_duration_units "product_recurring_duration_units": product_recurring_duration_units,
"product_minimum_subscription_duration":
product_minimum_subscription_duration
} }
r = requests.post("{}/product/add".format(config('UCLOUD_PAY_SERVER')), r = requests.post("{}/product/add".format(config('UCLOUD_PAY_SERVER')),
json=data) json=data)