-
Notifications
You must be signed in to change notification settings - Fork 5
/
get-pomt-required-fields.py
executable file
·48 lines (39 loc) · 1.39 KB
/
get-pomt-required-fields.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python3
from utilities import make_request
import json
import argparse
parser = argparse.ArgumentParser(description="Get Payout Method Required Fields")
parser.add_argument("filename", help="the file containing the url parameters")
parser.add_argument("env", help="the rapyd environment")
parser.add_argument("-a", "--all", help="outputs all rapyd's api response", action="store_true")
args = parser.parse_args()
f = open(f'{args.filename}', 'r')
params = f.read().replace('\n','')
f.close()
path = f'/v1/payouts/{params}'
response = make_request(env=args.env, method='get', path=path)
if args.all:
print(json.dumps(response, indent=4))
exit(0)
print('> beneficiary_required_fields:')
for r in response['data']['beneficiary_required_fields']:
s = f"{r['name']}, " \
f"{r['type']}, " \
f"is required {r['is_required']}, " \
f"{r['regex']}"
print(s)
print('\n> sender_required_fields:')
for r in response['data']['sender_required_fields']:
s = f"{r['name']}, " \
f"{r['type']}, " \
f"is required {r['is_required']}, " \
f"{r['regex']}"
print(s)
if response['data']['payout_options']:
print('\n> payout_options:')
for r in response['data']['payout_options']:
s = f"{r['name']}, " \
f"{r['type']}, " \
f"is required {r['is_required']}, " \
f"{r['regex']}"
print(s)