X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpay_batch%2Ftd_eft1464.pm;h=3c60035cea46b567a4f25b437adee1ea176f7ddc;hb=e44835f640559a6eb5bc831e08732d5ab8947dd4;hp=afdc1bef329406afdb9fe032885871903da6dd96;hpb=38691d4d87bec5b1ceffd5a399cdf299af4b1bd5;p=freeside.git diff --git a/FS/FS/pay_batch/td_eft1464.pm b/FS/FS/pay_batch/td_eft1464.pm index afdc1bef3..3c60035ce 100644 --- a/FS/FS/pay_batch/td_eft1464.pm +++ b/FS/FS/pay_batch/td_eft1464.pm @@ -101,11 +101,19 @@ $name = 'td_eft1464'; row => sub { my ($cust_pay_batch, $pay_batch) = @_; my ($account, $aba) = split('@', $cust_pay_batch->payinfo); + if ( $aba =~ /^(\d+)\.(\d+)$/ ) { #branch.route + $aba = $2.$1; #routebranch + } $i++; # The 1464 byte format supports up to 5 payments per line, # but we're only going to send 1. + + ## set to D for debit by default, then override to what cust_pay_batch has as payments may not have paycode. + my $debitorcredit = 'D'; + $debitorcredit = $cust_pay_batch->paycode unless !$cust_pay_batch->paycode; + my $control = join('', - 'D', # for 'debit' + $debitorcredit, # D for 'debit' or C for Credit sprintf("%09u", $i), #record number $opt{'origid'}, $opt{'fcn'}, @@ -151,5 +159,14 @@ $name = 'td_eft1464'; }, ); +sub _upgrade_gateway { + my $conf = FS::Conf->new; + my @batchconfig = $conf->config('batchconfig-td_eft1464'); + my %options; + @options{ qw(originator datacentre short_name long_name return_branch + return_account cpa_code) } = @batchconfig; + ( 'TD_EFT', %options ); +} + 1;