1 package Business::BatchPayment::KeyBank;
10 Business::BatchPayment::KeyBank - Key Bank check lockbox format
18 See L<Business::BatchPayment> for general usage notes. This is a
19 one-way, non-transport processor; you must supply the file to be
24 use Business::BatchPayment;
26 my $processor = Business::BatchPayment->create( KeyBank =>
27 input => 'mybatch.csv');
29 my @items = $processor->receive;
31 =head2 PROCESSOR ATTRIBUTES
39 use Digest::MD5 qw( md5_hex );
42 with 'Business::BatchPayment::Processor';
45 sub format_item { '' }
49 default => sub { Text::CSV->new() },
53 my ($self, $content) = @_;
54 # we just need it to be unique...
55 return md5_hex($content);
59 my ($self, $row) = @_;
60 $self->_csv->parse($row);
61 if ( !$self->_csv->status ) {
62 die $self->_csv->error_diag . "\n";
64 my @f = $self->_csv->fields;
69 # INVOICEID, ACCOUNT_NUMBER, POSTDATE, AMOUNT, CHECK_NUMBER
70 # date in YYYYMMDD format
71 $f[2] =~ /^(\d{4})(\d{2})(\d{2})$/ or die "bad process date '$f[2]'\n";
72 my $dt = eval { DateTime->new( year => $1, month => $2, day => $3 ) }
73 or die "bad process date '$f[2]'\n";
75 my $amount = $f[3] / 100;
76 Business::BatchPayment->create(Item =>
78 payment_type => 'ECHECK',
79 invoice_number => $f[0],
83 check_number => $f[3],
84 order_number => $f[3], #?
89 __PACKAGE__->meta->make_immutable;
93 Mark Wells, <mark@freeside.biz>
97 You can find documentation for this module with the perldoc command.
99 perldoc Business::BatchPayment::KeyBank
101 Commercial support is available from Freeside Internet Services, Inc.
103 L<http://www.freeside.biz>
105 =head1 LICENSE AND COPYRIGHT
107 Copyright 2012 Mark Wells.
109 This program is free software; you can redistribute it and/or modify it
110 under the terms of either: the GNU General Public License as published
111 by the Free Software Foundation; or the Artistic License.
113 See http://dev.perl.org/licenses/ for more information.