Skip to content
This repository has been archived by the owner on Aug 10, 2022. It is now read-only.

An API Tool that allows you to easily communicate with DNBs new API using Laravel.

License

Notifications You must be signed in to change notification settings

einar-hansen/laravel-dnb-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DNB Laravel API Client

Latest Version on Packagist Quality Score License Total Downloads StyleCI

E2Consult is a webdevelopment team based in Oslo, Norway. You'll find more information about us on our website.

This package is made to easily communicate with DNBs API using PHP and Laravel, read more about the API.

Installation

You can install the package via composer:

composer require e2consult/dnb-client

Then you need to set your credentials in the .env file, and add the following array to your config/services.php file.

    'dnb' => [
        'client_id'     => env('DNB_CLIENT_ID'),
        'client_secret' => env('DNB_CLIENT_SECRET'),
        'api_key'       => env('DNB_API_KEY'),
        'region'       => env('DNB_REGION', 'eu-west-1'),
        'service'       => env('DNB_SERVICE', 'execute-api'),
        'endpoint'       => env('DNB_ENDPOINT', 'https://developer-api-sandbox.dnb.no'),
    ],

Usage

To get going you only need to pass the relevant customer ID when creating the client.

    use E2Consult\DNBApiClient\Client;

    $client = new Client($customerId);

    // Customer
    $client->getCustomerDetails();

    // Accounts
    $client->getAccounts();
    $client->getAccountDetails($accountNumber);
    $client->getAccountBalance($accountNumber);
    $client->getAccountTransactions($accountNumber, $from, $to);

    // Payments
    $client->initiatePayment($debitAccountNumber, $creditAccountNumber, $amount, $requestedExecutionDate);
    $client->updatePayment($accountNumber, $paymentId, $debitAccountNumber, $amount, $status, $requestedExecutionDate);
    $client->deletePayment($accountNumber, $paymentId);
    $client->getDuePayments($accountNumber);
    $client->getDuePayment($accountNumber, $paymentId);

    // Currencies
    $client->getCurrencyRates();
    $client->convertCurrency($targetCurrency);

    // Location
    $client->getBranches();
    $client->getBranch($branchId);
    $client->getATMs();

    $client->getNearestBranch($address);
    // or
    $client->getNearestBranch([$latitude, $longitude]);
    $client->getNearestATM($latitude = 0, $longitude = 0);

License

The MIT License (MIT).

About

An API Tool that allows you to easily communicate with DNBs new API using Laravel.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages