helixdigital-io/nordigen-php
最新稳定版本:2.0.2
Composer 安装命令:
composer require helixdigital-io/nordigen-php
包简介
Nordigen unofficial API client for PHP
README 文档
README
This is an unofficial PHP client library for GoCardless Bank Account Data. This fork requires at least PHP 8.2.
For a full list of endpoints and arguments, see the docs.
Before starting to use API you will need to create a new secret and get your SECRET_ID and SECRET_KEY from the Nordigen's Open Banking Portal.
Requirements
- PHP >= 8.2
Installation
Install library via composer:
composer require helixdigital-io/nordigen-php
Example application
Laravel example application can be found in example directory
Quickstart
To use the library, use Composer's autoload:
require_once('vendor/autoload.php');
// Get secretId and secretKey from bankaccoutndata.gocardless.com portal and pass them to NordigenClient $secretId = "YOUR_SECRET_ID"; $secretKey = "YOUR_SECRET_KEY"; $client = new \Nordigen\NordigenPHP\API\NordigenClient($secretId, $secretKey); // Generate new access token. Token is valid for 24 hours // Token is automatically injected into every response $token = $client->createAccessToken(); // Get access token $accessToken = $client->getAccessToken(); // Get refresh token $refreshToken = $client->getRefreshToken(); // Exchange refresh token for new access token $newToken = $client->refreshAccessToken($refreshToken); // Get list of institutions by country. Country should be in ISO 3166 standard. $institutions = $client->institution->getInstitutionsByCountry("LV"); // Institution id can be gathered from getInstitutions response. // Example Revolut ID $institutionId = "REVOLUT_REVOGB21"; $redirectUri = "https://nordigen.com"; // Initialize new bank connection session $session = $client->initSession($institutionId, $redirectUri); // Get link to authorize in the bank // Authorize with your bank via this link, to gain access to account data $link = $session["link"]; // requisition id is needed to get accountId in the next step $requisitionId = $session["requisition_id"];
After successful authorization with a bank you can fetch your data (details, balances, transactions)
Fetching account metadata, balances, details and transactions
// Get account id after completed authorization with a bank $requisitionData = $client->requisition->getRequisition($requisitionId); // Get account id from the array of accounts $accountId = $requisitionData["accounts"][0]; // Instantiate account object $account = $client->account($accountId); // Fetch account metadata $metadata = $account->getAccountMetaData(); // Fetch account balances $balances = $account->getAccountBalances(); // Fetch account details $details = $account->getAccountDetails(); // Fetch account transactions $transactions = $account->getAccountTransactions(); // Optional. You can filter transactions by specific date range $transactions = $account->getAccountTransactions("2021-12-01", "2022-01-30"); // Get premium transactions // Optional parameters country, dateFrom, dateTo $premiumTransactions = $account->getPremiumAccountTransactions();
In order to use Premium endpoint please contact our bank-account-data-support@gocardless.com
Tests
./vendor/bin/phpunit
Support
For any inquiries please contact support at bank-account-data-support@gocardless.com or create an issue in the repository.
统计信息
- 总下载量: 5.98k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-31