integrate new echeck fields into freeside backend payment processing
authorjeff <jeff>
Fri, 6 Apr 2007 23:57:35 +0000 (23:57 +0000)
committerjeff <jeff>
Fri, 6 Apr 2007 23:57:35 +0000 (23:57 +0000)
FS/FS/cust_main.pm
httemplate/misc/payment.cgi
httemplate/misc/process/payment.cgi

index e834d59..1224c88 100644 (file)
@@ -70,7 +70,7 @@ $skip_fuzzyfiles = 0;
 $ignore_expired_card = 0;
 
 @encrypted_fields = ('payinfo', 'paycvv');
-@paytypes = ('Personal checking', 'Personal savings', 'Business checking', 'Business savings');
+@paytypes = ('', 'Personal checking', 'Personal savings', 'Business checking', 'Business savings');
 
 #ask FS::UID to run this stuff for us later
 #$FS::UID::callback{'FS::cust_main'} = sub { 
@@ -2612,9 +2612,12 @@ sub realtime_bop {
     ( $content{account_number}, $content{routing_code} ) =
       split('@', $payinfo);
     $content{bank_name} = $o_payname;
-    $content{account_type} = 'CHECKING';
+    $content{bank_state} = $self->getfield('paystate');
+    $content{account_type} = uc($self->getfield('paytype')) || 'CHECKING';
     $content{account_name} = $payname;
     $content{customer_org} = $self->company ? 'B' : 'I';
+    $content{state_id}       = $self->getfield('stateid');
+    $content{state_id_state} = $self->getfield('stateid_state');
     $content{customer_ssn} = exists($options{'ss'})
                                ? $options{'ss'}
                                : $self->ss;
index 728eba7..1008a21 100644 (file)
@@ -151,13 +151,19 @@ function OLiframeContent(src, width, height, name) {
     </TD>
   </TR>
 % } elsif ( $payby eq 'CHEK' ) {
-%     my( $payinfo1, $payinfo2, $payname, $ss ) = ( '', '', '', '' );
+%     my( $payinfo1, $payinfo2, $payname, $ss, $paytype, $paystate,
+%         $stateid, $stateid_state )
+%       = ( '', '', '', '', '', '', '', '' );
 %     if ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) {
 %       $cust_main->paymask =~ /^([\dx]+)\@([\dx]+)$/i
 %         or die "unparsable payinfo ". $cust_main->payinfo;
 %       ($payinfo1, $payinfo2) = ($1, $2);
 %       $payname = $cust_main->payname;
 %       $ss = $cust_main->ss;
+%       $paytype = $cust_main->getfield('paytype');
+%       $paystate = $cust_main->getfield('paystate');
+%       $stateid = $cust_main->getfield('stateid');
+%       $stateid_state = $cust_main->getfield('stateid_state');
 %     }
 %
 
@@ -166,6 +172,8 @@ function OLiframeContent(src, width, height, name) {
   <TR>
     <TD ALIGN="right">Account&nbsp;number</TD>
     <TD><INPUT TYPE="text" SIZE=10 NAME="payinfo1" VALUE="<%$payinfo1%>"></TD>
+    <TD ALIGN="right">Type</TD>
+    <TD><SELECT NAME="paytype"><% join('', map { qq!<OPTION VALUE="$_" !.($paytype eq $_ ? 'SELECTED' : '').">$_</OPTION>" } @FS::cust_main::paytypes) %></SELECT></TD>
   </TR>
   <TR>
     <TD ALIGN="right">ABA/Routing&nbsp;number</TD>
@@ -179,12 +187,35 @@ function OLiframeContent(src, width, height, name) {
     <TD><INPUT TYPE="text" NAME="payname" VALUE="<%$payname%>"></TD>
   </TR>
   <TR>
+    <TD ALIGN="right">Bank&nbsp;state</TD>
+    <TD><% include('../edit/cust_main/select-state.html', #meh 
+                   'empty'   => '(choose)',
+                   'state'   => $paystate,
+                   'country' => $cust_main->country,
+                   'prefix'  => 'pay',
+                  ) %></TD>
+  </TR>
+  <TR>
     <TD ALIGN="right">
       Account&nbsp;holder<BR>
       Social&nbsp;security&nbsp;or&nbsp;tax&nbsp;ID&nbsp;#
     </TD>
     <TD><INPUT TYPE="text" NAME="ss" VALUE="<%$ss%>"></TD>
   </TR>
+  <TR>
+    <TD ALIGN="right">
+      Account&nbsp;holder<BR>
+      Driver&rsquo;s&nbsp;license&nbsp;or&nbsp;state&nbsp;ID&nbsp;#
+    </TD>
+    <TD><INPUT TYPE="text" NAME="stateid" VALUE="<%$stateid%>"></TD>
+    <TD ALIGN="right">State</TD>
+    <TD><% include('../edit/cust_main/select-state.html', #meh 
+                   'empty'   => '(choose)',
+                   'state'   => $stateid_state,
+                   'country' => $cust_main->country,
+                   'prefix'  => 'stateid_',
+                  ) %></TD>
+  </TR>
 % } 
 
 
index a5f4d42..8878f52 100644 (file)
@@ -26,7 +26,7 @@
 %my $payby = $1;
 %my %payby2fields = (
 %  'CARD' => [ qw( address1 address2 city state zip ) ],
-%  'CHEK' => [ qw( ss ) ],
+%  'CHEK' => [ qw( ss paytype paystate stateid stateid_state ) ],
 %);
 %my %type = ( 'CARD' => 'credit card',
 %             'CHEK' => 'electronic check (ACH)',