def get_customer_info(account_id): if user_info(flask.session): advantage = AdvantageContracts( session, flask.session["authentication_token"], api_url=flask.current_app.config["CONTRACTS_API_URL"], ) return advantage.get_customer_info(account_id) else: return flask.jsonify({"error": "authentication required"}), 401
def get_customer_info(account_id): is_test_backend = flask.request.args.get("test_backend", False) api_url = flask.current_app.config["CONTRACTS_LIVE_API_URL"] if is_test_backend: api_url = flask.current_app.config["CONTRACTS_TEST_API_URL"] if user_info(flask.session): advantage = AdvantageContracts( session, flask.session["authentication_token"], api_url=api_url, ) return advantage.get_customer_info(account_id) else: return flask.jsonify({"error": "authentication required"}), 401