vyuldashev / cards
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
pkg:composer/vyuldashev/cards
Requires
- php: >=7.1
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.3
- nesbot/carbon: ^1.22
- spatie/regex: ^1.2
Requires (Dev)
- fzaninotto/faker: ^1.7
- larapack/dd: ^1.1
- phpunit/phpunit: ^6.3
This package is auto-updated.
Last update: 2025-10-05 21:22:42 UTC
README
This package provides an API for bank cards. Card object is a value object and cannot be modified. Also, this package takes care of secure serialization and deserialization of card information and provides an API for bin data information retrieval.
Installation
You can install the package via composer:
composer require vyuldashev/cards
Usage
use Vyuldashev\Cards\Card; Card::create('4916080075115045'); // Vyuldashev\Cards\Visa::class Card::create('5258369670492716'); // Vyuldashev\Cards\MasterCard::class
Pan may also contain non-numeric characters, method create will remove these characters itself.
Card::create('4916-0800-7511-5045'); // 4916080075115045
Create card with passing expiration month, expiration year and cvv. Each argument is optional:
Card::create('4916080075115045', 3, 2021, 123);
If card type cannot be identified, Unknown card instance will be returned.
Card::create('8888888888888888'); // Vyuldashev\Cards\Unknown::class