{"id":15633956,"url":"https://github.com/chekalsky/php-banks-db","last_synced_at":"2025-05-15T20:01:32.963Z","repository":{"id":46077488,"uuid":"139423904","full_name":"chekalsky/php-banks-db","owner":"chekalsky","description":"PHP library for getting bank info (name, brand color etc) by first digits of card's number","archived":false,"fork":false,"pushed_at":"2025-02-15T01:11:02.000Z","size":253,"stargazers_count":149,"open_issues_count":0,"forks_count":22,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-01T01:37:40.443Z","etag":null,"topics":["bank","bank-card","banks-db","bin","credit-card","iin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chekalsky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-02T09:50:27.000Z","updated_at":"2025-02-17T20:57:24.000Z","dependencies_parsed_at":"2025-03-17T23:45:57.632Z","dependency_job_id":"64dbc51f-8665-474b-8b69-3e8e47a12f9a","html_url":"https://github.com/chekalsky/php-banks-db","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chekalsky%2Fphp-banks-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chekalsky%2Fphp-banks-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chekalsky%2Fphp-banks-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chekalsky%2Fphp-banks-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chekalsky","download_url":"https://codeload.github.com/chekalsky/php-banks-db/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247766357,"owners_count":20992460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bank","bank-card","banks-db","bin","credit-card","iin"],"created_at":"2024-10-03T10:50:45.080Z","updated_at":"2025-04-08T02:37:46.186Z","avatar_url":"https://github.com/chekalsky.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Banks DB\n\n[![PHP Tests](https://github.com/chekalsky/php-banks-db/actions/workflows/ci.yml/badge.svg)](https://github.com/chekalsky/php-banks-db/actions/workflows/ci.yml)\n\n\u003e It is a PHP port of [ramoona's banks-db](https://github.com/ramoona/banks-db).\n\nReturns bank's name and brand color by bank card number's first digits (BIN, Issuer Identification Numbers, IIN).\n\n### Installation\n\n```\ncomposer require chekalskiy/php-banks-db\n```\n\n### Basic usage\n\n```php\n$card_prefix = '5275 9400 0000 0000'; // we only need first 6 digits but it could be the whole card number\n\ntry {\n    $bank_db = new BankDb();\n    $bank_info = $bank_db-\u003egetBankInfo($card_prefix);\n\n    $result = [\n        'is_unknown' =\u003e $bank_info-\u003eisUnknown(), // is bank unknown\n        'name' =\u003e $bank_info-\u003egetTitle(true),\n        'color' =\u003e $bank_info-\u003egetColor(),\n        'type' =\u003e $bank_info-\u003egetCardType(),\n    ];\n\n    return $result;\n} catch (BankDbException $e) {\n    // todo handle exception\n}\n```\n\n### About database\n\nWe 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.\n\n#### Database update\nDatabase updates from [original library](https://github.com/ramoona/banks-db) by me. To update php cache file after manual database change run `composer rebuild`.\n\n### Contributions\n\nFeel free to open [an issue](https://github.com/chekalskiy/php-banks-db/issues) on every question you have. If you have new prefixes for database please commit them to [ramoona/banks-db repository](https://github.com/ramoona/banks-db) — I will update them once your PR will me merged there.\n\n---\n\n\u003e It's a community driven database, so it can potentially contains mistakes.\n\nFor UI examples see the [original library](https://github.com/ramoona/banks-db).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchekalsky%2Fphp-banks-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchekalsky%2Fphp-banks-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchekalsky%2Fphp-banks-db/lists"}