self-service: make payment UI done
[freeside.git] / fs_selfservice / FS-SelfService / cgi / selfservice.cgi
index eae3739..7b392bc 100644 (file)
@@ -6,7 +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);
+use FS::SelfService qw(login customer_info invoice payment_info);
 
 $template_dir = '.';
 
@@ -53,7 +53,7 @@ if ( $cgi->param('session') eq 'login' ) {
 
 $session_id = $cgi->param('session');
 
-$cgi->param('action') =~ /^(myaccount|view_invoice)$/
+$cgi->param('action') =~ /^(myaccount|view_invoice|make_payment)$/
   or die "unknown action ". $cgi->param('action');
 my $action = $1;
 
@@ -68,6 +68,7 @@ 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}
@@ -88,6 +89,10 @@ sub view_invoice {
 
 }
 
+sub make_payment {
+  payment_info( 'session_id' => $session_id );
+}
+
 #--
 
 sub do_template {
@@ -95,7 +100,7 @@ sub do_template {
   my $fill_in = shift;
 
   $cgi->delete_all();
-  $fill_in->{'self_url'} = $cgi->self_url;
+  $fill_in->{'selfurl'} = $cgi->self_url;
 
   my $template = new Text::Template( TYPE    => 'FILE',
                                      SOURCE  => "$template_dir/$name.html",