Git Product home page Git Product logo

java-figo's Introduction

java-figo Build Status

Java bindings for the figo connect API. Find more detailed API docss at http://docs.figo.io/v3

Simply add to your pom.xml:

<dependency>
        <groupId>me.figo</groupId>
        <artifactId>sdk</artifactId>
        <version>3.0.0</version>
</dependency>

And just as easy to use:

import java.io.IOException;

import me.figo.FigoException;
import me.figo.FigoSession;
import me.figo.models.Account;
import me.figo.models.Transaction;


public class FigoExample {

	public static void main(String[] args) throws FigoException, IOException {
		FigoSession session = new FigoSession("ASHWLIkouP2O6_bgA2wWReRhletgWKHYjLqDaqb0LFfamim9RjexTo22ujRIP_cjLiRiSyQXyt2kM1eXU2XLFZQ0Hro15HikJQT_eNeT_9XQ");

		// print out a list of accounts including its balance
		for (Account account : session.getAccounts()) {
			System.out.println(account.getName());
			System.out.println(session.getAccountBalance(account).getBalance());
		}

		// print out the list of all transactions on a specific account
		for (Transaction transaction : session.getTransactions(session.getAccount("A1.2"))) {
			System.out.println(transaction.getPurposeText());
		}
	}

}

To add a proxy server to a FigoSession or FigoConnection do this:

// first create the FigoSession object
FigoSession session = new FigoSession("ASHWLIkouP2O6_bgA2wWReRhletgWKHYjLqDaqb0LFfamim9RjexTo22ujRIP_cjLiRiSyQXyt2kM1eXU2XLFZQ0Hro15HikJQT_eNeT_9XQ");

// create a Proxy and add it to the session
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("10.0.0.1", 8080));
session.setProxy(proxy);

// now do your API calls

You can add valid SSL fingerprints by adding them to the FIGO_API_FINGERPRINTS environment variable. Fingerprints need to be added in HEX format without column delimiters. A column delimiter is used to indicate the next element in the list of fingerprints.

To disable the SSL certificate pinning (not recommended) do the following:

// first create the FigoSession object
FigoSession session = new FigoSession("ASHWLIkouP2O6_bgA2wWReRhletgWKHYjLqDaqb0LFfamim9RjexTo22ujRIP_cjLiRiSyQXyt2kM1eXU2XLFZQ0Hro15HikJQT_eNeT_9XQ");

// create FakeTrustManager and add it to your FigoConnection or FigoSession
X509TrustManager trustManager = FakeTrustManager();
session.setTrustManager(trustManager);

// now do your API calls

To connect to the staging system of figo, you need to set the FIGO_API_FINGERPRINTS environment variable with the staging SHA256 fingerprint (D0039EF08FBD48678671CE9DA554248163D7D94DEDF16A55F052C70AAB7BB89D)

A more detailed documentation of the figo connect API can be found at http://docs.figo.io/v3/.

Demos

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

java-figo's People

Contributors

javaes avatar achimsen avatar berend avatar danielseligmann avatar halber avatar 02strich avatar asbachb avatar mrh-line avatar andreysaksonov avatar cyroxx avatar tobieiss avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.