[freeside-commits] freeside/httemplate/misc payment.cgi, 1.31.2.4, 1.31.2.5

Ivan,,, ivan at wavetail.420.am
Fri Jan 13 23:05:20 PST 2012


Update of /home/cvs/cvsroot/freeside/httemplate/misc
In directory wavetail.420.am:/tmp/cvs-serv10621/httemplate/misc

Modified Files:
      Tag: FREESIDE_2_3_BRANCH
	payment.cgi 
Log Message:
improve echeck validation for canada, deprecate echeck-nonus and cust_main-require-bank-branch config in favor of echeck-country, RT#15982

Index: payment.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/payment.cgi,v
retrieving revision 1.31.2.4
retrieving revision 1.31.2.5
diff -u -w -d -r1.31.2.4 -r1.31.2.5
--- payment.cgi	7 Dec 2011 05:50:50 -0000	1.31.2.4
+++ payment.cgi	14 Jan 2012 07:05:18 -0000	1.31.2.5
@@ -140,7 +140,7 @@
 %       or die "unparsable payinfo ". $cust_main->payinfo;
 %     ($account, $aba) = ($1, $2);
 %     ($branch,$aba) = split('\.',$aba)
-%       if $conf->exists('cust_main-require-bank-branch');
+%       if $conf->config('echeck-country') eq 'CA';
 %     $payname = $cust_main->payname;
 %     $ss = $cust_main->ss;
 %     $paytype = $cust_main->getfield('paytype');
@@ -148,6 +148,13 @@
 %     $stateid = $cust_main->getfield('stateid');
 %     $stateid_state = $cust_main->getfield('stateid_state');
 %   }
+%
+%  #false laziness w/{edit,view}/cust_main/billing.html
+%  my $routing_label = $conf->config('echeck-country') eq 'US'
+%                        ? 'ABA/Routing number'
+%                        : 'Routing number';
+%  my $routing_size      = $conf->config('echeck-country') eq 'CA' ? 4 : 10;
+%  my $routing_maxlength = $conf->config('echeck-country') eq 'CA' ? 3 : 9;
 
     <INPUT TYPE="hidden" NAME="month" VALUE="12">
     <INPUT TYPE="hidden" NAME="year" VALUE="2037">
@@ -158,17 +165,17 @@
       <TD><SELECT NAME="paytype"><% join('', map { qq!<OPTION VALUE="$_" !.($paytype eq $_ ? 'SELECTED' : '').">$_</OPTION>" } @FS::cust_main::paytypes) %></SELECT></TD>
     </TR>
     <TR>
-      <TD ALIGN="right"><% mt('ABA/Routing number') |h %></TD>
+      <TD ALIGN="right"><% mt($routing_label) |h %></TD>
       <TD>
-        <INPUT TYPE="text" SIZE=10 MAXLENGTH=9 NAME="payinfo2" VALUE="<%$aba%>">
+        <INPUT TYPE="text" SIZE="<% $routing_size %>" MAXLENGTH="<% $routing_maxlength %>" NAME="payinfo2" VALUE="<%$aba%>">
         (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/ach.html', 380, 240, 'ach_popup' ), CAPTION, 'ACH Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;"><% mt('help') |h %></A>)
       </TD>
     </TR>
-%   if ( $conf->exists('cust_main-require-bank-branch') ) {
+%   if ( $conf->config('echeck-country') eq 'CA' ) {
       <TR>
         <TD ALIGN="right"><% mt('Branch number') |h %></TD>
         <TD>
-          <INPUT TYPE="text" NAME="payinfo3" VALUE="<%$branch%>">
+          <INPUT TYPE="text" NAME="payinfo3" VALUE="<%$branch%>" SIZE=6 MAXLENGTH=5>
         </TD>
       </TR>
 %   }



More information about the freeside-commits mailing list