X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fpayment.cgi;h=7911a5dd9073ec18e6ed13cd3b65cc60b74f0272;hp=004700488b65f98177bbaeb10046d68aab4442a9;hb=94b60bb13c044e436800239be3e3c5a029bdff8e;hpb=d8cb6cd67cc574c90dbbfbd8db2da6711c516d65
diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi
index 004700488..7911a5dd9 100644
--- a/httemplate/misc/payment.cgi
+++ b/httemplate/misc/payment.cgi
@@ -1,251 +1,211 @@
-<% include( '/elements/header.html', "Process $type{$payby} payment" ) %>
-<% include( '/elements/small_custview.html', $cust_main, '', '', popurl(2) . "view/cust_main.cgi" ) %>
+<& /elements/header-cust_main.html, view=>'payment_history', cust_main=>$cust_main &>
+
+
<% emt("Process [_1] payment",$type{$payby}) %>
+
-<% include('/elements/footer.html') %>
+
+
+<& /elements/footer-cust_main.html &>
+<%once>
+
+my %weight = (
+ 1 => 'Primary',
+ 2 => 'Secondary',
+ 3 => 'Tertiary',
+ 4 => 'Fourth',
+ 5 => 'Fifth',
+ 6 => 'Sixth',
+ 7 => 'Seventh',
+);
+
+%once>
<%init>
die "access denied"
@@ -259,6 +219,17 @@ $cgi->param('payby') =~ /^(CARD|CHEK)$/
or die "unknown payby ". $cgi->param('payby');
my $payby = $1;
+my $validate_select_fields = "#payment_option, #invoice, #custpaybynum, ";
+my $validate_input_fields = "#amount, input[name=payname], ";
+if ($payby eq "CHEK") {
+ $validate_input_fields .= "input[name=payinfo1], input[name=payinfo2]";
+ $validate_select_fields .= "select[name=paytype] ";
+}
+elsif ($payby eq "CARD") {
+ $validate_input_fields .= "input[name=payinfo], input[name=paycvv], input[name=address1], #city, #zip";
+ $validate_select_fields .= "#state, #country ";
+}
+
$cgi->param('custnum') =~ /^(\d+)$/
or die "illegal custnum ". $cgi->param('custnum');
my $custnum = $1;
@@ -270,16 +241,8 @@ my $balance = $cust_main->balance;
my $payinfo = '';
-#false laziness w/selfservice make_payment.html shortcut for one-country
my $conf = new FS::Conf;
-my %states = map { $_->state => 1 }
- qsearch('cust_main_county', {
- 'country' => $conf->config('countrydefault') || 'US'
- } );
-my @states = sort { $a cmp $b } keys %states;
my $payunique = "webui-payment-". time. "-$$-". rand() * 2**32;
%init>
-
-