NAME

Business::DK::FI - Danish FI number validator

VERSION

The documentation describes version 0.09

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

BUGS AND LIMITATIONS

This module has no known bugs or limitations.

BUG REPORTING

Please report issues via CPAN RT:

or by sending mail to

  • <bug-Business-DK-FI@rt.cpan.org>

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:

TODO

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

SEE ALSO

AUTHOR

Jonas B. Nielsen, (jonasbn) - <jonasbn@cpan.org>

COPYRIGHT

Business-DK-FI and related is (C) by Jonas B. Nielsen, (jonasbn) 2009-2016

LICENSE

Business-DK-FI and related is released under the Artistic License 2.0

See the included license file for details