Add order list command
This commit is contained in:
parent
c91454e0d2
commit
a968918eee
2 changed files with 27 additions and 0 deletions
25
commands/order.py
Normal file
25
commands/order.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import click
|
||||
import requests
|
||||
|
||||
from decouple import config
|
||||
from .helper import OTPCredentials, load_dump_pretty
|
||||
|
||||
|
||||
@click.group()
|
||||
def order():
|
||||
pass
|
||||
|
||||
|
||||
@order.command("list")
|
||||
@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)
|
||||
def list(name, realm, seed, email):
|
||||
data = {
|
||||
**OTPCredentials(name, realm, seed).get_json(),
|
||||
"email": email
|
||||
}
|
||||
r = requests.get("{}/order/list".format(config('UCLOUD_PAY_SERVER')),
|
||||
json=data)
|
||||
print(load_dump_pretty(r.content))
|
||||
Loading…
Add table
Add a link
Reference in a new issue