amiriskander/valid-credit-card
Composer 安装命令:
composer require amiriskander/valid-credit-card
包简介
Validate credit and debit cards given their card numbers and cvc number
README 文档
README
Simple and lightweight package that validates credit cards and debit cards for popular providers.
It validates cards against their card number lengths, card number patterns, CVC length and using Luhn algorithm if it were supported by the provider.
Installation
Require the package using composer
composer require amiriskander/valid-credit-card
Or add it manually to composer.json in the list of dependencies under require
"require": { "amiriskander/valid-credit-card": "*" },
Usage
Validate Credit/Debit card:
use AmirIskander\CreditCard\CreditCardValidator; $cardValidator = new CreditCardValidator(); $isValid = $cardValidator->validateCreditCard('4539392426082460', '123'); var_dump($isValid);
Output:
bool(true)
Tests
Execute the below command to run the unit tests:
vendor/bin/phpunit tests
Resources
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-01-17