[freeside-commits] branch FREESIDE_3_BRANCH updated. c4257ec0783ad40d697c22590f804e7d8ce063cd

Christopher Burger burgerc at freeside.biz
Tue Oct 23 15:18:41 PDT 2018


The branch, FREESIDE_3_BRANCH has been updated
       via  c4257ec0783ad40d697c22590f804e7d8ce063cd (commit)
      from  d5357a8ed89d3bfb9f861cd073a472a88768f9a1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c4257ec0783ad40d697c22590f804e7d8ce063cd
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Tue Oct 23 18:17:41 2018 -0400

    RT# 74537 - fixed V3 error with making ACH payment with ACH-readonly config set

diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index ba698bd8e..9e1a4adc4 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -1016,9 +1016,6 @@ sub validate_payment {
     my $payinfo2 = $1;
     $payinfo = $payinfo1. '@'. $payinfo2;
 
-    $payinfo = $cust_main->payinfo
-      if $cust_main->paymask eq $payinfo;
-
     my $achonfile = 0;
       if ( $cust_main->paymask eq $payinfo ) {
         $payinfo = $cust_main->payinfo;
@@ -1655,128 +1652,6 @@ sub payment_receipt {
          };
 }
 
-sub list_payby {
-  my $p = shift;
-
-  my($context, $session, $custnum) = _custoragent_session_custnum($p);
-  return { 'error' => $session } if $context eq 'error';
-
-  my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
-    or return { 'error' => "unknown custnum $custnum" };
-
-  return {
-    'payby' => [ map {
-                       my $cust_payby = $_;
-                       +{
-                          map { $_ => $cust_payby->$_ }
-                            qw( custpaybynum weight payby paymask paydate
-                                payname paystate paytype
-                              )
-                        };
-                     }
-                   $cust_main->cust_payby
-               ],
-  };
-}
-
-sub insert_payby {
-  my $p = shift;
-
-  my($context, $session, $custnum) = _custoragent_session_custnum($p);
-  return { 'error' => $session } if $context eq 'error';
-
-  #XXX payinfo1 + payinfo2 for CHEK?
-  #or take the opportunity to use separate, more well- named fields?
-  # my $payinfo;
-  # $p->{'payinfo1'} =~ /^([\dx]+)$/
-  #   or return { 'error' => "illegal account number ". $p->{'payinfo1'} };
-  # my $payinfo1 = $1;
-  #  $p->{'payinfo2'} =~ /^([\dx\.]+)$/ # . turned on by echeck-country CA ?
-  #   or return { 'error' => "illegal ABA/routing number ". $p->{'payinfo2'} };
-  # my $payinfo2 = $1;
-  # $payinfo = $payinfo1. '@'. $payinfo2;
-
-  my $cust_payby = new FS::cust_payby {
-    'custnum' => $custnum,
-    map { $_ => $p->{$_} } qw( weight payby payinfo paycvv paydate payname
-                               paystate paytype payip 
-                             ),
-  };
-
-  my $error = $cust_payby->insert;
-  if ( $error ) {
-    return { 'error' => $error };
-  } else {
-    return { 'custpaybynum' => $cust_payby->custpaybynum };
-  }
-  
-}
-
-sub update_payby {
-  my $p = shift;
-
-  my($context, $session, $custnum) = _custoragent_session_custnum($p);
-  return { 'error' => $session } if $context eq 'error';
-
-  my $cust_payby = qsearchs('cust_payby', {
-                              'custnum'      => $custnum,
-                              'custpaybynum' => $p->{'custpaybynum'},
-                           })
-    or return { 'error' => 'unknown custpaybynum '. $p->{'custpaybynum'} };
-
-  foreach my $field (
-    qw( weight payby payinfo paycvv paydate payname paystate paytype payip )
-  ) {
-    next unless exists($p->{$field});
-    $cust_payby->set($field,$p->{$field});
-  }
-
-  my $error = $cust_payby->replace;
-  if ( $error ) {
-    return { 'error' => $error };
-  } else {
-    return { 'custpaybynum' => $cust_payby->custpaybynum };
-  }
-  
-}
-
-sub verify_payby {
-  my $p = shift;
-
-  my($context, $session, $custnum) = _custoragent_session_custnum($p);
-  return { 'error' => $session } if $context eq 'error';
-
-  my $cust_payby = qsearchs('cust_payby', {
-                              'custnum'      => $custnum,
-                              'custpaybynum' => $p->{'custpaybynum'},
-                           })
-    or return { 'error' => 'unknown custpaybynum '. $p->{'custpaybynum'} };
-
-  return { 'error' => $cust_payby->verify };
-  
-}
-
-sub delete_payby {
-  my $p = shift;
-
-  my($context, $session, $custnum) = _custoragent_session_custnum($p);
-  return { 'error' => $session } if $context eq 'error';
-
-  my $cust_payby = qsearchs('cust_payby', {
-                              'custnum'      => $custnum,
-                              'custpaybynum' => $p->{'custpaybynum'},
-                           })
-    or return { 'error' => 'unknown custpaybynum '. $p->{'custpaybynum'} };
-
-  my $conf = new FS::Conf;
-  if (($cust_payby->payby eq "DCHK" || $cust_payby->payby eq "CHEK") && $conf->exists('selfservice-ACH_info_readonly')) {
-    return { 'error' => "Sorry you do not have permission to delete bank information." };
-  }
-  else {
-    return { 'error' => $cust_payby->delete };
-  }
-}
-
 sub cancel {
   my $p = shift;
   my $session = _cache->get($p->{'session_id'})

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/ClientAPI/MyAccount.pm | 125 -------------------------------------------
 1 file changed, 125 deletions(-)




More information about the freeside-commits mailing list