Allow ungleich_pay_server parameter to be passed by the user

This commit is contained in:
PCoder 2019-08-13 13:03:59 +05:30
parent 3af7d04a9a
commit 66a27d435f

View file

@ -18,10 +18,17 @@ class ungleichPay(object):
'--token', required=True,
help="A valid token obtained from ungleich"
)
self.parser['ungleich_pay_server'].add_argument(
'--ungleich-pay-server', required=False,
help="A valid ungleich pay server url"
)
self.parser['customers-list'].set_defaults(func=self.customers_list)
def customers_list(self, args):
customers_list_endpoint = "/customers-list"
if args.ungleich_pay_server:
request_url = args.ungleich_pay_server + customers_list_endpoint
else:
request_url = UNGLEICH_PAY_SERVER_URL + customers_list_endpoint
req = urllib.request.Request(url=request_url,
method='GET',