2017 © Pedro Peláez
 

library php-bank-db

PHP bank cards IIN/BIN database. Get bank info by card number

image

chekalskiy/php-bank-db

PHP bank cards IIN/BIN database. Get bank info by card number

  • Wednesday, July 25, 2018
  • by chekalskiy
  • Repository
  • 0 Watchers
  • 3 Stars
  • 207 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

PHP Banks DB

PHP Tests, (*1)

It is a PHP port of ramoona's banks-db., (*2)

Returns bank's name and brand color by bank card number's first digits (BIN, Issuer Identification Numbers, IIN)., (*3)

Installation

composer require chekalskiy/php-banks-db

Basic usage

$card_prefix = '5275 9400 0000 0000'; // we only need first 6 digits but it could be the whole card number

try {
    $bank_db = new BankDb();
    $bank_info = $bank_db->getBankInfo($card_prefix);

    $result = [
        'is_unknown' => $bank_info->isUnknown(), // is bank unknown
        'name' => $bank_info->getTitle(true),
        'color' => $bank_info->getColor(),
        'type' => $bank_info->getCardType(),
    ];

    return $result;
} catch (BankDbException $e) {
    // todo handle exception
}

About database

We use simple PHP-file with an array inside (it's regenerates every time ramoona's repository is updated). It's very fast and simple way to work with data because of opcache enabled by default in PHP 7. But you can extend BankDB class to make it work with redis or something, but for most cases compiled php-file is OK., (*4)

Database update

Database updates from original library by me. To update php cache file after manual database change run composer rebuild., (*5)

Contributions

Feel free to open an issue on every question you have. If you have new prefixes for database please commit them to ramoona/banks-db repository — I will update them once your PR will me merged there., (*6)


It's a community driven database, so it can potentially contains mistakes., (*7)

For UI examples see the original library., (*8)

The Versions

25/07 2018

dev-dependabot/submodules/banks-db-0bd4921

dev-dependabot/submodules/banks-db-0bd4921 https://github.com/chekalskiy/php-bank-db

PHP bank cards IIN/BIN database. Get bank info by card number

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

bin creditcard card iin issuer identification numbers

03/07 2018

dev-master

9999999-dev https://github.com/chekalskiy/php-bank-db

PHP bank cards IIN/BIN database. Get bank info by card number

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

bin creditcard card iin issuer identification numbers

03/07 2018

v0.2.1

0.2.1.0 https://github.com/chekalskiy/php-bank-db

PHP bank cards IIN/BIN database. Get bank info by card number

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

bin creditcard card iin issuer identification numbers

03/07 2018

v0.2

0.2.0.0 https://github.com/chekalskiy/php-bank-db

PHP bank cards IIN/BIN database. Get bank info by card number

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

bin creditcard card iin issuer identification numbers

02/07 2018

v0.1.1

0.1.1.0 https://github.com/chekalskiy/php-bank-db

PHP bank cards IIN/BIN database. Get bank info by card number

  Sources   Download

MIT

The Requires

  • php >=7.0

 

bin creditcard card iin issuer identification numbers