Last active
March 30, 2019 18:57
-
-
Save cjauvin/4a6db8308520037426db49356bbf2b54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flinks import Client | |
CUSTOMER_ID = 'secret!!' | |
BASE_URL = 'secret!!' | |
DEMO_USER = 'Greatday' | |
DEMO_PW = 'Everyday' | |
DEMO_INST = 'FlinksCapital' | |
QUESTIONS = { | |
'What city were you born in?': 'Montreal', | |
'What is the best country on earth?': 'Canada', | |
'What shape do people like most?': 'Triangle' | |
} | |
client = Client(customer_id=CUSTOMER_ID, base_url=BASE_URL) | |
result = client.banking_services.authorize(username=DEMO_USER, password=DEMO_PW, institution=DEMO_INST) | |
request_id = result['RequestId'] | |
# Not sure if the demo has sometimes more than 1 question.. | |
assert len(result['SecurityChallenges']) == 1 | |
q = result['SecurityChallenges'][0]['Prompt'] | |
a = QUESTIONS[q] | |
print(q, a) | |
# Watch out: the answer must be in a list | |
result = client.banking_services.authorize( | |
request_id=request_id, username=DEMO_USER, password=DEMO_PW, institution=DEMO_INST, security_responses={q: [a]} | |
) | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment