LaravelPackages.net
Acme Inc.
Toggle sidebar
amiriskander/valid-credit-card

Validate credit and debit cards given their card numbers and cvc number

19
1
v1.0.1
About amiriskander/valid-credit-card

amiriskander/valid-credit-card is a Laravel package for validate credit and debit cards given their card numbers and cvc number. It currently has 1 GitHub stars and 19 downloads on Packagist (latest version v1.0.1). Install it with composer require amiriskander/valid-credit-card. Discover more Laravel packages by amiriskander or browse all Laravel packages to compare alternatives.

Last updated

Valid Credit Card

Build Status Latest Stable Version Total Downloads License

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

Star History Chart