From eb8fe191d66b2b6bf7e113049047968c8147fb66 Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Mon, 10 Jul 2017 09:52:54 -0400 Subject: [PATCH] RT# 74537 - Added new selfservice config option to make ECHECK readonly on selfservice, updated selfservice and NGselfservice to look for this option --- FS/FS/ClientAPI/MyAccount.pm | 1 + FS/FS/Conf.pm | 7 ++ fs_selfservice/FS-SelfService/cgi/change_pay.html | 8 ++ fs_selfservice/FS-SelfService/cgi/check.html | 103 +++++++++++++++------ .../FS-SelfService/cgi/make_ach_payment.html | 28 +++--- ng_selfservice/elements/check.php | 94 +++++++++++++------ ng_selfservice/payment_ach.php | 10 +- 7 files changed, 180 insertions(+), 71 deletions(-) diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 505111e1a..49e61ab7b 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -840,6 +840,7 @@ sub payment_info { 'show_paystate' => $conf->exists('show_bankstate'), 'save_unchecked' => $conf->exists('selfservice-save_unchecked'), + 'ach_read_only' => $conf->exists('selfservice-ACH_info_readonly'), }; diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 086448cff..d41cc741b 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -5773,6 +5773,13 @@ and customer address. Include units.', }, { + 'key' => 'selfservice-ACH_info_readonly', + 'section' => 'self-service', + 'description' => 'make ACH on self service portal read only', + 'type' => 'checkbox', + }, + + { 'key' => 'selfservice-announcement', 'section' => 'self-service', 'description' => 'HTML announcement to display to all authenticated users on account overview page', diff --git a/fs_selfservice/FS-SelfService/cgi/change_pay.html b/fs_selfservice/FS-SelfService/cgi/change_pay.html index 6898dc7f8..e38ba762d 100644 --- a/fs_selfservice/FS-SelfService/cgi/change_pay.html +++ b/fs_selfservice/FS-SelfService/cgi/change_pay.html @@ -37,6 +37,11 @@ 'PREP' => qq/Prepaid Card/, 'PREPAY' => qq/Prepaid Card/, ); + + ## Don't show CHEK or DCHK option if ACH is read only + delete( $payby_index{'CHEK'} ) unless !$ach_read_only; + delete( $payby_index{'DCHK'} ) unless !$ach_read_only; + tie my %options, 'Tie::IxHash', (); foreach my $payby_option ( grep { exists( $payby_index{$_} ) } @paybys ) { $options{$payby_option} = $payby_index{$payby_option}; @@ -55,6 +60,9 @@ delete $options{'DCRD'} unless $payby eq 'DCRD' || ! exists $options{'CARD'}; delete $options{'DCHK'} unless $payby eq 'DCHK' || ! exists $options{'CHEK'}; + ## setting payby to default to layer if only one. should we always display first layer? + if (keys %options == 1) { @p = keys %options; $payby = $p[0]; } + HTML::Widgets::SelectLayers->new( options => \%options, selected_layer => $payby, diff --git a/fs_selfservice/FS-SelfService/cgi/check.html b/fs_selfservice/FS-SelfService/cgi/check.html index 68753fe08..17635c306 100644 --- a/fs_selfservice/FS-SelfService/cgi/check.html +++ b/fs_selfservice/FS-SelfService/cgi/check.html @@ -1,54 +1,97 @@ Account type - - + > + <%= + if ($ach_read_only) { + $OUT = $paytype . ''; + } else { + $OUT .= ''; + } + %> - + Account number - - + > + <%= if ($ach_read_only) { + $OUT = qq! $payinfo1 !; + } else { + $OUT = qq! !; + } + %> + + ABA/Routing number - + > + <%= + if ($ach_read_only) { + $OUT = qq! $payinfo2 !; + } else { + $OUT = qq! !; + } + %> + Bank name - - + > + <%= + if ($ach_read_only) { + $OUT = qq! $payname !; + } else { + $OUT = qq! !; + } + %> + + <%= $OUT = ''; if ($show_paystate) { - $OUT .= qq!Bank state !; + } else { + $OUT .= ''; } - $OUT .= ''; + $OUT .= ''; } %> <%= $OUT = ''; if ($show_ss) { - $OUT .= 'Account holder
Social '; - $OUT .= 'security or tax ID #'; - $OUT .= qq!!; - $OUT .= ''; + $OUT .= 'Account holder
Social '; + $OUT .= 'security or tax ID #'; + if ($ach_read_only) { + $OUT .= qq! $ss !; + } else { + $OUT .= qq!!; + } + $OUT .= ''; } %> <%= $OUT = ''; if ($show_stateid) { - $OUT .= ''; - $OUT .= qq!Account holder
$stateid_label!; - $OUT .= qq!!; - $OUT .= qq!$stateid_state_label!; - $OUT .= '!; + } else { + $OUT .= qq!!; + $OUT .= qq!$stateid_state_label!; + $OUT .= ''; } - $OUT .=''; + $OUT .=''; } %> - diff --git a/fs_selfservice/FS-SelfService/cgi/make_ach_payment.html b/fs_selfservice/FS-SelfService/cgi/make_ach_payment.html index 8c2dfe305..37fd46435 100644 --- a/fs_selfservice/FS-SelfService/cgi/make_ach_payment.html +++ b/fs_selfservice/FS-SelfService/cgi/make_ach_payment.html @@ -20,24 +20,28 @@ EOF Payment amount - <%= include('discount_term') %> <%= include('check') %> - - - - - + +<%= + $OUT = ''; + if ($ach_read_only) { + if ($payby == 'CHEK') { + $OUT .= ''; + } + } else { + $OUT .= ''; + $OUT .= ''; + } +%> +
+
<%= $money_char %>
- NAME="save" VALUE="1"> - Remember this information -
- NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }"> - Charge future payments to this account automatically -
'; + $OUT .= 'Remember this information
'; + $OUT .= 'Charge future payments to this account automatically

diff --git a/ng_selfservice/elements/check.php b/ng_selfservice/elements/check.php index b026c92e4..fd0cd6d91 100644 --- a/ng_selfservice/elements/check.php +++ b/ng_selfservice/elements/check.php @@ -1,50 +1,88 @@ + Account type - - + + + + Account number - - + > + + + + + + + ABA/Routing number - + > + + + + + Bank name - + > + + + + + - Bank state - - - - + + Bank state + > + + + + + + - Account holder
Social security or tax ID # - - + + Account holder
Social security or tax ID # + > + + + + + + - - Account holder
- - - + > + + + + + - + - diff --git a/ng_selfservice/payment_ach.php b/ng_selfservice/payment_ach.php index ecbd9c749..a3dce76c4 100644 --- a/ng_selfservice/payment_ach.php +++ b/ng_selfservice/payment_ach.php @@ -54,7 +54,7 @@ if ( $receipt_html ) { ?> $error = $payment_error; - ?> +?> @@ -82,6 +82,12 @@ if ( $receipt_html ) { ?> + + + + + + NAME="save" VALUE="1"> @@ -93,6 +99,8 @@ if ( $receipt_html ) { ?> Charge future payments to this account automatically + +
-- 2.11.0