CreditCardRules
in package
Class CreditCardRules
Provides validation methods for common credit-card inputs.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- valid_cc_number() : bool
- Verifies that a credit card number is valid and matches the known formats for a wide number of credit card types. This does not verify that the card is a valid card, only that the number is formatted correctly.
Properties
$nonStrictCreditCardRules read-only
private
CreditCardRules
$nonStrictCreditCardRules
Methods
__construct()
public
__construct() : mixed
valid_cc_number()
Verifies that a credit card number is valid and matches the known formats for a wide number of credit card types. This does not verify that the card is a valid card, only that the number is formatted correctly.
public
valid_cc_number(array<string|int, mixed>|bool|float|int|object|string|null $ccNumber, string $type) : bool
Example: $rules = [ 'cc_num' => 'valid_cc_number[visa]' ];
Parameters
- $ccNumber : array<string|int, mixed>|bool|float|int|object|string|null
- $type : string