README.md updated and reorganized, Improved error handling for configparser and ldap manager, requirements.txt added

This commit is contained in:
ahmadbilalkhalid 2020-02-19 11:59:54 +05:00
commit e37592bdc6
9 changed files with 72 additions and 31 deletions

View file

@ -1,12 +1,16 @@
import json
import re
import stripe
import stripe.error
import logging
import sys
from config import etcd_client as client, config as config
from configparser import Error as ConfigParserError
from config import etcd_client as client, config as config, config_file
stripe.api_key = config['stripe']['private_key']
try:
stripe.api_key = config.get('stripe', 'private_key')
except ConfigParserError as err:
sys.exit(f'{err} in config file {config_file}')
def handle_stripe_error(f):
@ -291,7 +295,7 @@ class StripeUtils(object):
returns the new object.
:param amount: The amount in CHF cents
:param name: The name of the Stripe plan to be created.
:param product_name: The name of the Stripe plan (product) to be created.
:param stripe_plan_id: The id of the Stripe plan to be
created. Use get_stripe_plan_id_string function to
obtain the name of the plan to be created