dnb 1.0.1+1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new50



DNB Open Banking Client

A Dart client for DNB's API products. (Under development, may change) #

Travis Build Status npm (latest) GitHub contributors License Gitmoji

The APIs are currently under development, and only available in a sandbox. To use this API, you have to create an application at https://developer.dnb.no.

See examples below.

Usage #

import 'package:dnb/dnb.dart';

void main() async {
  final dnb = DNB(
      clientKey: 'YOUR-CLIENT-KEY',
      clientSecret: 'YOUR-CLIENT-SECRET',
      apiKey: 'YOUR-API-KEY');

  /// Retrieve all test customers from sandbox
  final testCustomers = await dnb.getTestCustomers();

  /// Retrieve token for access to other APIs
  final token = await dnb.getToken(customerId: 'CUSTOMER-ID');

  /// Retrieve the current customer using the token
  final customer = await dnb.getCurrentCustomer(jwt: token);
}

Features #

The DNB class contains helper methods for creating payment bodies.

final payment = dnb.createPaymentBody(
  creditAccount: '12345678901',
  debitAccount: '10987654321',
  amount: 500,
  executionDate: DateTime.now(),
);

await dnb.initiatePayment(payment: payment);

Development #

First, clone the repo. You will need API keys to run the tests. Make a new app at https://developer.dnb.no.

Do pub get.

Run tests with pub run test.

Do not commit directly to master. Preferably, make a branch or fork out of the development branch and make a pull request.

License #

MIT © 2019 Arne Molland

1.0.1+1 #

  • Cleaned up redundant code
  • Fixed readme

1.0.1 #

  • Added example

1.0.0 #

  • Initial release

example/main.dart

import 'package:dnb/dnb.dart';

void main() async {
  final dnb = DNB(
      clientKey: 'YOUR-CLIENT-KEY',
      clientSecret: 'YOUR-CLIENT-SECRET',
      apiKey: 'YOUR-API-KEY');

  /// Retrieve all test customers from sandbox
  final testCustomers = await dnb.getTestCustomers();
  print(testCustomers);

  /// Retrieve token for access to other APIs
  final token = await dnb.getToken(customerId: 'CUSTOMER-ID');
  print(token);

  /// Retrieve the current customer using the token
  final customer = await dnb.getCurrentCustomer(jwt: token);
  print(customer);

  // Create a payment
  final payment = dnb.createPaymentBody(
    creditAccount: '12345678901',
    debitAccount: '10987654321',
    amount: 500,
    executionDate: DateTime.now(),
  );

  // Initiate payment
  await dnb.initiatePayment(payment: payment);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dnb: ^1.0.1+1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dnb/dnb.dart';
  
Version Uploaded Documentation Archive
1.0.1+1 Mar 14, 2019 Go to the documentation of dnb 1.0.1+1 Download dnb 1.0.1+1 archive
1.0.1 Mar 14, 2019 Go to the documentation of dnb 1.0.1 Download dnb 1.0.1 archive
1.0.0 Mar 14, 2019 Go to the documentation of dnb 1.0.0 Download dnb 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Mar 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:dnb/dnb.dart.

Health suggestions

Format lib/dnb.dart.

Run dartfmt to format lib/dnb.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
http ^0.12.0 0.12.0+1
meta ^1.1.6 1.1.7
sigv4 ^1.0.0 1.0.0
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
convert 2.1.1
crypto 2.0.6
http_parser 3.1.3
path 1.6.2
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
dotenv ^1.0.0
test ^1.5.3