diff options
Diffstat (limited to 'fs_selfservice')
| -rwxr-xr-x | fs_selfservice/DEPLOY | 6 | ||||
| -rw-r--r-- | fs_selfservice/FS-SelfService/SelfService.pm | 2 | ||||
| -rw-r--r-- | fs_selfservice/FS-SelfService/cgi/make_payment.html | 109 | ||||
| -rw-r--r-- | fs_selfservice/FS-SelfService/cgi/payment_results.html | 18 | ||||
| -rw-r--r-- | fs_selfservice/FS-SelfService/cgi/selfservice.cgi | 79 | 
5 files changed, 10 insertions, 204 deletions
diff --git a/fs_selfservice/DEPLOY b/fs_selfservice/DEPLOY index 4aef4cfa4..7ab3b2a7a 100755 --- a/fs_selfservice/DEPLOY +++ b/fs_selfservice/DEPLOY @@ -1,12 +1,14 @@  #!/bin/sh -kill `cat /var/run/freeside-selfservice-server.fs_selfservice.pid` -  ( cd ..; make deploy; cd fs_selfservice )  cd FS-SelfService  perl Makefile.PL && make && make install +cd .. +kill `cat /var/run/freeside-selfservice-server.ivan.pid`; sleep 3 +./freeside-selfservice-server ivan localhost +  cp /home/ivan/freeside/fs_selfservice/FS-SelfService/cgi/* /var/www/MyAccount  chown freeside /var/www/MyAccount/selfservice.cgi  chmod 755 /var/www/MyAccount/selfservice.cgi diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm index 7cbf5ecad..1c1aad395 100644 --- a/fs_selfservice/FS-SelfService/SelfService.pm +++ b/fs_selfservice/FS-SelfService/SelfService.pm @@ -26,8 +26,6 @@ $socket .= '.'.$tag if defined $tag && length($tag);    'edit_info'       => 'MyAccount/edit_info',    'invoice'         => 'MyAccount/invoice',    'cancel'          => 'MyAccount/cancel', -  'payment_info'    => 'MyAccount/payment_info', -  'process_payment' => 'MyAccount/process_payment',    'list_pkgs'       => 'MyAccount/list_pkgs',    'order_pkg'       => 'MyAccount/order_pkg',    'cancel_pkg'      => 'MyAccount/cancel_pkg', diff --git a/fs_selfservice/FS-SelfService/cgi/make_payment.html b/fs_selfservice/FS-SelfService/cgi/make_payment.html index 40cd83c6f..a5e24291d 100644 --- a/fs_selfservice/FS-SelfService/cgi/make_payment.html +++ b/fs_selfservice/FS-SelfService/cgi/make_payment.html @@ -6,112 +6,11 @@  <!-- <A HREF="<%= $url %>other">SomethingElse</A><BR> -->  </TD><TD VALIGN="top">  <FONT SIZE=4>Make a payment</FONT><BR><BR> -<FORM NAME="OneTrueForm" METHOD="POST" ACTION="<%=$selfurl%>" onSubmit="document.OneTrueForm.process.disabled=true"> +<FORM METHOD="POST" ACTION="<%=$selfurl%>">  <INPUT TYPE="hidden" NAME="session" VALUE="<%=$session_id%>"> -<INPUT TYPE="hidden" NAME="action" VALUE="payment_results"> -<TABLE BGCOLOR="#cccccc"> -<TR> -  <TD ALIGN="right">Amount Due</TD> -  <TD> -    <TABLE><TR><TD BGCOLOR="#ffffff"> -      $<%=sprintf("%.2f",$balance)%> -    </TD></TR></TABLE> -  </TD> -</TR> -<TR> -  <TD ALIGN="right">Payment amount</TD> -  <TD> -    <TABLE><TR><TD BGCOLOR="#ffffff"> -      $<INPUT TYPE="text" NAME="amount" SIZE=8 VALUE="<%=sprintf("%.2f",$balance)%>"> -    </TD></TR></TABLE> -  </TD> -</TR><TR> -  <TD ALIGN="right">Card type</TD> -  <TD> -    <SELECT NAME="card_type"><OPTION></OPTION> -      <%= foreach ( keys %card_types ) { -            $selected = $card_type eq $card_types{$_} ? ' SELECTED' : ''; -            $OUT .= qq(<OPTION$selected VALUE="). $card_types{$_}. qq(">$_\n); -      } %> -    </SELECT> -  </TD> -</TD><TR> -  <TD ALIGN="right">Card number</TD> -  <TD> -    <TABLE> -      <TR> -        <TD> -          <INPUT TYPE="text" NAME="payinfo" SIZE=20 MAXLENGTH=19 VALUE="<%=$payinfo%>"> </TD> -        <TD>Exp.</TD> -        <TD> -          <SELECT NAME="month"> -            <%= for ( ( map "0$_", 1 .. 9 ), 11, 12 ) { -                  $OUT .= '<OPTION'. ($_ eq $month ? ' SELECTED' : ''). ">$_\n"; -            } %> -          </SELECT> -        </TD> -        <TD> / </TD> -        <TD> -          <SELECT NAME="year"> -            <%= my @a = localtime; for ( $a[5]+1900 .. $a[5]+1915 ) { -                  $OUT .= '<OPTION'. ($_ eq $year ? ' SELECTED' : ''). ">$_\n"; -            } %> -          </SELECT> -        </TD> -      </TR> -    </TABLE> -  </TD> -</TR><TR> -  <TD ALIGN="right">Exact name on card</TD> -  <TD><INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="payname" VALUE="<%=$payname%>"></TD> -</TR><TR> -  <TD ALIGN="right">Card billing address</TD> -  <TD> -    <INPUT TYPE="text" SIZE=40 MAXLENGTH=80 NAME="address1" VALUE="<%=$address1%>"> -  </TD> -</TR><TR> -  <TD ALIGN="right">Address line 2</TD> -  <TD> -    <INPUT TYPE="text" SIZE=40 MAXLENGTH=80 NAME="address2" VALUE="<%=$address2%>"> -  </TD> -</TR><TR> -  <TD ALIGN="right">City</TD> -  <TD> -    <TABLE> -      <TR> -        <TD> -          <INPUT TYPE="text" NAME="city" SIZE="12" MAXLENGTH=80 VALUE="<%=$city%>"> -        </TD> -        <TD>State</TD> -        <TD> -          <SELECT NAME="state"> -            <%= for ( @states ) { -              $OUT .= '<OPTION'. ($_ eq $state ? ' SELECTED' : '' ). ">$_\n"; -            } %> -          </SELECT> -        </TD> -        <TD>Zip</TD> -        <TD> -          <INPUT TYPE="text" NAME="zip" SIZE=11 MAXLENGTH=10 VALUE="<%=$zip%>"> -        </TD> -      </TR> -    </TABLE> -  </TD> -</TR><TR> -  <TD COLSPAN=2> -    <INPUT TYPE="checkbox" CHECKED NAME="save" VALUE="1"> -    Remember this information -  </TD> -</TR><TR> -  <TD COLSPAN=2> -    <INPUT TYPE="checkbox"<%= $payby eq 'CARD' ? ' CHECKED' : '' %> NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }"> -    Charge future payments to this card automatically -  </TD> -</TR> -</TABLE> -<BR> -<INPUT TYPE="hidden" NAME="paybatch" VALUE="<%=$paybatch%>"> -<INPUT TYPE="submit" NAME="process" VALUE="Process payment"> <!-- onClick="this.disabled=true"> --> +<INPUT TYPE="hidden" NAME="action" VALUE="process_payment"> +Amount: <INPUT TYPE="text" VALUE="<%=sprintf("%.2f",$balance)%>"><BR><BR> +<INPUT TYPE="submit" VALUE="Process payment">  </FORM>  </TD></TR></TABLE>  <HR> diff --git a/fs_selfservice/FS-SelfService/cgi/payment_results.html b/fs_selfservice/FS-SelfService/cgi/payment_results.html deleted file mode 100644 index 92c8cf51b..000000000 --- a/fs_selfservice/FS-SelfService/cgi/payment_results.html +++ /dev/null @@ -1,18 +0,0 @@ -<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD> -<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR> -<%= $url = "$selfurl?session=$session_id;action="; ''; %> -<TABLE BORDER=0 CELLPADDING=4><TR><TD VALIGN="top" HEIGHT=384 BGCOLOR="#dddddd"> -<A HREF="<%= $url %>myaccount">MyAccount</A><BR> -<!-- <A HREF="<%= $url %>other">SomethingElse</A><BR> --> -</TD><TD VALIGN="top"> -<FONT SIZE=4>Payment results</FONT><BR><BR> -<%= if ( $error ) { -  $OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error processing your payment: $error</FONT>!; -} else { -  $OUT .= 'Your payment was processed sucessfully.  Thank you.'; -} %> -</TD></TR></TABLE> -<HR> -<FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT> -</BODY></HTML> - 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, -  );  }  | 
