Valida...itcard(3pm)

πŸ“¦
version 7.900059 Β· 7 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’³ Validation::Class::Directive::Creditcard β€” the creditcard directive, bestie

okay so real quick, the manual name is Valida...itcard(3pm) (yes the title is truncated, that's just how the page header renders it, don't come for me) and it lives in the User Contributed Perl Documentation section. It's the Validation::Class::Directive::Creditcard page β€” aka the Creditcard Directive for Validation Class Field Definitions. πŸ’…


✨ VERSION ✨

version 7.900059 πŸŽ€


🌸 SYNOPSIS 🌸

here's the whole vibe, copy-paste ready:

use Validation::Class::Simple;

my $rules = Validation::Class::Simple->new(
    fields => {
        person_cc  => {
            creditcard => 1
        }
    }
);

# set parameters to be validated
$rules->params->add($parameters);

# validate
unless ($rules->validate) {
    # handle the failures
}

so you build your rules, you add your $parameters to $rules->params, and then you validate β€” and if it comes back false, unless catches it and you handle the failures. that's it, that's the whole loop πŸ¦‹


πŸ’– DESCRIPTION πŸ’–

Validation::Class::Directive::Creditcard is a core validation class field directive that provides validation for american express, bankcard, diners card, discover card, electron, enroute, jcb, maestro, mastercard, solo, switch, visa and voyager credit cards. literally all of them. no cap. 🫢

  • alternative argument: an-array-of-options
  • option: amex
  • option: bankcard
  • option: diners
  • option: disc
  • option: electron
  • option: enroute
  • option: jcb
  • option: maestro
  • option: mastercard
  • option: solo
  • option: switch
  • option: visa
  • option: voyager
the way that this directive can be passed a single value or an array of values β€” both are valid, you're not doing it wrong either way:
fields => {
    person_cc  => {
        creditcard => ['visa', 'mastercard']
    }
}

look at that array of options just doing its little thing. iconic behavior tbh 🌈✨


πŸ‘‘ AUTHOR πŸ‘‘

Al Newkirk <anewkirk@ana.io> β€” king shit, respect πŸ’œ


This software is copyright (c) 2011 by Al Newkirk.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

so basically: free software, same terms as Perl 5, go wild, just don't be weird about the copyright. fr fr πŸ™ˆ

okay bestie that's the whole page β€” you ate that πŸ’… and for the record, this lil doc is from perl v5.36.0, dated 2023-06-11, and the page header/footer both say Valida...itcard(3pm) because the man page name is just Like That. bye bestie, go validate some credit cards πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from