Exemple #1
0
def lambda_handler(event, context):
   obp.setBaseUrl("https://citizensbank.openbankproject.com/")
   obp.setApiVersion("v4.0.0")

   # Login and set authorized token
   obp.login("michaelj","Infosys@123","a2kettx3t1hrnjeeswiptjgkkxy4prr4lo21wmrv")
   user = obp.getCurrentUser()
   print("Log stream name:", context.log_stream_name)
   print("Log group name:",  context.log_group_name)
   print("Request ID:",context.aws_request_id)
   print("invoked_function_arn ", context.invoked_function_arn )
   print("Event: ", event)
   print("Context: ", context)
   return dispatch(event)
Exemple #2
0
from props.default import *

# You probably don't need to change those
import lib.obp
obp = lib.obp

obp.setBaseUrl(BASE_URL)
obp.setApiVersion(API_VERSION)

# Login and set authorized token
obp.login(USERNAME, PASSWORD, CONSUMER_KEY)

# Get current user
print("")
print(" --- Get current user")
user = obp.getCurrentUser()
print("current user data:\n{0}".format(user))
user_id = user['user_id']
print("current user id: {0}".format(user))

our_bank = OUR_BANK  # banks[0]['id']
print("our bank: {0}".format(our_bank))

# Get accounts for a specific bank
print(" --- Private accounts")

accounts = obp.getPrivateAccounts(our_bank)

for a in accounts:
    print(a['id'])