Allow ungleich_pay_server parameter to be passed by the user
This commit is contained in:
parent
3af7d04a9a
commit
66a27d435f
1 changed files with 8 additions and 1 deletions
|
@ -18,11 +18,18 @@ class ungleichPay(object):
|
||||||
'--token', required=True,
|
'--token', required=True,
|
||||||
help="A valid token obtained from ungleich"
|
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)
|
self.parser['customers-list'].set_defaults(func=self.customers_list)
|
||||||
|
|
||||||
def customers_list(self, args):
|
def customers_list(self, args):
|
||||||
customers_list_endpoint = "/customers-list"
|
customers_list_endpoint = "/customers-list"
|
||||||
request_url = UNGLEICH_PAY_SERVER_URL + customers_list_endpoint
|
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,
|
req = urllib.request.Request(url=request_url,
|
||||||
method='GET',
|
method='GET',
|
||||||
headers={
|
headers={
|
||||||
|
|
Loading…
Reference in a new issue