X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=fs_selfservice%2FFS-SelfService%2Fcgi%2Fsignup.cgi;h=acd7a62db9424873654fb6bca6dc75f9fb3dbb5b;hb=a07ca8e4ca980b88a4d6a8f85b4f72c459599e0a;hp=20016140469f4835e64304ae4e2704cf041a0525;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984;p=freeside.git diff --git a/fs_selfservice/FS-SelfService/cgi/signup.cgi b/fs_selfservice/FS-SelfService/cgi/signup.cgi index 200161404..acd7a62db 100755 --- a/fs_selfservice/FS-SelfService/cgi/signup.cgi +++ b/fs_selfservice/FS-SelfService/cgi/signup.cgi @@ -201,13 +201,18 @@ if ( $magic eq 'process' || $action eq 'process_signup' ) { my $payinfo = $cgi->param('payinfo'); $payinfo =~ s/\D//g; - $payinfo =~ /^(\d{13,16})$/ + $payinfo =~ /^(\d{13,16}|\d{8,9})$/ or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo; $payinfo = $1; validate($payinfo) 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)) { @@ -229,8 +234,9 @@ if ( $magic eq 'process' || $action eq 'process_signup' ) { payby payinfo paycvv paydate payname paystate paytype invoicing_list referral_custnum promo_code reg_code + override_ban_warn pkgpart refnum agentnum - username sec_phrase _password popnum + username sec_phrase _password popnum domsvc mac_addr countrycode phonenum sip_password pin prepaid_shortform ), @@ -249,10 +255,19 @@ if ( $magic eq 'process' || $action eq 'process_signup' ) { qw( popup_url reference amount ); print_collect($rv); } elsif ( $error ) { + #fudge the snarf info no strict 'refs'; ${$_} = $cgi->param($_) foreach grep { /^snarf_/ } $cgi->param; + + 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; + } + print_form(); + } else { print_okay( 'pkgpart' => scalar($cgi->param('pkgpart')), @@ -277,7 +292,7 @@ if ( $magic eq 'process' || $action eq 'process_signup' ) { sub print_form { - $error = "Error: $error" if $error; + $error = "Error: $error" if $error && $error !~ /^Warning:/i; my $r = { $cgi->Vars, @@ -490,5 +505,7 @@ END package FS::SelfService::_signupcgi; use HTML::Entities; -use FS::SelfService qw(regionselector expselect popselector didselector); +use FS::SelfService qw( regionselector expselect popselector domainselector + didselector + );