Remove email dependency for product
This commit is contained in:
parent
ed74b2ecb3
commit
22ac971db8
1 changed files with 7 additions and 10 deletions
|
@ -1,7 +1,7 @@
|
|||
import click
|
||||
import requests
|
||||
|
||||
from decouple import config
|
||||
|
||||
from .helper import OTPCredentials, load_dump_pretty
|
||||
|
||||
|
||||
|
@ -28,11 +28,10 @@ def list():
|
|||
@click.option("--product-price", required=True, help="Price in CHF cents",
|
||||
type=int)
|
||||
@click.option("--product-recurring-period", required=False,
|
||||
help="Only used for products with recurring costs",
|
||||
type=int)
|
||||
help="Only used for products with recurring costs")
|
||||
@click.option("--product-minimum-subscription-period", required=False,
|
||||
type=int, help="Minimum period for which a user needs to "
|
||||
"subscribe the product for", default=0)
|
||||
help="Minimum period for which a user needs to "
|
||||
"subscribe the product for")
|
||||
def add(name, realm, seed, product_name, product_description, product_type,
|
||||
product_price, product_recurring_period,
|
||||
product_minimum_subscription_period):
|
||||
|
@ -55,13 +54,11 @@ def add(name, realm, seed, product_name, product_description, product_type,
|
|||
@click.option("--name", envvar="OTP_NAME", required=True)
|
||||
@click.option("--realm", envvar="OTP_REALM", required=True)
|
||||
@click.option("--seed", envvar="OTP_SEED", required=True)
|
||||
@click.option("--email", required=True)
|
||||
@click.option("--product-id", help="The uuid of the product", required=True)
|
||||
def order(name, realm, seed, product_id, email):
|
||||
def order(name, realm, seed, product_id):
|
||||
data = {
|
||||
**OTPCredentials(name, realm, seed).get_json(),
|
||||
"product_id": product_id,
|
||||
"email": email
|
||||
"product_id": product_id
|
||||
}
|
||||
r = requests.post("{}/product/order".format(config('UCLOUD_PAY_SERVER')),
|
||||
json=data)
|
||||
|
|
Loading…
Reference in a new issue