Go to file
ahmadbilalkhalid 0ea2a68142 Fixed order in which AUTH Token is generated 2019-12-03 18:45:45 +05:00
.gitignore Initial commit 2019-09-13 10:32:23 +05:30
CHANGELOG.md Update Changelog 2019-10-13 09:17:38 +05:30
Pipfile Add parsedatetime to pipenv 2019-09-19 11:00:00 +05:30
Pipfile.lock Add parsedatetime to pipenv 2019-09-19 11:00:00 +05:30
README.md Correct script name 2019-09-19 15:58:01 +05:30
config.py Handle config not set cases more gracefully 2019-10-13 09:08:40 +05:30
env.sample Add env.sample 2019-09-19 15:36:01 +05:30
stripe_utils.py Supply interval param for creating the subscription 2019-09-19 15:13:56 +05:30
ucloud_pay.py Fixed order in which AUTH Token is generated 2019-12-03 18:45:45 +05:00



The pay module for the ucloud

  • uses etcd3 for storage
  • uses Stripe as the payment gateway

Getting started

git clone git@code.ungleich.ch:ucloud/ucloud-pay.git
cd uclou-pay
cp env.sample .env

Now, modify the params in .env file as per your setup and run.

pipenv shell
pipenv install
python ucloud_pay.py

Currently handles very basic features, such as:

1. Adding of products

curl http://ucloud-pay-server:5000/product/add -XPOST --data '-name mravi --realm test --seed testseed --product-name "IPV6 VPN" --product-description="YEARLY IPV6 subscription" --product-type=recurring --product-recurring-period=year --product-price=12000 --product-minimum-subscription-period=year'

2. Listing of products

curl http://ucloud-pay-server:5000/product/list

3. Ordering products

curl http://ucloud-pay-server:5000/product/order -XPOST --data '-name username --realm user_realm --seed user_seed --product-id  343sdf3e2423

4. Listing users orders

curl http://ucloud-pay-server:5000/order/list -XPOST --data '-name username --realm user_realm --seed user_seed 

5. Registering user's payment method (credit card for now using Stripe)

curl http://ucloud-pay-server:5000/user/register_payment -XPOST --data '-name username --realm user_realm --seed user_seed --card_number 4111111111111111 --cvc 123 --expiry_year 2020 --expiry_month 8 --card_holder_name "The test user"