Example #1
0
from figo import FigoException
from figo import FigoConnection
from figo import FigoSession
from figo.models import Service
from figo.models import LoginSettings
from figo.models import BankContact

from dotenv import load_dotenv
load_dotenv()

API_ENDPOINT = os.getenv("API_ENDPOINT")
CLIENT_ID = os.getenv("CLIENT_ID")
CLIENT_SECRET = os.getenv("CLIENT_SECRET")

CLIENT_ERROR = 1000
connection  = FigoConnection(CLIENT_ID, CLIENT_SECRET, "https://127.0.0.1/", api_endpoint=API_ENDPOINT)

@pytest.mark.parametrize('language', ['de'])
@pytest.mark.parametrize('country', ['DE', 'AT'])
def test_get_catalog_en_client_auth(language, country):
    catalog = connection.get_catalog(None, country)
    for bank in catalog['banks']:
      assert isinstance(bank, BankContact)
      assert bank.country == country
    for service in catalog['services']:
      assert isinstance(service, Service)

def test_get_catalog_client_auth_query():
    q = 'PayPal'
    catalog = connection.get_catalog(q, None)
    for bank in catalog['banks']:
Example #2
0
from jinja2.utils import soft_unicode

# patch sys.path
import sys
if sys.path[0] != '':
    sys.path.insert(0, '')

from figo import FigoSession, FigoConnection

app = Flask(__name__)
app.secret_key = 'W0\xb9>\x85\xe8\x8f\x00\x18\x9f\x87\xca\x9a\x9f\xe0np\xa1o\xbf\x9d6Ou'
Bootstrap(app)

CLIENT_ID = "CaESKmC8MAhNpDe5rvmWnSkRE_7pkkVIIgMwclgzGcQY"
CLIENT_SECRET = "STdzfv0GXtEj_bwYn7AgCVszN1kKq5BdgEIKOM_fzybQ"
connection = FigoConnection(CLIENT_ID, CLIENT_SECRET,
                            "http://*****:*****@app.template_filter('ff')
def figo_format(value, *args, **kwargs):
    """
    Apply python string formatting on an object:

    .. sourcecode:: jinja

        {{ "%s - %s"|format("Hello?", "Foo!") }}
            -> Hello? - Foo!
    """
    if args and kwargs:
        raise FilterArgumentError(
            'can\'t handle positional and keyword arguments at the same time')
Example #3
0
def figo_connection():
    return FigoConnection(CREDENTIALS['client_id'],
                          CREDENTIALS['client_secret'],
                          "https://127.0.0.1/",
                          api_endpoint=CREDENTIALS['api_endpoint'],
                          fingerprints=CREDENTIALS['ssl_fingerprints'])
Example #4
0
def figo_connection():
    return FigoConnection(CLIENT_ID,
                          CLIENT_SECRET,
                          "https://127.0.0.1/",
                          api_endpoint=API_ENDPOINT)