2017-25 © Pedro Peláez
 

library yii2-creditcard-validator

Validate credit cards.

image

gdianov/yii2-creditcard-validator

Validate credit cards.

  • Wednesday, June 28, 2017
  • by s0maly
  • Repository
  • 1 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 19 % Grown

The README.md

yii2-creditcard-validator

Supported cards :

  1. visaelectron
  2. maestro
  3. forbrugsforeningen
  4. dankort
  5. visa
  6. mastercard
  7. amex
  8. dinersclub
  9. discover
  10. unionpay
  11. jcb

Install: "require": { "gdianov/yii2-creditcard-validator": "^1.0" },, (*1)

How to use?

You can attach the validator as a model or use it directly., (*2)

public function rules() {
       return [
           [['text'], 'string'],
           ['card', CreditCardValidator::className(), 'type' => 'mastercard', 'luhn' => true],
           [['date'], 'safe'],
       ];
    }

CreditCardValidator::validateCard('mastercard', 5100000000000000, true); //return true or false

Params: 1. type of card. 2. value for validation 3. apply luhn algorithm (https://en.wikipedia.org/wiki/Luhn_algorithm), (*3)

The Versions

28/06 2017

dev-master

9999999-dev

Validate credit cards.

  Sources   Download

MIT

The Requires

 

by Dianov German

yii2 validate cards active record credit

28/06 2017

v1.0

1.0.0.0

Validate credit cards.

  Sources   Download

MIT

The Requires

 

by Dianov German

yii2 validate cards active record credit