/nordigen-api

PHP library for the Nordigen API.

Primary LanguagePHPMIT LicenseMIT

nordigen-api

PHP API for Nordigen OpenBanking API. Work in progress!

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Installation

Add the package as a dependency in your composer.json file:

require {
    "pemedina/nordigen-api": "dev-master"
}

Include the composer autoloader in your script. Set your nordigen API token and create an instance of the API.

require 'vendor/autoload.php';

use Pemedina/Nordigen;

$nordigen = new Nordigen($secret_id, $secret_key);

Usage

Accounts

// Access account details.
$account= $nordigen->getDetails($account_id);

// Access account balances.
$balances = $nordigen->getBalances($account_id);

// Access account transactions.
$transactions = $nordigen->getTransactions($account_id);

Agreements

// Retrieve all enduser agreements
$agreements = $nordigen->getAgreements();

// Create enduser agreement
$agreement = $nordigen->createAgreement( $attributes);

// 	Retrieve enduser agreement by id
$agreement = $nordigen->getAgreements($agreement_id);

// Delete End User Agreement.
$agreement = $nordigen->deleteAgreement($agreement_id);

// Accept an end-user agreement via the API.
$agreement = $nordigen->acceptAgreement($agreement_id);

Institutions

// List all available institutions
$nordigen->getInstitutions();

// Get details about a specific Institution
$nordigen->getInstitutions($institution_id);

Requisitions

// Retrieve all requisitions belonging to the company
$nordigen->getRequisitions();

// Create new requisition
$nordigen->createRequisition([]);

// Retrieve all requisition by id
$nordigen->getRequisition($requisition_id);

// Delete Requisition and all End User Agreements.
$nordigen->deleteRequisition($requisition_id);

Testing

Put SECRET_ID and SECRET_KEY in your environment. Or put the following in phpunit.xml.

<php>
    <env name="SECRET_ID" value="secret_id"/>
      <env name="SECRET_KEY" value="secret_key"/>
</php>

Run tests with phpunit (-v) tests.