-
Notifications
You must be signed in to change notification settings - Fork 2
CreditCard
Pieter Hordijk edited this page Dec 30, 2018
·
1 revision
Validates the input (string without formatting) to be a valid American Express credit card number.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\CreditCard\AmericanExpress;
(new AmericanExpress())->validate('340000000000009');-
Type.Stringwhen the validated value is not a string -
CreditCard.AmericanExpresswhen the validated value is not a valid American Express credit card number -
CreditCard.LuhnChecksumwhen the validated value's checksum digit is not valid
Validates the input (string without formatting) to be a valid Diners Club credit card number.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\CreditCard\DinersClub;
(new DinersClub())->validate('30000000000004');-
Type.Stringwhen the validated value is not a string -
CreditCard.DinersClubwhen the validated value is not a valid Diners Club credit card number -
CreditCard.LuhnChecksumwhen the validated value's checksum digit is not valid
Validates the input (string without formatting) to be a valid Discover credit card number.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\CreditCard\Discover;
(new Discover())->validate('6011000000000004');-
Type.Stringwhen the validated value is not a string -
CreditCard.Discoverwhen the validated value is not a valid Discover credit card number -
CreditCard.LuhnChecksumwhen the validated value's checksum digit is not valid
Validates the input (string without formatting) to result in a valid Luhn checksum.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\CreditCard\LuhnChecksum;
(new LuhnChecksum())->validate('340000000000009');-
Type.Stringwhen the validated value is not a string -
CreditCard.LuhnChecksumwhen the validated value is does not result in a valid Luhn checksum
Validates the input (string without formatting) to be a valid MasterCard credit card number.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\CreditCard\MasterCard;
(new MasterCard())->validate('5500000000000004');-
Type.Stringwhen the validated value is not a string -
CreditCard.MasterCardwhen the validated value is not a valid MasterCard credit card number -
CreditCard.LuhnChecksumwhen the validated value's checksum digit is not valid
Validates the input (string without formatting) to be a valid Visa credit card number.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\CreditCard\Visa;
(new Visa())->validate('4111111111111111');-
Type.Stringwhen the validated value is not a string -
CreditCard.Visawhen the validated value is not a valid Visa credit card number -
CreditCard.LuhnChecksumwhen the validated value's checksum digit is not valid