NAME
Business::DK::FI - validation of Danish FI numbers
VERSION
The documentation describes version 0.02
SYNOPSIS
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";
}
DESCRIPTION
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
SUBROUTINES AND METHODS
validate
Takes a single argument. 15 digit FI number. Returns true (1) or false
(0) indicating whether the provided parameter adheres to specification.
validateFI
Less intrusive exported variation of "validate". It is actually
"validate" which is wrapping "validateFI".
generate
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.
PRIVATE SUBROUTINES AND METHODS
_calculate_checksum
This method calculates a checksum, it takes a single number as parameter
and returns the calculated checksum.
_calculate_sum
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.
DIAGNOSTICS
All methods die if their API is not respected. Method calls can with
success be wrapped in Try::Tiny or "eval" blocks.
CONFIGURATION AND ENVIRONMENT
The module requires no special configuration or environment.
DEPENDENCIES
* Params::Validate
* Readonly
* Exporter
* English
BUGS AND LIMITATIONS
This module has no known bugs or limitations.
BUG REPORTING
Please report issues via CPAN RT:
*
or by sending mail to
* ""
TEST AND QUALITY
TEST COVERAGE
---------------------------- ------ ------ ------ ------ ------ ------ ------
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
---------------------------- ------ ------ ------ ------ ------ ------ ------
QUALITY AND CODING STANDARD
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:
* 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
TODO
Please see the distribution TODO file also and the distribution road map
at:
SEE ALSO
* http://www.pbs.dk/
* Try::Tiny
* Business::DK::CVR
* Business::DK::CPR
* Business::DK::PO
* Business::DK::Postalcode
* Business::DK::Phonenumber
AUTHOR
Jonas B. Nielsen, (jonasbn) - ""
COPYRIGHT
Business-DK-FI and related is (C) by Jonas B. Nielsen, (jonasbn)
2009-2011
LICENSE
Business-DK-FI and related is released under the artistic license
The distribution is licensed under the Artistic License, as specified by
the Artistic file in the standard perl distribution
(http://dev.perl.org/licenses/artistic.html).