项目作者: vyuldashev

项目描述 :
API for bank cards
高级语言: PHP
项目地址: git://github.com/vyuldashev/cards.git
创建时间: 2017-09-19T22:31:34Z
项目社区:https://github.com/vyuldashev/cards

开源协议:MIT License

下载


Cards

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:

  1. composer require vyuldashev/cards

Usage

  1. use Vyuldashev\Cards\Card;
  2. Card::create('4916080075115045'); // Vyuldashev\Cards\Visa::class
  3. Card::create('5258369670492716'); // Vyuldashev\Cards\MasterCard::class

Pan may also contain non-numeric characters, method create will remove these characters itself.

  1. Card::create('4916-0800-7511-5045'); // 4916080075115045

Create card with passing expiration month, expiration year and cvv. Each argument is optional:

  1. Card::create('4916080075115045', 3, 2021, 123);

If card type cannot be identified, Unknown card instance will be returned.

  1. Card::create('8888888888888888'); // Vyuldashev\Cards\Unknown::class