{"id":28479256,"url":"https://github.com/scolib/bankcard","last_synced_at":"2025-07-03T09:31:08.277Z","repository":{"id":62541257,"uuid":"84916036","full_name":"ScoLib/bankcard","owner":"ScoLib","description":"根据银行卡号识别所属银行以及卡类型","archived":false,"fork":false,"pushed_at":"2017-03-16T07:34:56.000Z","size":39,"stargazers_count":17,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-07T18:08:41.570Z","etag":null,"topics":["bankcard","sco","scolib"],"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/ScoLib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-14T06:56:07.000Z","updated_at":"2024-06-21T08:13:11.000Z","dependencies_parsed_at":"2022-11-02T15:33:02.822Z","dependency_job_id":null,"html_url":"https://github.com/ScoLib/bankcard","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ScoLib/bankcard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScoLib%2Fbankcard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScoLib%2Fbankcard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScoLib%2Fbankcard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScoLib%2Fbankcard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScoLib","download_url":"https://codeload.github.com/ScoLib/bankcard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScoLib%2Fbankcard/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263300134,"owners_count":23445189,"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":["bankcard","sco","scolib"],"created_at":"2025-06-07T18:08:39.682Z","updated_at":"2025-07-03T09:31:08.267Z","avatar_url":"https://github.com/ScoLib.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bankcard\n\n[![StyleCI][ico-styleci]][link-styleci]\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Software License][ico-license]](LICENSE.md)\n[![Build Status][ico-travis]][link-travis]\n[![Coverage Status][ico-scrutinizer]][link-scrutinizer]\n[![Quality Score][ico-code-quality]][link-code-quality]\n[![Total Downloads][ico-downloads]][link-downloads]\n\n根据银行卡号识别所属银行以及卡类型   \n目前支持两种识别方式：阿里API和正则，默认使用阿里的API\n\n\n## 安装\n\nVia Composer\n\n``` bash\n$ composer require scolib/bankcard\n```\n\n## 使用\n\n``` php\n$bankcard = new Sco\\Bankcard\\Bankcard();\n//$bankcard = new Sco\\Bankcard\\Bankcard(new Sco\\Bankcard\\Providers\\RegexProvider());\n\n// 返回一个Sco\\Bankcard\\Info实例\n// 如果未识别 抛出异常 Sco\\Bankcard\\Exceptions\\ValidationException\n$info = $bankcard-\u003einfo($cardNo);\n\n// 银行卡信息（数组）\n$info-\u003egetBankInfo();\n\n// 所属银行代号\n$info-\u003egetBankCode();\n\n// 所属银行名称\n$info-\u003egetBankName();\n\n// 所属银行icon（如果有）\n$info-\u003egetBankIcon();\n\n// 卡类型代号\n$info-\u003egetCardType();\n\n// 卡类型名称\n$info-\u003egetCardTypeName();\n```\n\n## Change log\n\n[更新日志](CHANGELOG.md)\n\n## Testing\n\n``` bash\n$ composer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email slice1213@gmail.com instead of using the issue tracker.\n\n## Credits\n\n- [klgd][link-author]\n- [All Contributors][link-contributors]\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n[ico-styleci]: https://styleci.io/repos/84916036/shield?branch=master\n[ico-version]: https://img.shields.io/packagist/v/ScoLib/bankcard.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-travis]: https://img.shields.io/travis/ScoLib/bankcard/master.svg?style=flat-square\n[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/ScoLib/bankcard.svg?style=flat-square\n[ico-code-quality]: https://img.shields.io/scrutinizer/g/ScoLib/bankcard.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/ScoLib/bankcard.svg?style=flat-square\n\n[link-styleci]: https://styleci.io/repos/84916036\n[link-packagist]: https://packagist.org/packages/ScoLib/bankcard\n[link-travis]: https://travis-ci.org/ScoLib/bankcard\n[link-scrutinizer]: https://scrutinizer-ci.com/g/ScoLib/bankcard/code-structure\n[link-code-quality]: https://scrutinizer-ci.com/g/ScoLib/bankcard\n[link-downloads]: https://packagist.org/packages/ScoLib/bankcard\n[link-author]: https://github.com/klgd\n[link-contributors]: ../../contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscolib%2Fbankcard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscolib%2Fbankcard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscolib%2Fbankcard/lists"}