Giter Site home page Giter Site logo

banktolaravel's Introduction

README

Build Status

What it is

This package create a database table to store all bank bookings/statements. Also a artisan command for importing them directly from your bank is created with php artisan bank:import. New Entries are published as an event you can easily listen to, see Usage for more. This package supports HBCI/FinTS, a german standard for communicating with bank institutes.

Thank you

A ton of thanks to nemiah/fints-hbci-php for providing and maintaining such a nice library where I could easily put my work on top of it!

Install

First add the composer dependency:

composer require pkeidel/banktolaravel

Then publish and run the migration to create the 'bookings' table:

php artisan vendor:publish --provider="PKeidel\BankToLaravel\Providers\BankToLaravelServiceProvider" --tag=migrations
php artisan migrate

Now add this to a good protected route group:

Route::resource('bookings', '\PKeidel\BankToLaravel\Controllers\BookingsController');

Finally create a task scheduler as described HERE:

$schedule->command('bank:import')->hourly();

Usage

Append these values to your .env file:

# https://github.com/willuhn/hbci4java/blob/master/src/blz.properties
FHP_BANK_URL=
FHP_BANK_CODE=
FHP_ONLINE_REGISTRATIONNO=
FHP_ONLINE_BANKING_USERNAME=
FHP_ONLINE_BANKING_PIN_CMD="keyring get mybank.com myusername"
# OR use decrypted PIN
#FHP_ONLINE_BANKING_PIN=""
FHP_BANK_START="14 days ago"
FHP_BANK_ACCOUNT=

Every time a new Entry is added to the database, an PKeidel\BankToLaravel\Events\NewEntry Event is fired.

In some ServiceProvides boot() function you could simply listen to the events and add some own logic like sending an E-Mail or notify you via some other way.

Event::listen(\PKeidel\BankToLaravel\Events\Error::class, function (Error $error) {
    Log::error("BankToLaravel error: $error->exception");
});

Event::listen(\PKeidel\BankToLaravel\Events\NewEntry::class, function (NewEntry $entry) {
    optional(Users::where('iban', $entry->data['ref_iban'])->first())->notify(new NewBankaccountBooking($entry));
});

banktolaravel's People

Contributors

dependabot[bot] avatar pkeidel avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.