X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fprocess%2Fpayment.cgi;h=fb6a41bd32af05d70e0805101a14aaab184886ed;hb=3d62ec9362d0b22c17a17da6197f8b2fc219a54e;hp=c1c9071f9a216210abad91de29b7d0cb3b98dbde;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984;p=freeside.git diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index c1c9071f9..fb6a41bd3 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -10,13 +10,16 @@ <% include('/elements/footer.html') %> -% } else { +% #2.5/2.7?# } elsif ( $curuser->access_right('View payments') ) { +% } elsif ( $curuser->access_right(['View invoices', 'View payments']) ) { <% $cgi->redirect(popurl(3). "view/cust_pay.html?paynum=$paynum" ) %> +% } else { +<% $cgi->redirect(popurl(3). "view/cust_main.html?custnum=$custnum" ) %> % } <%init> -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Process payment'); +my $curuser = $FS::CurrentUser::CurrentUser; +die "access denied" unless $curuser->access_right('Process payment'); #some false laziness w/MyAccount::process_payment @@ -78,8 +81,13 @@ if ( $payby eq 'CHEK' ) { $cgi->param('payinfo1') =~ /^(\d+)$/ or errorpage("illegal account number ". $cgi->param('payinfo1')); my $payinfo1 = $1; - $cgi->param('payinfo2') =~ /^(\d+)$/ - or errorpage("illegal ABA/routing number ". $cgi->param('payinfo2')); + if ( $conf->exists('echeck-no_routing') ) { + $cgi->param('payinfo2') =~ /^(\d*)$/ + or errorpage("illegal ABA/routing number ". $cgi->param('payinfo2')); + } else { + $cgi->param('payinfo2') =~ /^(\d+)$/ + or errorpage("illegal ABA/routing number ". $cgi->param('payinfo2')); + } my $payinfo2 = $1; $payinfo = $payinfo1. '@'. $payinfo2; } @@ -91,7 +99,7 @@ if ( $payby eq 'CHEK' ) { $payinfo = $cust_main->payinfo; } $payinfo =~ s/\D//g; - $payinfo =~ /^(\d{13,16})$/ + $payinfo =~ /^(\d{13,16}|\d{8,9})$/ or errorpage(gettext('invalid_card')); # . ": ". $self->payinfo; $payinfo = $1; validate($payinfo)