X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fpayment.cgi;h=5b9f63dc0950f3ac2e24aa8d41194c2aa324fa05;hb=7c3806cdbb65e125227fc78a3acbf188097a7e33;hp=ce9a48bebed94f24aa467421b55c1ef14dcca026;hpb=7ed55804735f4f687cd64139db7bae9746282a89;p=freeside.git diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi index ce9a48beb..5b9f63dc0 100644 --- a/httemplate/misc/payment.cgi +++ b/httemplate/misc/payment.cgi @@ -1,222 +1,242 @@ -<% include( '/elements/header.html', "Process $type{$payby} payment" ) %> -<% include( '/elements/small_custview.html', $cust_main, '', '', popurl(2) . "view/cust_main.cgi" ) %> +<& /elements/header.html, mt("Process [_1] payment",$type{$payby}) &> +<& /elements/small_custview.html, $cust_main, '', '', popurl(2) . "view/cust_main.cgi" &>
-<% include('/elements/footer.html') %> +<& /elements/footer.html &> <%init> +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Process payment'); + my %type = ( 'CARD' => 'credit card', 'CHEK' => 'electronic check (ACH)', ); @@ -232,20 +252,28 @@ my $custnum = $1; my $cust_main = qsearchs( 'cust_main', { 'custnum'=>$custnum } ); die "unknown custnum $custnum" unless $cust_main; +my $location = $cust_main->bill_location; +# no proper error handling on this anyway, but when we have it, +# remember to repopulate fields in $location + my $balance = $cust_main->balance; my $payinfo = ''; -#false laziness w/selfservice make_payment.html shortcut for one-country my $conf = new FS::Conf; + +#false laziness w/selfservice make_payment.html shortcut for one-country my %states = map { $_->state => 1 } qsearch('cust_main_county', { 'country' => $conf->config('countrydefault') || 'US' } ); my @states = sort { $a cmp $b } keys %states; +my $amount = ''; +if ( $balance > 0 ) { + $amount = $balance; +} + my $payunique = "webui-payment-". time. "-$$-". rand() * 2**32; %init> - -