- LICENSE AND COPYRIGHT
BankAccount::Validator::UK - Interface to validate UK bank account.
The module uses the algorithm provided by VOCALINK to validate the bank sort code and account number. It is done by modulus checking method as specified in the document which is available on their website VOCALINK It currently supports the document v5.70 drafted 16th Apr 2019.
Institutions covered by this document are below:
Bank of England
Bank of Ireland
Bank of Scotland
Bradford and Bingley Building Society
Contis Financial Services
Nationwide Building Society
Orwell Union Ltd.
Royal Bank of Scotland
Unity Trust Bank
Williams & Glyn
If the modulus check shows the account number as valid this means that the account number is a possible account number for the sorting code but does'nt necessarily mean that it's an account number being used at that sorting code. Any account details found as invalid should be checked with the account holder where possible.
The constructor simply expects debug flag, which is optional. By the default the debug flag is off.
use strict; use warnings; use BankAccount::Validator::UK; # Debug is turned off. my $account1 = BankAccount::Validator::UK->new; # Debug is turned on. my $account2 = BankAccount::Validator::UK->new(debug => 1);
It expects two parameters i.e. the sort code and the account number.The sort code can be either nn-nn-nn or nnnnnn format. If the account number starts with 0 then its advisable to pass in as string i.e. '0nnnnnnn'.
use strict; use warnings; use BankAccount::Validator::UK; my $account = BankAccount::Validator::UK->new; print "[10-79-99] is valid.\n" if $account->is_valid(107999, 88837491); print "[18-00-02] is valid.\n" if $account->is_valid('18-00-02', '00000190');
Returns the trace information about each rule that applied to the given sort code and account number.
use strict; use warnings; use Data::Dumper; use BankAccount::Validator::UK; my $account = BankAccount::Validator::UK->new; print "[87-14-27] is valid.\n" if $account->is_valid('871427', '09123496'); print "Trace information:\n" . Dumper($account->get_trace);
Mohammad S Anwar,
<mohammad.anwar at yahoo.com>
Please report any bugs or feature requests to
bug-bankaccount-validator-uk at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=BankAccount-Validator-UK. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
AnnoCPAN: Annotated CPAN documentation
Copyright (C) 2012 - 2017 Mohammad S Anwar.
This program is free software; you can redistribute it and / or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:
Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License.By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.
If your Modified Version has been derived from a Modified Version made by someone other than you,you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.
This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.
This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement,then this Artistic License to you shall terminate on the date that such litigation is filed.
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.