[freeside-commits] branch FREESIDE_3_BRANCH updated. a39cce659ce5811bc6d061c6db7e16ac1bcc4c45

Ivan Kohler ivan at freeside.biz
Tue Jul 18 12:05:37 PDT 2023


The branch, FREESIDE_3_BRANCH has been updated
       via  a39cce659ce5811bc6d061c6db7e16ac1bcc4c45 (commit)
      from  06c319d7acbb4d469c985a83965f340d7435da65 (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 a39cce659ce5811bc6d061c6db7e16ac1bcc4c45
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Jul 18 12:05:33 2023 -0700

    v3: prevent CARD/CHEK customers from inadvertantly going off auto-pay making an early manual payment, RT#87429

diff --git a/fs_selfservice/FS-SelfService/cgi/make_ach_payment.html b/fs_selfservice/FS-SelfService/cgi/make_ach_payment.html
index 1183b2ba0..8b5908ef0 100644
--- a/fs_selfservice/FS-SelfService/cgi/make_ach_payment.html
+++ b/fs_selfservice/FS-SelfService/cgi/make_ach_payment.html
@@ -35,11 +35,42 @@ EOF
       $OUT .= '<TR><TD COLSPAN=2><INPUT TYPE="hidden" NAME="auto" VALUE="1"></TD></TR>';
     }
   } else {
-    $OUT .= '<TR><TD COLSPAN=2><INPUT TYPE="checkbox"' . ($save_unchecked ? '' : 'CHECKED ') . 'NAME="save" VALUE="1">';
-    $OUT .= 'Remember this information</TD></TR>';
-    $OUT .= '<TR><TD COLSPAN=2><INPUT TYPE="checkbox"' . ($payby eq 'CHEK' ? ' CHECKED' : '') . 'NAME="auto" VALUE="1"  onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }">';
-    $OUT .= 'Charge future payments to this account automatically</TD></TR>';
+
+    my $save_ck = $save_unchecked  ? ''         : 'CHECKED';
+    my $auto_ck = $payby eq 'CHEK' ? ' CHECKED' : '';
+
+    if ( $payby eq 'CHEK' && ! $save_unchecked ) {
+
+      $OUT .=<<EOF;
+        <TR>
+          <TD COLSPAN=8>
+            <INPUT TYPE="checkbox" $save_ck NAME="save" VALUE="1" STYLE="display:none">
+            <INPUT TYPE="checkbox" $auto_ck NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; } else { document.OneTrueForm.save.checked=false; }">
+            Remember this information, and charge future payments to this account automatically
+          </TD>
+        </TR>
+EOF
+
+    } else {
+
+      $OUT .=<<EOF;
+        <TR>
+          <TD COLSPAN=8>
+            <INPUT TYPE="checkbox" $save_ck NAME="save" VALUE="1">
+            Remember this information
+          </TD>
+        </TR><TR>
+          <TD COLSPAN=8>
+            <INPUT TYPE="checkbox" $auto_ck NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }">
+            Charge future payments to this account automatically
+          </TD>
+        </TR>
+EOF
+
+    }
+
   }
+
 %>
 
 </TABLE>
diff --git a/fs_selfservice/FS-SelfService/cgi/make_payment.html b/fs_selfservice/FS-SelfService/cgi/make_payment.html
index 503901edd..b14c901fd 100644
--- a/fs_selfservice/FS-SelfService/cgi/make_payment.html
+++ b/fs_selfservice/FS-SelfService/cgi/make_payment.html
@@ -35,17 +35,43 @@ EOF
   </TD>
 </TR>
 <%= include('card') %>
-<TR>
-  <TD COLSPAN=8>
-    <INPUT TYPE="checkbox" <%= $save_unchecked ? '' : 'CHECKED' %> NAME="save" VALUE="1">
-    Remember this card and billing address
-  </TD>
-</TR><TR>
-  <TD COLSPAN=8>
-    <INPUT TYPE="checkbox"<%= $payby eq 'CARD' ? ' CHECKED' : '' %> NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }">
-    Charge future payments to this card automatically
-  </TD>
-</TR>
+
+<%=
+
+my $save_ck = $save_unchecked  ? ''         : 'CHECKED';
+my $auto_ck = $payby eq 'CARD' ? ' CHECKED' : '';
+
+if ( $payby eq 'CARD' && ! $save_unchecked ) {
+
+  $OUT .=<<EOF;
+    <TR>
+      <TD COLSPAN=8>
+        <INPUT TYPE="checkbox" $save_ck NAME="save" VALUE="1" STYLE="display:none">
+        <INPUT TYPE="checkbox" $auto_ck NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; } else { document.OneTrueForm.save.checked=false; }">
+        Remember this card and billing address, and charge future payments to this card automatically
+      </TD>
+    </TR>
+EOF
+
+} else {
+
+  $OUT .=<<EOF;
+    <TR>
+      <TD COLSPAN=8>
+        <INPUT TYPE="checkbox" $save_ck NAME="save" VALUE="1">
+        Remember this card and billing address
+      </TD>
+    </TR><TR>
+      <TD COLSPAN=8>
+        <INPUT TYPE="checkbox" $auto_ck NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }">
+        Charge future payments to this card automatically
+      </TD>
+    </TR>
+EOF
+
+}
+%>
+
 </TABLE>
 <BR>
 <INPUT TYPE="hidden" NAME="payunique" VALUE="<%=$payunique%>">

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

Summary of changes:
 .../FS-SelfService/cgi/make_ach_payment.html       | 39 ++++++++++++++++--
 .../FS-SelfService/cgi/make_payment.html           | 48 +++++++++++++++++-----
 2 files changed, 72 insertions(+), 15 deletions(-)




More information about the freeside-commits mailing list