From b775097fa08058195e2d258a38091655bd36ed16 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 21 Oct 2011 16:30:02 +0000 Subject: [PATCH] add bank branch to one-time payments, RT#14859 --- httemplate/misc/payment.cgi | 22 ++++++++++++++++------ httemplate/misc/process/payment.cgi | 9 +++++++-- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi index 1797b29ba..b2baebd07 100644 --- a/httemplate/misc/payment.cgi +++ b/httemplate/misc/payment.cgi @@ -131,13 +131,15 @@ % } elsif ( $payby eq 'CHEK' ) { % -% my( $payinfo1, $payinfo2, $payname, $ss, $paytype, $paystate, +% my( $account, $aba, $branch, $payname, $ss, $paytype, $paystate, % $stateid, $stateid_state ) -% = ( '', '', '', '', '', '', '', '' ); +% = ( '', '', '', '', '', '', '', '', '' ); % if ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) { -% $cust_main->paymask =~ /^([\dx]+)\@([\dx]*)$/i +% $cust_main->paymask =~ /^([\dx]+)\@([\d\.x]*)$/i % or die "unparsable payinfo ". $cust_main->payinfo; -% ($payinfo1, $payinfo2) = ($1, $2); +% ($account, $aba) = ($1, $2); +% ($branch,$aba) = split('\.',$aba) +% if $conf->exists('cust_main-require-bank-branch'); % $payname = $cust_main->payname; % $ss = $cust_main->ss; % $paytype = $cust_main->getfield('paytype'); @@ -150,17 +152,25 @@ <% mt('Account number') |h %> - + <% mt('Type') |h %> <% mt('ABA/Routing number') |h %> - + (<% mt('help') |h %>) +% if ( $conf->exists('cust_main-require-bank-branch') ) { + + <% mt('Branch number') |h %> + + + + +% } <% mt('Bank name') |h %> diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index e09cb570c..efbdb764c 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -81,11 +81,16 @@ if ( $payby eq 'CHEK' ) { $payinfo = $cust_main->payinfo; } else { $cgi->param('payinfo1') =~ /^(\d+)$/ - or errorpage("illegal account number ". $cgi->param('payinfo1')); + or errorpage("Illegal account number ". $cgi->param('payinfo1')); my $payinfo1 = $1; $cgi->param('payinfo2') =~ /^(\d+)$/ - or errorpage("illegal ABA/routing number ". $cgi->param('payinfo2')); + or errorpage("Illegal ABA/routing number ". $cgi->param('payinfo2')); my $payinfo2 = $1; + if ( $conf->exists('cust_main-require-bank-branch') ) { + $cgi->param('payinfo3') =~ /^(\d+)$/ + or errorpage("Illegal branch number ". $cgi->param('payinfo2')); + $payinfo2 = "$1.$payinfo2"; + } $payinfo = $payinfo1. '@'. $payinfo2; } -- 2.11.0