pemedina/nordigen-api

Nordigen API 的 PHP 包装器。

dev-master 2022-03-21 19:53 UTC

This package is auto-updated.

Last update: 2024-09-22 16:36:13 UTC


README

PHP API for Nordigen OpenBanking API. 工作正在进行中!

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

安装

在您的 composer.json 文件中将此包作为依赖项添加。

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

在您的脚本中包含 composer 自动加载器。设置您的 nordigen API 令牌并创建 API 实例。

require 'vendor/autoload.php';

use Pemedina/Nordigen;

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

用法

账户

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

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

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

协议

// 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);

机构

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

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

请求

// 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);

测试

SECRET_IDSECRET_KEY 放置在您的环境变量中。或者将以下内容放入 phpunit.xml

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

使用 phpunit (-v) tests 运行测试。