figo-connect/php-figo

Name: php-figo

Owner: figo

Description: PHP binding for the figo Connect API.

Created: 2013-07-05 11:09:24.0

Updated: 2017-12-08 08:51:55.0

Pushed: 2017-11-29 14:20:13.0

Homepage: http://figo.io

Size: 452

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

php-figo Build Status Packagist Version

PHP bindings for the figo Connect API: http://docs.figo.io

Usage

First, you've to add this to your composer.json dependencies:

uire": {
igo/figo": "1.*"

and run

oser update

Now you can create a new session and access data:

ire_once "vendor/autoload.php";

figo\Session;

sion = new Session("ASHWLIkouP2O6_bgA2wWReRhletgWKHYjLqDaqb0LFfamim9RjexTo22ujRIP_cjLiRiSyQXyt2kM1eXU2XLFZQ0Hro15HikJQT_eNeT_9XQ");

rint out list of account numbers and balances.
ounts = $session->get_accounts();
ach ($accounts as $account) {
print($account->account_number."\n");
print($account->balance->balance."\n");


rint out the list of all transaction originators/recipients of a specific account.
ount = $session->get_account("A1.1");
nsactions = $account->get_transactions();
ach ($transactions as $transaction) {
print($transaction->name."\n");

It is just as simple to allow users to login through the API:

ire_once "vendor/autoload.php";

figo\Session;
figo\Connection;
Eloquent\Liftoff\Launcher;

nection = new Connection("<client ID>", "<client secret>", "http://my-domain.org/redirect-url");

tion start_login() {
$launcher = new Launcher;
$launcher->launch($connection->login_url("qweqwe"));


tion process_redirect($authorization_code, $state) {
// Handle the redirect URL invocation from the initial start_login call.

// Ignore bogus redirects.
if ($state !== "qweqwe") {
    return;
}

// Trade in authorization code for access token.
$token_dict = $connection->obtain_access_token($authorization_code);

// Start session.
$session = new Session($token_dict["access_token"]);

// Print out list of account numbers.
$accounts = $session->get_accounts();
foreach ($accounts as $account) {
    print($account->account_number."\n");
}

Demos

In this repository you can also have a look at a simple console (console_demo.php) and web demo (web_demo folder). While the console demo simply accesses the figo API, the web demo implements the full OAuth flow.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.