Skip to content

Commit

Permalink
Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Chekalskiy committed Jul 2, 2018
1 parent 2f8411f commit 65a5e31
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,42 @@

> It is a PHP port of [ramoona's banks-db](https://github.com/ramoona/banks-db).
Returns bank's name and brand color by bankcard prefix (BIN, Issuer Identification Numbers, IIN).

> It's a community driven database, so it can potentially contains mistakes.
For UI examples see the [original library](https://github.com/ramoona/banks-db).
Returns bank's name and brand color by bank card number's first digits (BIN, Issuer Identification Numbers, IIN).

### Installation

```
composer require chekalskiy/php-bank-db
```
```

### Basic usage

```php
$card_prefix = $_GET['card_prefix']; // we only need first 6 digits

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

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

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

### Contributions

Feel free to open [an issue](https://github.com/chekalskiy/php-bank-db/issues) on every question you have.

---

> It's a community driven database, so it can potentially contains mistakes.
For UI examples see the [original library](https://github.com/ramoona/banks-db).

0 comments on commit 65a5e31

Please sign in to comment.