Giter Site home page Giter Site logo

iban's Introduction

Iban

A small library for validating and generating International Bankaccount Numbers (IBAN). It is build for PHP 5.3+.

Build Status Latest Stable Version Total Downloads Latest Unstable Version License PHP Version

Development status

This library is ready to use. The iban validation should be run fine, but there is no warranty for the generation functionality. Please use it at your own risk.


Installation

To install jschaedl/iban install Composer first, if you haven't already

curl -sS https://getcomposer.org/installer | php

Then just add the following to your composer.json file:

// composer.json
{
	"require": {
		"jschaedl/iban": "1.1.6"
	}
}

Then, you can install the new dependencies by running Composer’s update command from the directory where your composer.json file is located:

# install
$ php composer.phar install
# update
$ php composer.phar update jschaedl/iban

# or you can simply execute composer command if you set it to
# your PATH environment variable
$ composer install
$ composer update jschaedl/iban

You can see this library on Packagist.

Composer installs autoloader at ./vendor/autoload.php. If you use jschaedl/iban in your php script, add:

require_once 'vendor/autoload.php';

Or you can use git clone command:

# HTTP
$ git clone https://github.com/jschaedl/Iban.git
# SSH
$ git clone [email protected]:jschaedl/Iban.git

Usage example

<?php

use IBAN\Validation\IBANValidator;
use IBAN\Generation\IBANGenerator;
use IBAN\Rule\RuleFactory;
    
// validation example
$ibanValidator = new IBANValidator();
if ($ibanValidator->validate('DE89370400440532013000')) {
	echo "DE89370400440532013000 is valid!";
}
 
// generate german iban example #1
$ibanGenerator = new IBANGeneratorDE();
$generatedIban = $ibanGenerator->generate('60050101', '502502502'); 
// $generatedIban => DE15600501010001108884

// generate german iban example #2
$generatedIban = IBANGenerator::DE('60050101', '502502502');
// $generatedIban => DE15600501010001108884

// generate dutch iban example #1
$ibanGenerator = new IBANGeneratorNL();
$generatedIban = $ibanGenerator->generate('ABNA', '123456789'); 
// $generatedIban => NL02ABNA0123456789

// generate dutch iban example #2
$generatedIban = IBANGenerator::NL('ABNA', '123456789');
// $generatedIban => NL02ABNA0123456789
 

How to contribute

If you want to fix some bugs or want to enhance some functionality, please fork the master branch and create your own development branch. Then fix the bug you found or add your enhancements and make a pull request. Please commit your changes in tiny steps and add a detailed description on every commit.

Unit Testing

All pull requests must be accompanied by passing unit tests. This repository uses phpunit and Composer. You must run composer install to install this package's dependencies before the unit tests will run. You can run the test via:

phpunit -c tests/phpunit.xml tests/

ToDos

  • add support for more countries

Author

Jan Schädlich

Contributions

License

MIT Public License

Bitdeli Badge

iban's People

Contributors

jschaedl avatar i-ivanov avatar thecatontheflat avatar benjaminpaap avatar bitdeli-chef avatar mabrahamde avatar matissjanis avatar midnightdesign avatar keywan-ghadami-oxid avatar m0003r avatar

Watchers

James Cloos avatar Derschatta 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.