[freeside-commits] branch FREESIDE_3_BRANCH updated. 5405c718b31852df721eb8fd804d3836970f8494
Carl J. Adams-Collier
cjac at 420.am
Mon Oct 6 14:28:37 PDT 2014
The branch, FREESIDE_3_BRANCH has been updated
via 5405c718b31852df721eb8fd804d3836970f8494 (commit)
from 8ec8ca19c8554c06d3bfd33fda4c077b6807697c (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 5405c718b31852df721eb8fd804d3836970f8494
Author: C.J. Adams-Collier <cjac at colliertech.org>
Date: Fri Sep 19 17:00:51 2014 -0700
FS RT #25694 - added two configuration options for requiring CVV data to be entered, one for back office data entry, and one to force re-entry even when CC data is on file
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index b2f38ea..9bc88d7 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -747,6 +747,8 @@ sub edit_info {
$payby = $1;
}
+ my $conf = new FS::Conf;
+
if ( $payby =~ /^(CARD|DCRD)$/ ) {
$new->paydate($p->{'year'}. '-'. $p->{'month'}. '-01');
@@ -759,6 +761,10 @@ sub edit_info {
$new->set( 'payby' => $p->{'auto'} ? 'CARD' : 'DCRD' );
+ if ( $conf->exists('selfservice-onfile_require_cvv') ){
+ return { 'error' => 'CVV2 is required' } unless $p->{'paycvv'};
+ }
+
} elsif ( $payby =~ /^(CHEK|DCHK)$/ ) {
my $payinfo;
@@ -835,8 +841,9 @@ sub payment_info {
'card_types' => card_types(),
- 'withcvv' => $conf->exists('selfservice-require_cvv'), #or enable optional cvv?
- 'require_cvv' => $conf->exists('selfservice-require_cvv'),
+ 'withcvv' => $conf->exists('selfservice-require_cvv'), #or enable optional cvv?
+ 'require_cvv' => $conf->exists('selfservice-require_cvv'),
+ 'onfile_require_cvv' => $conf->exists('selfservice-onfile_require_cvv'),
'paytypes' => [ @FS::cust_main::paytypes ],
@@ -1025,6 +1032,8 @@ sub validate_payment {
or return { 'error' => "CVV2 (CVC2/CID) is three digits." };
$paycvv = $1;
}
+ } elsif ( $conf->exists('selfservice-onfile_require_cvv') ) {
+ return { 'error' => 'CVV2 is required' };
} elsif ( !$onfile && $conf->exists('selfservice-require_cvv') ) {
return { 'error' => 'CVV2 is required' };
}
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index b6fa81d..4c02797 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -2706,6 +2706,20 @@ and customer address. Include units.',
},
{
+ 'key' => 'backoffice-require_cvv',
+ 'section' => 'billing',
+ 'description' => 'Require CVV for manual credit card entry.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'selfservice-onfile_require_cvv',
+ 'section' => 'self-service',
+ 'description' => 'Require CVV for on-file credit card during self-service payments.',
+ 'type' => 'checkbox',
+ },
+
+ {
'key' => 'selfservice-require_cvv',
'section' => 'self-service',
'description' => 'Require CVV for credit card self-service payments, except for cards on-file.',
diff --git a/fs_selfservice/FS-SelfService/cgi/card.html b/fs_selfservice/FS-SelfService/cgi/card.html
index c7db2b3..dfe6371 100644
--- a/fs_selfservice/FS-SelfService/cgi/card.html
+++ b/fs_selfservice/FS-SelfService/cgi/card.html
@@ -26,7 +26,7 @@
</TD>
</TR>
<%=
- if ( $withcvv ) {
+ if ( $withcvv || $require_cvv || $onfile_require_cvv ) {
$OUT .= qq!<TR>!;
$OUT .= qq!<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>!;
$OUT .= qq!<TD><INPUT TYPE="text" NAME="paycvv" VALUE="" SIZE=4 MAXLENGTH=4></TD>!;
diff --git a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
index 2b4bb43..1ec5c0b 100755
--- a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
+++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
@@ -306,6 +306,7 @@ sub process_change_pay {
'error' => '<FONT COLOR="#FF0000">Postal or email required.</FONT>',
};
}
+
_process_change_info( 'change_pay', @list );
}
diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi
index 981614e..27b8186 100644
--- a/httemplate/misc/process/payment.cgi
+++ b/httemplate/misc/process/payment.cgi
@@ -122,6 +122,8 @@ if ( $payby eq 'CHEK' ) {
or errorpage("CVV2 (CVC2/CID) is three digits.");
$paycvv = $1;
}
+ }elsif( $conf->exists('backoffice-require_cvv') ){
+ errorpage("CVV2 is required");
}
}
-----------------------------------------------------------------------
Summary of changes:
FS/FS/ClientAPI/MyAccount.pm | 13 +++++++++++--
FS/FS/Conf.pm | 14 ++++++++++++++
fs_selfservice/FS-SelfService/cgi/card.html | 2 +-
fs_selfservice/FS-SelfService/cgi/selfservice.cgi | 1 +
httemplate/misc/process/payment.cgi | 2 ++
5 files changed, 29 insertions(+), 3 deletions(-)
More information about the freeside-commits
mailing list