summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2011-07-20 21:16:18 +0000
committerivan <ivan>2011-07-20 21:16:18 +0000
commita1691c2636363e4f46cefe91c8f0f961b698f44c (patch)
tree336999f47dd511aeaff5de8d274c9868a472c71a
parent982ded2d929bdcdfa72efa810273f3bc753bf036 (diff)
better error message for signup duplicate cards, allow editing of those customer records, RT#13744
-rw-r--r--FS/FS/cust_main.pm11
-rwxr-xr-xfs_selfservice/FS-SelfService/cgi/signup.cgi2
2 files changed, 11 insertions, 2 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index a5ee2321e..97b117285 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -1473,6 +1473,11 @@ sub replace {
&& $self->payby =~ /^(CARD|DCRD)$/
&& ( $old->payinfo eq $self->payinfo || $old->paymask eq $self->paymask );
+ local($ignore_banned_card) = 1
+ if ( $old->payby =~ /^(CARD|DCRD)$/ && $self->payby =~ /^(CARD|DCRD)$/
+ || $old->payby =~ /^(CHEK|DCHK)$/ && $self->payby =~ /^(CHEK|DCHK)$/ )
+ && ( $old->payinfo eq $self->payinfo || $old->paymask eq $self->paymask );
+
local $SIG{HUP} = 'IGNORE';
local $SIG{INT} = 'IGNORE';
local $SIG{QUIT} = 'IGNORE';
@@ -1869,7 +1874,11 @@ sub check {
if ( $ban ) {
if ( $ban->bantype eq 'warn' ) {
#or others depending on value of $ban->reason ?
- return '_duplicate_card' unless $self->override_ban_warn;
+ return '_duplicate_card'.
+ ': disabled from'. time2str('%a %h %o at %r', $ban->_date).
+ ' until '. time2str('%a %h %o at %r', $ban->_end_date).
+ ' (ban# '. $ban->bannum. ')'
+ unless $self->override_ban_warn;
} else {
return 'Banned credit card: banned on '.
time2str('%a %h %o at %r', $ban->_date).
diff --git a/fs_selfservice/FS-SelfService/cgi/signup.cgi b/fs_selfservice/FS-SelfService/cgi/signup.cgi
index 5c9d11c01..17255613b 100755
--- a/fs_selfservice/FS-SelfService/cgi/signup.cgi
+++ b/fs_selfservice/FS-SelfService/cgi/signup.cgi
@@ -255,7 +255,7 @@ if ( $magic eq 'process' || $action eq 'process_signup' ) {
no strict 'refs';
${$_} = $cgi->param($_) foreach grep { /^snarf_/ } $cgi->param;
- if ( $error =~ /^_duplicate_(card|ach)$/ ) {
+ if ( $error =~ /^_duplicate_(card|ach)/ ) {
my $what = ($1 eq 'card') ? 'Credit card' : 'Electronic check';
$error = "Warning: $what already used to sign up recently";
$init_data->{'override_ban_warn'} = 1;