summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2017-08-03 11:51:27 -0400
committerChristopher Burger <burgerc@freeside.biz>2017-08-03 11:51:27 -0400
commit639929eeb498d7f893e09084b72bccbaf91bf894 (patch)
treef93316386a92306750bb3511c8efd28e8819428f
parentf3ebd0e062e9e04888b950cd8ad17637fe20566d (diff)
RT# 74537 - updated to use only one payment account from cust_main
-rw-r--r--FS/FS/ClientAPI/MyAccount.pm9
-rw-r--r--fs_selfservice/FS-SelfService/cgi/process_change_pay.html11
2 files changed, 13 insertions, 7 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index a38bcd661..d604491af 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -723,7 +723,7 @@ sub edit_info {
or return { 'error' => "unknown custnum $custnum" };
my $conf = new FS::Conf;
- if (($p->{payby} eq "CHEK" || $p->{payby} eq "DCHEK") && $conf->exists('selfservice-ACH_info_readonly')) {
+ if (($p->{payby} eq "CHEK" || $p->{payby} eq "DCHK") && $conf->exists('selfservice-ACH_info_readonly')) {
return { 'error' => "You do not have authority to add a bank account" };
}
@@ -1016,13 +1016,10 @@ sub validate_payment {
if $cust_main->paymask eq $payinfo;
my $achonfile = 0;
- foreach my $cust_payby ($cust_main->cust_payby('CHEK','DCHK')) {
- if ( $cust_payby->paymask eq $payinfo ) {
- $payinfo = $cust_payby->payinfo;
+ if ( $cust_main->paymask eq $payinfo ) {
+ $payinfo = $cust_main->payinfo;
$achonfile = 1;
- last;
}
- }
if ($conf->exists('selfservice-ACH_info_readonly') && !$achonfile) {
return { 'error' => "You are not allowed to change your payment information." };
diff --git a/fs_selfservice/FS-SelfService/cgi/process_change_pay.html b/fs_selfservice/FS-SelfService/cgi/process_change_pay.html
index 8fb33b299..11fda9043 100644
--- a/fs_selfservice/FS-SelfService/cgi/process_change_pay.html
+++ b/fs_selfservice/FS-SelfService/cgi/process_change_pay.html
@@ -1,3 +1,12 @@
<%= include('header', 'Information updated successfully' ) %>
-<FONT SIZE=4>Information updated successfully.</FONT>
+
+<%=
+ if ($error) {
+ $OUT = $error;
+ }
+ else {
+ $OUT = '<FONT SIZE=4>Information updated successfully.</FONT>';
+ }
+ %>
+
<%= include('footer') %>