summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2003-05-18 11:44:37 +0000
committerivan <ivan>2003-05-18 11:44:37 +0000
commit667a729f660ad4f871acd5eb3173303396543eeb (patch)
tree3ce9706177290158e8328200da179d11e3d22160
parent2c88b03550a72438bbd75ec7461d2c26fc797efc (diff)
interface for making payments all done
-rw-r--r--FS/FS/ClientAPI/MyAccount.pm8
-rw-r--r--fs_selfservice/FS-SelfService/cgi/make_payment.html14
-rw-r--r--fs_selfservice/FS-SelfService/cgi/myaccount.html2
3 files changed, 14 insertions, 10 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index c722c9d5f..c750ada46 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -107,7 +107,6 @@ sub customer_info {
}
-
return { 'error' => '',
'custnum' => $custnum,
%return,
@@ -130,14 +129,14 @@ sub payment_info {
$return{balance} = $cust_main->balance;
$return{payname} = $cust_main->payname
- || $cust_main->first. ' '. $cust_main->get('last');
+ || ( $cust_main->first. ' '. $cust_main->get('last') );
$return{$_} = $cust_main->get($_) for qw(address1 address2 city state zip);
$return{payby} = $cust_main->payby;
if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) {
- $return{card_type} = cardtype($cust_main->payinfo);
+ warn $return{card_type} = cardtype($cust_main->payinfo);
$return{payinfo} = $cust_main->payinfo;
if ( $cust_main->paydate =~ /^(\d{4})-(\d{2})-\d{2}$/ ) { #Pg date format
@@ -167,6 +166,9 @@ sub payment_info {
'American Express' => 'American Express card',
};
+ my $_date = time;
+ $return{paybatch} = 'webui-MyAccount-$_date-$$-". rand() * 2**32
+
return { 'error' => '',
%return,
};
diff --git a/fs_selfservice/FS-SelfService/cgi/make_payment.html b/fs_selfservice/FS-SelfService/cgi/make_payment.html
index d469bddb6..ce1db6865 100644
--- a/fs_selfservice/FS-SelfService/cgi/make_payment.html
+++ b/fs_selfservice/FS-SelfService/cgi/make_payment.html
@@ -6,7 +6,7 @@
<!-- <A HREF="<%= $url %>other">SomethingElse</A><BR> -->
</TD><TD VALIGN="top">
<FONT SIZE=4>Make a payment</FONT><BR><BR>
-<FORM METHOD="POST" ACTION="<%=$selfurl%>">
+<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="process_payment">
<TABLE BGCOLOR="#cccccc">
@@ -29,8 +29,8 @@
<TD ALIGN="right">Card&nbsp;type</TD>
<TD>
<SELECT NAME="card_type"><OPTION></OPTION>
- <%= foreach ( keys %$card_types ) {
- $selected = $card_type eq $card_types->{$_} ? ' SELECTED' : '';
+ <%= foreach ( keys %card_types ) {
+ $selected = $card_type eq $card_types{$_} ? ' SELECTED' : '';
$OUT .= qq(<OPTION$selected VALUE="). $card_types->{$_}. qq(">$_\n);
} %>
</SELECT>
@@ -63,7 +63,7 @@
</TD>
</TR><TR>
<TD ALIGN="right">Exact&nbsp;name&nbsp;on&nbsp;card</TD>
- <TD><INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="payname" SVALUE="<%=$payname%>"></TD>
+ <TD><INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="payname" VALUE="<%=$payname%>"></TD>
</TR><TR>
<TD ALIGN="right">Card&nbsp;billing&nbsp;address</TD>
<TD>
@@ -85,7 +85,7 @@
<TD>State</TD>
<TD>
<SELECT NAME="state">
- <%= for ( @$states ) {
+ <%= for ( @states ) {
$OUT .= '<OPTION'. ($_ eq $state ? ' SELECTED' : '' ). ">$_\n";
} %>
</SELECT>
@@ -109,7 +109,9 @@
</TD>
</TR>
</TABLE>
-<INPUT TYPE="submit" VALUE="Process payment">
+<BR>
+<INPUT TYPE="hidden" NAME="paybatch" VALUE="$paybatch">
+<INPUT TYPE="submit" NAME="process" VALUE="Process payment"> <!-- onClick="this.disabled=true"> -->
</FORM>
</TD></TR></TABLE>
<HR>
diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount.html b/fs_selfservice/FS-SelfService/cgi/myaccount.html
index f1a63870a..f48fdedea 100644
--- a/fs_selfservice/FS-SelfService/cgi/myaccount.html
+++ b/fs_selfservice/FS-SelfService/cgi/myaccount.html
@@ -7,7 +7,7 @@
</TD><TD VALIGN="top">
Hello <%= $name %>!<BR><BR>
-Your contact information<BR><%= $small_custview %>
+<%= $small_custview %>
<BR>
<%= if ( $balance > 0 ) {
$OUT .= qq! <B><A HREF="${url}make_payment">Make a payment</A></B><BR><BR>!;