hypnodev/laravel-nordigen

There is no license information available for the latest version (1.0.0) of this package.

1.0.0 2023-01-11 11:36 UTC

This package is auto-updated.

Last update: 2024-10-11 15:31:27 UTC


README

Latest Version on Packagist Total Downloads

Unofficial Laravel library to integrate Nordigen inside our application and easily get details through User. banner

Installation

Via Composer

$ composer require hypnodev/laravel-nordigen

Publish the configuration with command:

$ php artisan vendor:publish --provider="Hypnodev\LaravelNordigen\LaravelNordigenServiceProvider" 

Add these keys in your .env:

NORDIGEN_SECRET_ID=
NORDIGEN_SECRET_KEY=

LARAVEL_NORDIGEN_SUCCESS_URI="/"

If you don't have yet credentials for Nordigen API, please refer to User Secrets | Open Banking Portal | Nordigen

Usage

Add HasNordigen trait to your User model

<?php

namespace App\Models;

use Hypnodev\LaravelNordigen\Traits\HasNordigen;
// ...

class User extends Authenticatable
{
    use Notifiable, HasNordigen;
    
    // ...
}

This will add nordigenRequisition, createRequisitionUrl, nordigenAccounts, nordigenAccountto your user.

Then you can create (and obtain link) requisition for bank (institution) with method:

<?php
auth()->user()->createRequisitionUrl('REVOLUT_REVOGB21');

and obtain accounts (wallet) information with these methods:

$accounts = $user->nordigenAccounts();
$account = $user->nordigenAccount($accounts[0]);
dd($account);

nordigenAccounts() accepts a requisition reference as optional parameter to get specified accounts for a certain bank otherwise it will take accounts for the first requisition available for this user.

Change log

Please see the changelog for more information on what has changed recently.

Security

If you discover any security related issues, please email me@cristiancosenza.com instead of using the issue tracker.

Credits

License

Please see the license file for more information.