https://github.com/dhi13man/nordigen_integration
Development of a Dart/Flutter Package for Nordigen EU PSD2 AISP Banking API Integration with relevant Data Models, and proper encapsulation.
https://github.com/dhi13man/nordigen_integration
dart flutter hacktoberfest hacktoberfest-2022 hacktoberfest2022 nordigen open-source package
Last synced: 6 months ago
JSON representation
Development of a Dart/Flutter Package for Nordigen EU PSD2 AISP Banking API Integration with relevant Data Models, and proper encapsulation.
- Host: GitHub
- URL: https://github.com/dhi13man/nordigen_integration
- Owner: Dhi13man
- License: mit
- Created: 2021-05-12T08:10:55.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-30T20:33:30.000Z (over 1 year ago)
- Last Synced: 2025-03-27T22:22:55.504Z (7 months ago)
- Topics: dart, flutter, hacktoberfest, hacktoberfest-2022, hacktoberfest2022, nordigen, open-source, package
- Language: Dart
- Homepage: https://pub.dev/packages/nordigen_integration
- Size: 299 KB
- Stars: 12
- Watchers: 2
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# nordigen_integration
[](https://github.com/Dhi13man/nordigen_integration/blob/main/LICENSE)
[](https://dart.dev)
[](https://flutter.dev)
[](https://github.com/Dhi13man/nordigen_integration/graphs/contributors)
[](https://github.com/Dhi13man/nordigen_integration/network/members)
[](https://github.com/Dhi13man/nordigen_integration/stargazers)
[](https://github.com/Dhi13man/nordigen_integration/commits/main)
[](https://github.com/Dhi13man/nordigen_integration/actions)
[](https://pub.dev/packages/nordigen_integration)[](https://www.buymeacoffee.com/dhi13man)
Development of a Null Safe Dart/Flutter Package for Nordigen EU PSD2 AISP Banking API Integration with relevant Data Models, proper encapsulation with the exposing of parameters, and succinct documentation.
For more information about the API, view [Nordigen's Account Information API documentation](https://nordigen.com/en/account_information_documenation/integration/quickstart_guide/).
## Contents
- [nordigen_integration](#nordigen_integration)
- [Contents](#contents)
- [Usage Steps](#usage-steps)
- [Example Usage](#example-usage)
- [API Documentation](#api-documentation)
- [Available Methods](#available-methods)
- [Available Data Classes](#available-data-classes)
- [Contributing](#contributing)
- [Dependencies](#dependencies)
- [Tests Screenshot](#tests-screenshot)
- [Vote of Thanks](#vote-of-thanks)
- [General Information](#general-information)## Usage Steps
1. Go through the [Nordigen's Account Information API documentation](https://nordigen.com/en/account_information_documenation/integration/quickstart_guide/).
2. Register and get the User Secrets from .
3. Initialise the `NordigenAccountInfoAPI` Class with the token recieved from Usage Step 2.
4. Call any of the `NordigenAccountInfoAPI` Class methods to directly interact with Nordigen Server's endpoints while having the internal requests and relevant headers abstracted, based on your need.
5. Utilize any of the available Data Classes to modularly and sufficiently store and process the information during any of the API usage steps. The Data Classes have functionality to be constructed `fromMap()` and to be easily converted back `toMap()` as well as to be serialized, at any point.
### Example Usage
```dart
import 'package:nordigen_integration/nordigen_integration.dart';Future main() async {
/// Step 1
final NordigenAccountInfoAPI apiInterface =
await NordigenAccountInfoAPI.fromSecret(secretID: 'secret_id', secretKey: 'secret_key');/// Step 2 and then selecting the first Bank/Institution
final Institution firstBank =
(await apiInterface.getInstitutionsForCountry(countryCode: 'gb')).first;/// Step 3
final EndUserAgreementModel endUserAgreementModel =
await apiInterface.createEndUserAgreement(
maxHistoricalDays: 90,
accessValidForDays: 90,
institutionID: firstBank.id,
);/// Step 4
final RequisitionModel requisition = await apiInterface.createRequisitionAndBuildLink(
agreement: endUserAgreementModel.id,
institutionID: firstBank.id,
redirect: 'http://www.yourwebpage.com/',
reference: 'exampleRef42069666',
);/// Open and validate in [link] and proceed with other functionality.
print('Validate: ${requisition.link}');
}
```----
## API Documentation
### Available Methods
1. `NordigenAccountInfoAPI({required String accessToken})` (Class constuctor)
Call it with `accessToken` parameter which is the access token generated using [User Secrets](https://ob.nordigen.com/user-secrets/), to access API features.
Analogous to Step 1 of [Account Information API documentation](https://nordigen.com/en/account_information_documenation/integration/quickstart_guide/).
2. `static Future fromSecret({required String secretID, required String secretKey})` (static convenience method to generate interface using Secrets)
Call it with `secretID` and `secretKey` parameters which are the user's [User Secrets](https://ob.nordigen.com/user-secrets/).
Returns a `Future` that resolves to the initialized `NordigenAccountInfoAPI` object using the Access Token that was generated using the secrets.
Analogous to Step 1 of [Account Information API documentation](https://nordigen.com/en/account_information_documenation/integration/quickstart_guide/).
3. `static Future> createAccessToken({required String secretID, required String secretKey})`
Call it with `secretID` and `secretKey` parameters which are the user's [User Secrets](https://ob.nordigen.com/user-secrets/).
Returns a `Future` that resolves to a `Map` containing the information about the Access Token that was generated using the secrets.
4. `getInstitutionsForCountry({required String countryCode})`
Gets the Institutions (Banks) in the Country represented by the given two-letter `countryCode` (ISO 3166).
Analogous to Step 2 of [Account Information API documentation](https://nordigen.com/en/account_information_documenation/integration/quickstart_guide/).
5. `createEndUserAgreement({required String institutionID, int maxHistoricalDays = 90, int accessValidForDays = 90, List accessScope = const ['balances', 'details', 'transactions']})`
Create an End User Agreement for given Institution identified by `institutionID`, account access period for given `accessValidForDays` and `maxHistoricalDays` of transaction histoy (default 90 days each) and returns a `Future` resolving to the resulting `EndUserAgreementModel`.
Analogous to Step 3 of [Account Information API documentation](https://nordigen.com/en/account_information_documenation/integration/quickstart_guide/).
6. `acceptEndUserAgreement({required String endUserAgreementID, required String ipAddress, required String userAgent})`
Accepts the End User Agreement identified by `endUserAgreementID` and returns a `Future` resolving to the resulting `EndUserAgreementModel`.
Accepts the user agreement using given `userAgent` and `ipAddress`. This determine whether you have permission to accept the Agreement or not. Will throw a Error Code 403 (You do not have permission to perform this action) otherwise.
7. `createRequisitionAndBuildLink({required String redirect, required String institutionID, String? agreement, required String reference, String? userLanguage})`
Create a Requisition for the given `institutionID` and returns a `Future` resolving to the resulting `RequisitionModel`.
`reference` is additional layer of unique ID. Should match Step 3 if done. `redirect` is the link where the end user will be redirected after finishing authentication in institution. `agreement` is the identifier of the agreement from Step 3 and `userLanguage` is the language code of the language used in verification.
Analogous to Step 4 of [Account Information API documentation](https://nordigen.com/en/account_information_documenation/integration/quickstart_guide/).
8. `getRequisitionUsingID({required String requisitionID})`
Gets the Requisition identified by `requisitionID`.
9. `getEndUserAccountIDs({required String requisitionID})`
Gets the Account IDs of the User for the Requisition identified by `requisitionID`.
Analogous to Step 5 of [Account Information API documentation](https://nordigen.com/en/account_information_documenation/integration/quickstart_guide/).
10. `getAccountDetails({required String accountID})`
Gets the Details of the Bank Account identified by `accountID`. Account Model follows schema in .
Analogous to Step 6 of [Account Information API documentation](https://nordigen.com/en/account_information_documenation/integration/quickstart_guide/) for Account Details.
11. `getAccountTransactions({required String accountID})`
Gets the Transactions of the Bank Account identified by `accountID` as a `Map>` with keys `'booked'` and `'pending'` representing List of Booked and pending transactions respectively.
Analogous to Step 6 of [Account Information API documentation](https://nordigen.com/en/account_information_documenation/integration/quickstart_guide/) for Account Transactions.
12. `getAccountBalances({required String accountID})`
Gets the Balances of the Bank Account identified by `accountID` as `dynamic`. Will be depreciated later when documentation provides example of potentially fetched Balance Data.
Analogous to Step 6 of [Account Information API documentation](https://nordigen.com/en/account_information_documenation/integration/quickstart_guide/) for Account Balances.
There are also various other methods for implementing POST, GET and DELETE requests across various endpoints in Nordigen Server, which are self explanatory:
1. `getinstitutionUsingID({required String institutionID})`
2. `getEndUserAgreementUsingID({required String endUserAgreementID})`
3. `getEndUserAgreementTextUsingID({required String endUserAgreementID})`
4. `getEndUserAgreements({int limit = 100, int offset = 0})`
5. `deleteEndUserAgreementUsingID({required String endUserAgreementID})`
6. `getRequisitions({int limit = 100, int offset = 0,})`
7. `getRequisitionUsingID({required String requisitionID})`
8. `deleteRequisitionUsingID({required String requisitionID})`
9. `getAccountMetaData({required String accountID})`
### Available Data Classes
Refer for most of the Data Schema and the mentioned URLs in the special cases.
1. `Institution({required String id, required String name, String bic = '', int transactionTotalDays = 90, required List countries, String logoURL = ''})`
Institution (Bank) Data Model for Nordigen. Contains the `id` of the institution, its `name`, `bic`, `transactionTotalDays`, the `countries` associated with the institution and institution's logo as a URL `logoURL` to it, if any.
2. `EndUserAgreementModel({required String id, String created, int maxHistoricalDays = 90, int accessValidForDays = 90, List accessScope = const ['balances', 'details', 'transactions'], String? accepted, required String institutionID})`:
End-user Agreement Data Model for Nordigen. Contains the `id` of the Agreement, its `created` time string, `accepted`, the number of `maxHistoricalDays` and `accessValidForDays`, and the `accessScope` and `institutionID` relevant to the Agreement.
3. `RequisitionModel({required String id, required String created, required String redirectURL, RequisitionStatus status = const RequisitionStatus(short: '', long: '', description: ''), required String institutionID, String agreement, required String reference, List accounts = const [], String userLanguage='EN', required String link})`:
Requisition Data Model for Nordigen. Contains the `id` of the Requisition, `created` timestamp String, its `status`, associated end-user `agreement`, the `link` which is to be opened for verification, the `redirectURL` to which it should redirect, `reference` ID if any, `accounts` associated, and the associated `institutionID`.
`RequisitionStatus({required String short, required String long, required String description})` contains a short status, a long status and a description of the status.
4. `AccountMetaData({required String id, String created, String? lastAccessed, String iban, String institutionIdentifier, String status = ''})`
Account meta-data model for Nordigen. Contains the `id` of the Bank Account, its `created` and `lastAccessed` date and time, `iban`, `status` and the `institutionIdentifier` identifiying its Institution. Refer to5. `AccountDetails({String? id, String? iban, String? msisdn, required String currency, String? ownerName, String? name, String? displayName, String? product, String? cashAccountType, String? status, String? bic, String? linkedAccounts, String? usage, String? details, List? balances, List? links})`:
Bank Account Details Model for Nordigen. Refer to for full Data Schema.
6. `TransactionData({required String id, String? debtorName, Map? debtorAccount, String? bankTransactionCode, String bookingDate = '', String valueDate = '', required String transactionAmount, String? remittanceInformationUnstructured = '', ...})`:
Transaction Data Model for Nordigen. Refer to for full Data Schema.
7. `Balance({required AmountData balanceAmount, required String balanceType, bool? creditLimitIncluded, String? lastChangeDateTime, String? referenceDate, String? lastCommittedTransaction})`
Balance Data Model for Nordigen. Contains `balanceAmount` of Transaction, its `balanceType`, whether its `creditLimitIncluded`, its `lastChangeDateTime` and `referenceDate` as `String` and the `lastCommittedTransaction`.
Refer to for full Data Schema and the available balance types.
8. `AmountData({required String amount, required String currency})`
It is a simple Class that holds the transaction `amount` and the `currency` type, both as required parameters.
----
## Contributing
Make sure you check out the [Contribution Guildelines](https://github.com/Dhi13man/nordigen_integration/blob/main/CONTRIBUTING.md) for information about how to contribute to the development of this package!
## Dependencies
- [Dart,](https://www.dartlang.org/) for the Dart SDK which this obviously runs on.
- [http,](https://pub.dev/packages/http) is used for making API calls to the Nordigen Server Endpoints with proper response and error handling.----
## Tests Screenshot

----
## Vote of Thanks
1. In case of any bugs, reach out to me at [@Dhi13man](https://twitter.com/Dhi13man) or [file an issue](https://github.com/Dhi13man/nordigen_integration/issues)
2. Big thanks to contributors, including [@tolik505](https://github.com/tolik505), [@antoineraulin](https://github.com/antoineraulin), [@stantemo](https://github.com/stantemo) and [@c-louis](https://github.com/c-louis). Contribution is welcome, and makes my day brighter
3. The first release of this package was sponsored by [Cashtic](https://cashtic.com). Show them some love! This package would not otherwise be possible
----
## General Information
This project is a starting point for a Dart [package](https://flutter.dev/developing-packages/), a library module containing code that can be shared easily across multiple Flutter or Dart projects.
For help getting started with Flutter, view the [online documentation](https://flutter.dev/docs), which offers tutorials,samples, guidance on mobile development, and a full API reference.