Business::DK::FI - validation of Danish FI numbers
The documentation describes version 0.02
use Business::DK::FI qw(validate validateFI generate); if (validate('026840149965328')) { print "026840149965328 is valid\n"; } my $fi_number = generate(1); if ($fi_number eq '000000000000018') { print "we have a FI number\n"; }
FI numbers are numbers used on GIRO payment forms. These can be used to do online payments in banks or at in physical banks or post offices.
The module currently only supports FI numbers in the following series:
71
75
Takes a single argument. 15 digit FI number. Returns true (1) or false (0) indicating whether the provided parameter adheres to specification.
Less intrusive exported variation of "validate". It is actually "validate" which is wrapping "validateFI".
Simple FI generation method. Takes an arbitrary number adhering to the following requirements:
length between 1 and 14
value between 1 and 99999999999999
Returns a valid FI number.
This method calculates a checksum, it takes a single number as parameter and returns the calculated checksum.
This method calculates a sum it takes a number and a reference to an array of control cifers. It calculates a single sum based on the number and the control cifer and returns this.
All methods die if their API is not respected. Method calls can with success be wrapped in Try::Tiny or eval blocks.
eval
The module requires no special configuration or environment.
Params::Validate
Readonly
Exporter
English
This module has no known bugs or limitations.
Please report issues via CPAN RT:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Business-DK-FI
or by sending mail to
<bug-Business-DK-FI@rt.cpan.org>
---------------------------- ------ ------ ------ ------ ------ ------ ------ File stmt bran cond sub pod time total ---------------------------- ------ ------ ------ ------ ------ ------ ------ blib/lib/Business/DK/FI.pm 100.0 100.0 n/a 100.0 100.0 34.8 100.0 ...b/Class/Business/DK/FI.pm 97.6 83.3 n/a 100.0 100.0 65.2 96.9 Total 99.1 90.0 n/a 100.0 100.0 100.0 98.7 ---------------------------- ------ ------ ------ ------ ------ ------ ------
The code passes Perl::Critic tests at severity 1 (brutal) with a set of policies disabled. please see t/perlcriticrc and the list below:
Perl::Critic::Policy::ValuesAndExpressions::ProhibitConstantPragma, please see: http://logiclab.jira.com/wiki/display/OPEN/Perl-Critic-Policy-ValuesAndExpressions-ProhibitConstantPragma
Perl::Critic::Policy::Documentation::RequirePodLinksIncludeText, this is listed in the "TODO" it requires numerous changes to the distribution POD.
Perl::Critic::Policy::NamingConventions::Capitalization, "validateFI" is exported both as "validateFI" and "validate" and FI is our used acronym so we try to stick to this
Perl::Critic::Policy::ControlStructures::ProhibitCStyleForLoops, this is for the main algorithm, it was easier to do with a C-style for loop
Perl::Critic::Policy::Subroutines::RequireArgUnpacking, this is due to the way: Params::Validate is used
Perl::Critic::Policy::ValuesAndExpressions::ProhibitMagicNumbers, we use long control numbers
Perl::Critic:.:Policy::Variables::ProhibitPunctuationVars
Please see the distribution TODO file also and the distribution road map at: http://logiclab.jira.com/browse/BDKFI#selectedTab=com.atlassian.jira.plugin.system.project%3Aroadmap-panel
http://www.pbs.dk/
Try::Tiny
Business::DK::CVR
Business::DK::CPR
Business::DK::PO
Business::DK::Postalcode
Business::DK::Phonenumber
Jonas B. Nielsen, (jonasbn) - <jonasbn@cpan.org>
<jonasbn@cpan.org>
Business-DK-FI and related is (C) by Jonas B. Nielsen, (jonasbn) 2009-2014
Business-DK-FI and related is released under the Artistic License 2.0
See the included license file for details
To install Business::DK::FI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::DK::FI
CPAN shell
perl -MCPAN -e shell install Business::DK::FI
For more information on module installation, please visit the detailed CPAN module installation guide.