[freeside-commits] branch FREESIDE_3_BRANCH updated. bdf9732a992deb1332b3496ba112885806a67798

Ivan ivan at 420.am
Mon Jan 13 21:37:39 PST 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  bdf9732a992deb1332b3496ba112885806a67798 (commit)
      from  1552ee615a8f73ee8a72cc85c6e1a2fcfc601dda (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 bdf9732a992deb1332b3496ba112885806a67798
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Jan 13 21:37:38 2014 -0800

    add option to require cvv for signup, RT#25476

diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm
index 57091c4..c968d3b 100644
--- a/FS/FS/ClientAPI/Signup.pm
+++ b/FS/FS/ClientAPI/Signup.pm
@@ -174,6 +174,7 @@ sub signup_info {
       'card_types'         => card_types(),
       'paytypes'           => [ @FS::cust_main::paytypes ],
       'cvv_enabled'        => 1,
+      'require_cvv'        => $conf->exists('signup-require_cvv'),
       'stateid_enabled'    => $conf->exists('show_stateid'),
       'paystate_enabled'   => $conf->exists('show_bankstate'),
       'ship_enabled'       => 1,
@@ -631,6 +632,11 @@ sub new_customer {
       if $gw && $gw->gateway_namespace eq 'Business::OnlineThirdPartyPayment';
   }
 
+  return { 'error' => "CVV2 is required" }
+    if $cust_main->payby =~ /^(CARD|DCRD)$/
+    && ! $cust_main->paycvv
+    && $conf->exists('signup-require_cvv');
+
   $cust_main->payinfo($cust_main->daytime)
     if $cust_main->payby eq 'LECB' && ! $cust_main->payinfo;
 
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index efe9947..c5bf8e2 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -2662,6 +2662,13 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'signup-require_cvv',
+    'section'     => 'self-service',
+    'description' => 'Require CVV for credit card signup.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'manual_process-pkgpart',
     'section'     => 'billing',
     'description' => 'Package to add to each manual credit card and ACH payment entered by employees from the backend.  Enabling this option may be in violation of your merchant agreement(s), so please check it(/them) carefully before enabling this option.',
diff --git a/fs_selfservice/FS-SelfService/cgi/signup.cgi b/fs_selfservice/FS-SelfService/cgi/signup.cgi
index 88eab5c..acd7a62 100755
--- a/fs_selfservice/FS-SelfService/cgi/signup.cgi
+++ b/fs_selfservice/FS-SelfService/cgi/signup.cgi
@@ -208,6 +208,11 @@ if ( $magic eq 'process' || $action eq 'process_signup' ) {
         or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo;
       cardtype($payinfo) eq $cgi->param('CARD_type')
         or $error ||= $init_data->{msgcat}{not_a}. $cgi->param('CARD_type');
+
+      $error ||= 'CVV2 is required'
+        if ! $cgi->param('paycvv')
+        && $init_data->{require_cvv};
+
     }
 
     if ($init_data->{emailinvoiceonly} && (length $cgi->param('invoicing_list') < 1)) {
diff --git a/fs_selfservice/FS-SelfService/cgi/signup.html b/fs_selfservice/FS-SelfService/cgi/signup.html
index a9b6759..003632a 100755
--- a/fs_selfservice/FS-SelfService/cgi/signup.html
+++ b/fs_selfservice/FS-SelfService/cgi/signup.html
@@ -196,7 +196,8 @@ else {
 
     if ( $cvv_enabled ) {
       foreach my $payby ( grep { exists $payby{$_} } qw(CARD DCRD) ) { #1.4/1.5
-        $payby{$payby} .= qq!<TR><TD ALIGN="right">CVV2 (<A HREF="javascript:myopen('cvv2.html','cvv2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=480,height=288')">help</A>)</TD><TD><INPUT TYPE="text" NAME=${payby}_paycvv VALUE="" SIZE=4 MAXLENGTH=4></TD></TR>!;
+        my $cvv_r = $require_cvv ? '<font color="#ff0000">*</font> ' : '';
+        $payby{$payby} .= qq!<TR><TD ALIGN="right">${cvv_r}CVV2 (<A HREF="javascript:myopen('cvv2.html','cvv2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=480,height=288')">help</A>)</TD><TD><INPUT TYPE="text" NAME=${payby}_paycvv VALUE="" SIZE=4 MAXLENGTH=4></TD></TR>!;
       }
     }
     if ( $paystate_enabled ) {
@@ -226,7 +227,8 @@ else {
 
     if ( $cvv_enabled ) {
       foreach my $payby ( grep { exists $payby{$_} } qw(CARD DCRD) ) { #1.4/1.5
-        $paybychecked{$payby} .= qq!<TR><TD ALIGN="right">CVV2 (<A HREF="javascript:myopen('cvv2.html','cvv2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=480,height=288')">help</A>)</TD><TD><INPUT TYPE="text" NAME=${payby}_paycvv VALUE="$paycvv" SIZE=4 MAXLENGTH=4></TD></TR>!;
+        my $cvv_r = $require_cvv ? '<font color="#ff0000">*</font> ' : '';
+        $paybychecked{$payby} .= qq!<TR><TD ALIGN="right">${cvv_r}CVV2 (<A HREF="javascript:myopen('cvv2.html','cvv2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=480,height=288')">help</A>)</TD><TD><INPUT TYPE="text" NAME=${payby}_paycvv VALUE="$paycvv" SIZE=4 MAXLENGTH=4></TD></TR>!;
       }
     }
     if ( $paystate_enabled ) {

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

Summary of changes:
 FS/FS/ClientAPI/Signup.pm                     |    6 ++++++
 FS/FS/Conf.pm                                 |    7 +++++++
 fs_selfservice/FS-SelfService/cgi/signup.cgi  |    5 +++++
 fs_selfservice/FS-SelfService/cgi/signup.html |    6 ++++--
 4 files changed, 22 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list