X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FSignup.pm;h=595f4fb405031a8e511c03391a8b353d256343a6;hb=0e7c29b192fff137d3b9167b29633a94f94b995f;hp=b18f21f748538d366034b097cd94c2e2f47b194b;hpb=c01c619fdcbcf29ed6ce045e03c0be5d13fd836c;p=freeside.git diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm index b18f21f74..595f4fb40 100644 --- a/FS/FS/ClientAPI/Signup.pm +++ b/FS/FS/ClientAPI/Signup.pm @@ -22,6 +22,7 @@ use FS::acct_snarf; use FS::queue; use FS::reg_code; use FS::payby; +use FS::banned_pay; $DEBUG = 0; $me = '[FS::ClientAPI::Signup]'; @@ -562,6 +563,7 @@ sub new_customer { payinfo paycvv paydate payname paystate paytype paystart_month paystart_year payissue payip + override_ban_warn referral_custnum comments ) @@ -807,6 +809,18 @@ sub new_customer { $error = $placeholder->delete; return { 'error' => $error } if $error; + if ( $conf->exists('signup-duplicate_cc-warn_hours') ) { + my $hours = $conf->config('signup-duplicate_cc-warn_hours'); + my $ban = new FS::banned_pay $cust_main->_new_banned_pay_hashref; + $ban->end_date( int( time + $hours*3600 ) ); + $ban->bantype('warn'); + $ban->reason('signup-duplicate_cc-warn_hours'); + $error = $ban->insert; + warn "WARNING: error inserting temporary banned_pay for ". + " signup-duplicate_cc-warn_hours (proceeding anyway): $error" + if $error; + } + my %return = ( 'error' => '', 'signup_service' => $svc_x, 'custnum' => $cust_main->custnum, @@ -904,8 +918,8 @@ sub capture_payment { return { error => '_decline', bill_error => $bill_error }; } - if ($cust_pay_pending->status ne 'pending') { - my $bill_error = "Payment with id $paypendingnum is not pending, but ". + if ($cust_pay_pending->status ne 'thirdparty') { + my $bill_error = "Payment with id $paypendingnum is not thirdparty, but ". $cust_pay_pending->status. "; Transaction aborted."; return { error => '_decline', bill_error => $bill_error }; }