dev-master
9999999-devValidate credit cards.
MIT
The Requires
by Dianov German
yii2 validate cards active record credit
v1.0
1.0.0.0Validate credit cards.
MIT
The Requires
by Dianov German
yii2 validate cards active record credit
Validate credit cards.
visaelectron
maestro
forbrugsforeningen
dankort
visa
mastercard
amex
dinersclub
discover
unionpay
jcb
Install:
"require":
{
"gdianov/yii2-creditcard-validator": "^1.0"
},
, (*1)
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)
Validate credit cards.
MIT
yii2 validate cards active record credit
Validate credit cards.
MIT
yii2 validate cards active record credit