No description
Find a file
2019-09-19 22:04:53 +05:30
commands Remove email dependency for user 2019-09-19 15:50:36 +05:30
.gitignore break vm_action into vm.start() and vm.stop() and image.list() -> image._list() 2019-09-01 22:09:08 +05:00
Pipfile start,shutdown,suspend,resume,delete merged into one (action) 2019-08-01 15:05:38 +05:00
Pipfile.lock start,shutdown,suspend,resume,delete merged into one (action) 2019-08-01 15:05:38 +05:00
README.md Update README to include creating one-time payment products 2019-09-19 22:04:53 +05:30
ucloud.py Add order list command 2019-09-14 22:45:56 +05:30

ucloud-cli

Listing available ucloud products

(ucloud-cli) [test@ungleich ucloud-cli]$ UCLOUD_PAY_SERVER=http://127.0.0.1:5000 python ucloud.py product list
{
    "/v1/products/": {
        "description": "YEARLY IPV6 subscription",
        "name": "IPV6 VPN",
        "price": 12000,
        "recurring_duration": 31536000,
        "recurring_duration_units": 0,
        "type": "recurring"
    }
}

Adding new products

Recurring product (subscription)
(ucloud-cli) [test@ungleich ucloud-cli]$ UCLOUD_PAY_SERVER=http://127.0.0.1:5000 python ucloud.py product add \
--name xxxxxxxxxxxx \
--realm xxxxxxxxxxxx \
--seed xxxxxxxxxxxx \
--product-name "IPV6 VPN" \
--product-description="YEARLY IPV6 subscription" \
--product-type=recurring \
--product-recurring-period=year \
--product-price=12000 \
--product-minimum-subscription-period=year

One-time payment product
(ucloud-cli) [test@ungleich ucloud-cli]$ UCLOUD_PAY_SERVER=https://ucloud-pay-dev.ungleich.ch python ucloud.py product add \
--name xxxxxxxxxxxx \
--realm xxxxxxxxxxxx \
--seed xxxxxxxxxxxx \
--product-name "One time membership" \
--product-description="One time membership fees" \
--product-type=one-time \
--product-price=3500

Register a payment method (cc for now)

(ucloud-cli) [test@ungleich ucloud-cli]$ UCLOUD_PAY_SERVER=http://127.0.0.1:5000 python ucloud.py user register-payment \
 --name xxxxxxxxxxxx \
 --realm xxxxxxxx \
 --seed xxxxxxxxxx \
 --cc --number 4242424242424242 \
 --cvc 225 \
 --expiry-month 08 \
 --expiry-year 2022 \
 --card-holder-name "The tester"

Order a product

(ucloud-cli) [test@ungleich ucloud-cli]$ UCLOUD_PAY_SERVER=http://127.0.0.1:5000 python ucloud.py product order \
--name xxxxxxxxxxxxxxxxx \
--realm xxxxxxxxxxxxxxxx \
--seed xxxxxxxxxxxxxxxx \
--product-id aabc34208e514803a0ee62d697b37e8c

Listing different orders

(ucloud-cli) [test@ungleich ucloud-cli]$  UCLOUD_PAY_SERVER=127.0.0.1:5000 python ucloud.py order list \  
--name xxxxxxxxxxxxxxx \
--realm xxxxxxxxxxxxxxx \ 
--seed xxxxxxxxxxxxxxxxx