diff options
Diffstat (limited to 'fs_selfservice/FS-SelfService/cgi/selfservice.cgi')
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/selfservice.cgi | 79 |
1 files changed, 2 insertions, 77 deletions
diff --git a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi index 6d6716ddc..9b8bdc100 100644 --- a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi +++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi @@ -6,8 +6,7 @@ use subs qw(do_template); use CGI; use CGI::Carp qw(fatalsToBrowser); use Text::Template; -use FS::SelfService qw( login customer_info invoice payment_info - process_payment ); +use FS::SelfService qw(login customer_info invoice); $template_dir = '.'; @@ -54,8 +53,7 @@ if ( $cgi->param('session') eq 'login' ) { $session_id = $cgi->param('session'); -$cgi->param('action') =~ - /^(myaccount|view_invoice|make_payment|payment_results)$/ +$cgi->param('action') =~ /^(myaccount|view_invoice|make_payment)$/ or die "unknown action ". $cgi->param('action'); my $action = $1; @@ -70,7 +68,6 @@ if ( $result->{error} eq "Can't resume session" ) { #ick #warn $result->{'open_invoices'}; #warn scalar(@{$result->{'open_invoices'}}); -warn "processing template $action\n"; do_template($action, { 'session_id' => $session_id, %{$result} @@ -92,78 +89,6 @@ sub view_invoice { } sub make_payment { - payment_info( 'session_id' => $session_id ); -} - -sub payment_results { - - use Business::CreditCard; - - $cgi->param('amount') =~ /^\s*(\d+(\.\d{2})?)\s*$/ - or die "illegal amount"; #!!! - my $amount = $1; - - my $payinfo = $cgi->param('payinfo'); - $payinfo =~ s/\D//g; - $payinfo =~ /^(\d{13,16})$/ - #or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo; - or die "illegal card"; #!!! - $payinfo = $1; - validate($payinfo) - #or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo; - or die "invalid card"; #!!! - cardtype($payinfo) eq $cgi->param('card_type') - #or $error ||= $init_data->{msgcat}{not_a}. $cgi->param('CARD_type'); - or die "not a ". $cgi->param('card_type'); - - $cgi->param('month') =~ /^(\d{2})$/ or die "illegal month"; - my $month = $1; - $cgi->param('year') =~ /^(\d{4})$/ or die "illegal year"; - my $year = $1; - - $cgi->param('payname') =~ /^(.{0,80})$/ or die "illegal payname"; - my $payname = $1; - - $cgi->param('address1') =~ /^(.{0,80})$/ or die "illegal address1"; - my $address1 = $1; - - $cgi->param('address2') =~ /^(.{0,80})$/ or die "illegal address2"; - my $address2 = $1; - - $cgi->param('city') =~ /^(.{0,80})$/ or die "illegal city"; - my $city = $1; - - $cgi->param('state') =~ /^(.{2})$/ or die "illegal state"; - my $state = $1; - - $cgi->param('zip') =~ /^(.{0,10})$/ or die "illegal zip"; - my $zip = $1; - - my $save = 0; - $save = 1 if $cgi->param('save'); - - my $auto = 0; - $auto = 1 if $cgi->param('auto'); - - $cgi->param('paybatch') =~ /^([\w\-\.]+)$/ or die "illegal paybatch"; - my $paybatch = $1; - - process_payment( - 'session_id' => $session_id, - 'amount' => $amount, - 'payinfo' => $payinfo, - 'month' => $month, - 'year' => $year, - 'payname' => $payname, - 'address1' => $address1, - 'address2' => $address2, - 'city' => $city, - 'state' => $state, - 'zip' => $zip, - 'save' => $save, - 'auto' => $auto, - 'paybatch' => $paybatch, - ); } |