RT# 76905 - Created ability to delete payment account thru NG selfservice to test...
[freeside.git] / FS / FS / ClientAPI / MyAccount.pm
index 2b4d52d..99c5f74 100644 (file)
@@ -152,6 +152,7 @@ sub skin_info {
 
                  personal.php Profile
                  personal.php Personal Information
+                 payment_accounts.php Payment Accounts
                  password.php Change Password
 
                  payment.php Payments
@@ -1748,8 +1749,13 @@ sub delete_payby {
                            })
     or return { 'error' => 'unknown custpaybynum '. $p->{'custpaybynum'} };
 
-  return { 'error' => $cust_payby->delete };
-
+  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 {