def get_list(params={}): uri = Ibanity.client.api_schema["financialInstitutions"] \ .replace("{financialInstitutionId}", "") response = Ibanity.client.get(uri, params, None) return list( map(lambda financial_institution: flatten_json(financial_institution), response["data"]))
def get_list(account_id, access_token): uri = Ibanity.client.api_schema_ponto["account"]["transactions"] \ .replace("{accountId}", account_id) \ .replace("{transactionId}", "") response = Ibanity.client.get(uri, {}, "Bearer " + str(access_token)) return list( map(lambda transaction: flatten_json(transaction), response["data"]))
def create(attributes, access_token): uri = Ibanity.client.api_schema_ponto["synchronizations"] \ .replace("{synchronizationId}", "") body = {"data": {"type": "synchronization", "attributes": attributes}} response = Ibanity.client.post(uri, body, {}, "Bearer " + str(access_token)) return flatten_json(response["data"])
def find(financial_institution_id, id, customer_access_token): uri = Ibanity.client.api_schema["customer"]["financialInstitution"]["accounts"]\ .replace("{financialInstitutionId}", financial_institution_id)\ .replace("{accountId}", id) response = Ibanity.client.get(uri, {}, "Bearer " + str(customer_access_token)) return flatten_json(response["data"])
def find(financial_institution_id, financial_institution_user_id, id): uri = Ibanity.client.api_schema["sandbox"]["financialInstitution"]["financialInstitutionAccounts"] \ .replace("{financialInstitutionId}", financial_institution_id) \ .replace("{financialInstitutionUserId}", financial_institution_user_id) \ .replace("{financialInstitutionAccountId}", id) response = Ibanity.client.get(uri, {}, None) return flatten_json(response["data"])
def create(account_id, attributes, access_token): uri = Ibanity.client.api_schema_ponto["account"]["payments"] \ .replace("{accountId}", account_id) \ .replace("{paymentId}", "") body = {"data": {"type": "payment", "attributes": attributes}} response = Ibanity.client.post(uri, body, {}, "Bearer " + str(access_token)) return flatten_json(response["data"])
def get_list_for_financial_institution(financial_institution_id, customer_access_token, params={}): uri = Ibanity.client.api_schema["customer"]["financialInstitution"]["accounts"]\ .replace("{financialInstitutionId}", financial_institution_id)\ .replace("{accountId}", "") response = Ibanity.client.get(uri, params, "Bearer " + str(customer_access_token)) return list(map(lambda account: flatten_json(account), response["data"]))
def create(financial_institution_id, account_information_access_request_id, customer_access_token, attributes): uri = Ibanity.client.api_schema["customer"]["financialInstitution"]["accountInformationAccessRequest"]["authorizations"] \ .replace("{financialInstitutionId}", financial_institution_id) \ .replace("{accountInformationAccessRequestId}", account_information_access_request_id) body = {"data": {"type": "authorization", "attributes": attributes}} response = Ibanity.client.post(uri, body, {}, "Bearer " + str(customer_access_token)) return flatten_json(response["data"])
def create_from_refresh_token(refresh_token, client_id, authorization): uri = Ibanity.client.api_schema_ponto["oauth2"]["token"] body = { "grant_type": "refresh_token", "refresh_token": refresh_token, "client_id": client_id, } response = Ibanity.client.post(uri, body, {}, "Basic " + str(authorization)) return flatten_json(response)
def get_list_for_financial_institution(financial_institution_id, financial_institution_user_id, params={}): uri = Ibanity.client.api_schema["sandbox"]["financialInstitution"]["financialInstitutionAccounts"] \ .replace("{financialInstitutionId}", financial_institution_id) \ .replace("{financialInstitutionUserId}", financial_institution_user_id) \ .replace("{financialInstitutionAccountId}", "") response = Ibanity.client.get(uri, params, None) print(response) return list(map(lambda account: flatten_json(account), response["data"]))
def get_list(access_token=None): uri = Ibanity.client.api_schema_ponto["financialInstitutions"] \ .replace("{financialInstitutionId}", "") if (access_token == None): response = Ibanity.client.get(uri, {}, None) else: response = Ibanity.client.get(uri, {}, "Bearer " + str(access_token)) return list( map(lambda financial_institution: flatten_json(financial_institution), response["data"]))
def create(attributes): uri = Ibanity.client.api_schema["sandbox"][ "financialInstitutionUsers"].replace("{financialInstitutionUserId}", "") body = { "data": { "type": "financialInstitutionUser", "attributes": attributes } } response = Ibanity.client.post(uri, body, {}, None) return flatten_json(response["data"])
def create(authorization_code, code_verifier, redirect_uri, client_id, authorization): uri = Ibanity.client.api_schema_ponto["oauth2"]["token"] body = { "grant_type": "authorization_code", "code": authorization_code, "client_id": client_id, "redirect_uri": redirect_uri, "code_verifier": code_verifier } response = Ibanity.client.post(uri, body, {}, "Basic " + str(authorization)) return flatten_json(response)
def create(financial_institution_id, attributes, customer_access_token): uri = Ibanity.client.api_schema["customer"]["financialInstitution"]["paymentInitiationRequests"] \ .replace("{financialInstitutionId}", financial_institution_id) \ .replace("{paymentInitiationRequestId}", "") body = { "data": { "type": "paymentInitiationRequest", "attributes": attributes } } response = Ibanity.client.post(uri, body, {}, "Bearer " + str(customer_access_token)) return flatten_json(response["data"])
def create(financial_institution_id, financial_institution_user_id, attributes): uri = Ibanity.client.api_schema["sandbox"]["financialInstitution"]["financialInstitutionAccounts"] \ .replace("{financialInstitutionId}", financial_institution_id) \ .replace("{financialInstitutionUserId}", financial_institution_user_id) \ .replace("{financialInstitutionAccountId}", "") body = { "data": { "type": "financialInstitutionAccount", "attributes": attributes } } response = Ibanity.client.post(uri, body, {}, None) return flatten_json(response["data"])
def delete(customer_access_token): uri = Ibanity.client.api_schema["customer"]["self"] response = Ibanity.client.delete(uri, {}, None) return flatten_json(response["data"])
def delete(account_id, id, access_token): uri = Ibanity.client.api_schema_ponto["account"]["payments"] \ .replace("{accountId}", account_id) \ .replace("{paymentId}", id) response = Ibanity.client.delete(uri, {}, "Bearer " + str(access_token)) return flatten_json(response["data"])
def find(id, access_token): uri = Ibanity.client.api_schema_ponto["synchronizations"] \ .replace("{synchronizationId}", id) response = Ibanity.client.get(uri, {}, "Bearer " + str(access_token)) return flatten_json(response["data"])
def get_list(customer_access_token, params={}): uri = Ibanity.client.api_schema["customer"]["accounts"] response = Ibanity.client.get(uri, params, "Bearer " + str(customer_access_token)) return list(map(lambda account: flatten_json(account), response["data"]))
def find(account_id, id, access_token): uri = Ibanity.client.api_schema_ponto["account"]["transactions"] \ .replace("{accountId}", account_id) \ .replace("{transactionId}", id) response = Ibanity.client.get(uri, {}, "Bearer " + str(access_token)) return flatten_json(response["data"])
def update(id, attributes): uri = Ibanity.client.api_schema["sandbox"]["financialInstitutions"] \ .replace("{financialInstitutionId}", id) body = {"data": {"type": "financialInstitution", "attributes": attributes}} response = Ibanity.client.patch(uri, body, {}, None) return flatten_json(response["data"])
def find(id): uri = Ibanity.client.api_schema["sandbox"]["financialInstitutionUsers"] \ .replace("{financialInstitutionUserId}", id) response = Ibanity.client.get(uri, {}, None) return flatten_json(response["data"])
def get_list(access_token): uri = Ibanity.client.api_schema_ponto["accounts"] \ .replace("{accountId}", "") response = Ibanity.client.get(uri, {}, "Bearer " + str(access_token)) return list(map(lambda account: flatten_json(account), response["data"]))
def get_list(params={}): uri = Ibanity.client.api_schema["sandbox"][ "financialInstitutionUsers"].replace("{financialInstitutionUserId}", "") response = Ibanity.client.get(uri, params, None) return list(map(lambda user: flatten_json(user), response["data"]))