diff options
author | ivan <ivan> | 2005-06-08 09:03:06 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-06-08 09:03:06 +0000 |
commit | 04cc48bd2a049909af54b9e58afebffe51cdd1b2 (patch) | |
tree | b2cfa7703499af022d1b7669138077cb8c211623 /fs_selfservice/FS-SelfService/cgi | |
parent | 2b7d11d0b79821a0c7f39ce8777b6aa91d37a26e (diff) |
prepaid card recharge
Diffstat (limited to 'fs_selfservice/FS-SelfService/cgi')
14 files changed, 163 insertions, 19 deletions
diff --git a/fs_selfservice/FS-SelfService/cgi/agent_delete_svc.html b/fs_selfservice/FS-SelfService/cgi/agent_delete_svc.html index e8be07ed1..7a2b75071 100644 --- a/fs_selfservice/FS-SelfService/cgi/agent_delete_svc.html +++ b/fs_selfservice/FS-SelfService/cgi/agent_delete_svc.html @@ -1,7 +1,6 @@ <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> <%= include('myaccount_menu') %> <TD VALIGN="top"> <%= $small_custview %> diff --git a/fs_selfservice/FS-SelfService/cgi/delete_svc.html b/fs_selfservice/FS-SelfService/cgi/delete_svc.html index 16054a77c..8468deb4b 100644 --- a/fs_selfservice/FS-SelfService/cgi/delete_svc.html +++ b/fs_selfservice/FS-SelfService/cgi/delete_svc.html @@ -1,7 +1,6 @@ <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> <%= include('myaccount_menu') %> <TD VALIGN="top"> diff --git a/fs_selfservice/FS-SelfService/cgi/make_payment.html b/fs_selfservice/FS-SelfService/cgi/make_payment.html index 3522c0867..1bbbe90b2 100644 --- a/fs_selfservice/FS-SelfService/cgi/make_payment.html +++ b/fs_selfservice/FS-SelfService/cgi/make_payment.html @@ -1,7 +1,6 @@ <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> <%= include('myaccount_menu') %> <TD VALIGN="top"> <FONT SIZE=4>Make a payment</FONT><BR><BR> diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount.html b/fs_selfservice/FS-SelfService/cgi/myaccount.html index 9997d7059..546ca1112 100644 --- a/fs_selfservice/FS-SelfService/cgi/myaccount.html +++ b/fs_selfservice/FS-SelfService/cgi/myaccount.html @@ -1,7 +1,6 @@ <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> <%= include('myaccount_menu') %> <TD VALIGN="top"> diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html b/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html index ba3b3f2ff..f2e5e998e 100644 --- a/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html +++ b/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html @@ -1,13 +1,89 @@ <%= $url = "$selfurl?session=$session_id;action="; ''; %> +<TABLE BORDER=0><TR> <TD VALIGN="top" HEIGHT=384 BGCOLOR="#dddddd"> -<A HREF="<%= $url %>myaccount">Overview</A><BR><BR> -<!--A HREF="<%= $url %>change_bill"-->Change payment info</A> *<BR><BR> -<!--A HREF="<%= $url %>change_ship"-->Change service address</A> *<BR><BR> -<A HREF="<%= $url %>provision">Setup my services</A><BR><BR> -<!--A HREF="<%= $url %>order"-->Purchase additional package</A> *<BR><BR> -<!--<A HREF="<%= $url %>pw_list">Change password(s)</A> *<BR><BR>--> -<A HREF="passwd.html">Change password(s)</A><BR><BR> -<A HREF="<%= $url %>logout">Logout</A><BR><BR> +<TABLE CELLSPACING=0 BORDER=0> + +<%= + +my @menu = ( +{ title=>' ' }, +{ title=>'Overview', url=>'myaccount', size=>'+1', }, +{ title=>' ' }, + +{ title=>'Purchase', size=>'+1', }, + { title=>'Purchase additional package*', url=>'order', 'indent'=>2 }, +); + +if ( 1 ) { #XXXFIXME "enable selfservice prepay features" flag or something, eventually per-pkg or something really fancy + + push @menu, ( + { title=>'Recharge my account with a credit card', + url=>'make_payment', indent=>2 }, + { title=>'Recharge my account with a prepaid card', + url=>'recharge_prepay', indent=>2 }, + ); + +} + +push @menu, ( + +{ title=>' ' }, + +{ title=>'Setup my services', url=>'provision', size=>'+1', }, + +{ title=>' ' }, + +{ title=>'Change my information', size=>'+1', }, + { title=>'Change payment information*', url=>'change_bill', indent=>2 }, + { title=>'Change service address*', url=>'change_ship', indent=>2 }, + { title=>'Change password(s)*', url=>'hmmmFIXME', indent=>2 }, + +{ title=>' ' }, + +{ title=>'Logout', url=>'logout', size=>'+1', }, + +); + +foreach my $item ( @menu ) { + + $OUT .= '<TR><TD'; + if ( exists $item->{'url'} && $action eq $item->{'url'} ) { + $OUT .= ' BGCOLOR="#eeeeee" '. + ' STYLE="border-top: 1px solid black;'. + ' border-left: 1px solid black;'. + ' border-bottom: 1px solid black"'; + } else { + $OUT .= ' STYLE="border-right: 1px solid black"'; + } + $OUT.='>'; + + $OUT .= '<FONT SIZE="'. $item->{'size'}. '">' + if exists $item->{'size'}; + + $OUT .= ' ' x $item->{'indent'} + if exists $item->{'indent'}; + + $OUT .= '<A HREF="'. $url. $item->{'url'}. '">' + if exists $item->{'url'} && $action ne $item->{'url'}; + + $item->{'title'} =~ s/ / /g; + $OUT .= $item->{'title'}; + + $OUT .= '</FONT>' + if exists $item->{'size'}; + + $OUT .= '</A>' + if exists $item->{'url'} && $action ne $item->{'url'}; + + $OUT .= '</TD></TR>'; + +} + +%> + +</TABLE> + +<A HREF="passwd.html">(tempFIXME) Change password(s)</A><BR><BR> * coming soon </TD> diff --git a/fs_selfservice/FS-SelfService/cgi/payment_results.html b/fs_selfservice/FS-SelfService/cgi/payment_results.html index 44289deba..de6c54dae 100644 --- a/fs_selfservice/FS-SelfService/cgi/payment_results.html +++ b/fs_selfservice/FS-SelfService/cgi/payment_results.html @@ -1,7 +1,6 @@ <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> <%= include('myaccount_menu') %> <TD VALIGN="top"> <FONT SIZE=4>Payment results</FONT><BR><BR> diff --git a/fs_selfservice/FS-SelfService/cgi/process_svc_acct.html b/fs_selfservice/FS-SelfService/cgi/process_svc_acct.html index 7052059c4..200a80dc9 100644 --- a/fs_selfservice/FS-SelfService/cgi/process_svc_acct.html +++ b/fs_selfservice/FS-SelfService/cgi/process_svc_acct.html @@ -1,7 +1,6 @@ <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> <%= include('myaccount_menu') %> <TD VALIGN="top"> diff --git a/fs_selfservice/FS-SelfService/cgi/process_svc_external.html b/fs_selfservice/FS-SelfService/cgi/process_svc_external.html index 772cf0838..2328fa10f 100644 --- a/fs_selfservice/FS-SelfService/cgi/process_svc_external.html +++ b/fs_selfservice/FS-SelfService/cgi/process_svc_external.html @@ -1,7 +1,6 @@ <HTML><HEAD><TITLE><%= $error ? 'MyAccount' : sprintf("Your serial number is %010d-$title", $id) %></TITLE></HEAD> <BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR> <%= $url = "$selfurl?session=$session_id;action="; ''; %> -<TABLE BORDER=0 CELLPADDING=4><TR> <%= include('myaccount_menu') %> <TD VALIGN="top"> diff --git a/fs_selfservice/FS-SelfService/cgi/provision.html b/fs_selfservice/FS-SelfService/cgi/provision.html index 6d80e89db..d31e6070b 100644 --- a/fs_selfservice/FS-SelfService/cgi/provision.html +++ b/fs_selfservice/FS-SelfService/cgi/provision.html @@ -1,7 +1,6 @@ <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> <%= include('myaccount_menu') %> <TD VALIGN="top"> <%= include('provision_list') %> diff --git a/fs_selfservice/FS-SelfService/cgi/provision_svc_acct.html b/fs_selfservice/FS-SelfService/cgi/provision_svc_acct.html index cf3585721..50540742a 100644 --- a/fs_selfservice/FS-SelfService/cgi/provision_svc_acct.html +++ b/fs_selfservice/FS-SelfService/cgi/provision_svc_acct.html @@ -1,7 +1,6 @@ <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> <%= include('myaccount_menu') %> <TD VALIGN="top"> <%= include('svc_acct') %> diff --git a/fs_selfservice/FS-SelfService/cgi/recharge_prepay.html b/fs_selfservice/FS-SelfService/cgi/recharge_prepay.html new file mode 100644 index 000000000..f8584597a --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/recharge_prepay.html @@ -0,0 +1,36 @@ +<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD> +<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR> +<%= $url = "$selfurl?session=$session_id;action="; ''; %> +<%= include('myaccount_menu') %> +<TD VALIGN="top"> +<FONT SIZE=4>Recharge with prepaid card</FONT><BR><BR> +<FORM NAME="OneTrueForm" METHOD="POST" ACTION="<%=$selfurl%>" onSubmit="document.OneTrueForm.process.disabled=true"> +<INPUT TYPE="hidden" NAME="session" VALUE="<%=$session_id%>"> +<INPUT TYPE="hidden" NAME="action" VALUE="recharge_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">Prepaid card number</TD> + <TD> + <INPUT TYPE="text" NAME="prepaid_cardnum" SIZE=20 MAXLENGTH=19 VALUE="<%=$prepaid_cardnum%>"> + </TD> +</TR> +</TABLE> +<BR> +<INPUT TYPE="hidden" NAME="paybatch" VALUE="<%=$paybatch%>"> +<INPUT TYPE="submit" NAME="process" VALUE="Recharge"> <!-- onClick="this.disabled=true"> --> +</FORM> +</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/recharge_results.html b/fs_selfservice/FS-SelfService/cgi/recharge_results.html new file mode 100644 index 000000000..ec3ea2c7a --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/recharge_results.html @@ -0,0 +1,24 @@ +<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD> +<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR> +<%= $url = "$selfurl?session=$session_id;action="; ''; %> +<%= include('myaccount_menu') %> +<TD VALIGN="top"> +<FONT SIZE=4>Recharge results</FONT><BR><BR> +<%= if ( $error ) { + $OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error processing your prepaid card: $error</FONT>!; +} else { + $OUT .= 'Prepaid card recharge sucessful!<BR><BR>'; + + $OUT .= '$'. sprintf('%.2f', $amount). ' added to your account.<BR><BR>' + if $amount; + + $OUT .= $duration. ' added to your account.<BR><BR>' + if $seconds; + + $OUT .= '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 0816758fb..034a684c6 100644 --- a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi +++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi @@ -9,6 +9,7 @@ use Text::Template; use HTML::Entities; use FS::SelfService qw( login customer_info invoice payment_info process_payment + process_prepay list_pkgs part_svc_info provision_acct provision_external unprovision_svc @@ -61,7 +62,7 @@ $session_id = $cgi->param('session'); #order|pw_list XXX ??? $cgi->param('action') =~ - /^(myaccount|view_invoice|make_payment|payment_results|logout|change_bill|change_ship|provision|provision_svc|process_svc_acct|process_svc_external|delete_svc)$/ + /^(myaccount|view_invoice|make_payment|payment_results|recharge_prepay|recharge_results|logout|change_bill|change_ship|provision|provision_svc|process_svc_acct|process_svc_external|delete_svc)$/ or die "unknown action ". $cgi->param('action'); my $action = $1; @@ -79,6 +80,7 @@ if ( $result->{error} eq "Can't resume session" ) { #ick warn "processing template $action\n"; do_template($action, { 'session_id' => $session_id, + 'action' => $action, #so the menu knows what tab we're on... %{$result} }); @@ -173,6 +175,22 @@ sub payment_results { } +sub recharge_prepay { + customer_info( 'session_id' => $session_id ); +} + +sub recharge_results { + + my $prepaid_cardnum = $cgi->param('prepaid_cardnum'); + $prepaid_cardnum =~ s/\W//g; + $prepaid_cardnum =~ /^(\w*)$/ or die "illegal prepaid card number"; + $prepaid_cardnum = $1; + + process_prepay ( 'session_id' => $session_id, + 'prepaid_cardnum' => $prepaid_cardnum, + ); +} + sub logout { FS::SelfService::logout( 'session_id' => $session_id ); } diff --git a/fs_selfservice/FS-SelfService/cgi/view_invoice.html b/fs_selfservice/FS-SelfService/cgi/view_invoice.html index 46f731890..72d061980 100644 --- a/fs_selfservice/FS-SelfService/cgi/view_invoice.html +++ b/fs_selfservice/FS-SelfService/cgi/view_invoice.html @@ -1,7 +1,6 @@ <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> <%= include('myaccount_menu') %> <TD VALIGN="top"> |