diff options
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/edit/cust_main/billing.html | 26 | ||||
-rwxr-xr-x | httemplate/edit/cust_refund.cgi | 147 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_main.cgi | 6 | ||||
-rw-r--r-- | httemplate/misc/payment.cgi | 4 | ||||
-rw-r--r-- | httemplate/misc/process/payment.cgi | 21 | ||||
-rwxr-xr-x | httemplate/search/cust_pay.cgi | 2 | ||||
-rw-r--r-- | httemplate/view/cust_main/billing.html | 8 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history.html | 4 |
8 files changed, 137 insertions, 81 deletions
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index 78a2002a4..ae5630739 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -23,7 +23,10 @@ <FORM NAME="<% $cust_main->payby %>" STYLE="margin-top: 0; margin-bottom: 0"> % # XXX key -% foreach my $field (qw( payinfo payname paycvv paystart_month paystart_year payissue payip )) { + + + <INPUT TYPE="hidden" NAME="payinfo" VALUE="<% $cust_main->paymask %>"> +% foreach my $field (qw( payname paycvv paystart_month paystart_year payissue payip )) { <INPUT TYPE="hidden" NAME="<% $field %>" VALUE="<% $cust_main->getfield($field) %>"> @@ -136,16 +139,19 @@ </SCRIPT> % % -% my($payby, $payinfo, $payname)=( +% my($payby, $paymask, $payname)=( % $cust_main->payby, -% $cust_main->payinfo, +% $cust_main->paymask, % $cust_main->payname, % ); -% my( $account, $aba ) = split('@', $payinfo); +% my( $account, $aba ) = split('@', $paymask); % % my $disabled = 'DISABLED style="background-color: #dddddd"'; % my $text_disabled = 'style="color: #999999"'; -% if ( $payby =~ /^(CARD|DCRD)$/ && cardtype($payinfo) =~ /^(Switch|Solo)$/ ) { +% +% # this is not going to work unless the mask-generation recognizes +% # Switch/Solo cards +% if ( $payby =~ /^(CARD|DCRD)$/ && cardtype($paymask) =~ /^(Switch|Solo)$/ ) { % $disabled = 'style="background-color: #ffffff"'; % $text_disabled = 'style="color: #000000";' % } @@ -157,7 +163,7 @@ % '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'. % % qq!<TR><TD ALIGN="right" WIDTH="200">${r}Card number </TD>!. -% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE="!. ( $payby =~ /^(CARD|DCRD)$/ ? $payinfo : '' ). qq!" MAXLENGTH=19 onChange="card_changed(this)" onKeyUp="card_changed(this)"></TD></TR>!. +% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE="!. ( $payby =~ /^(CARD|DCRD)$/ ? $paymask : '' ). qq!" MAXLENGTH=19 onChange="card_changed(this)" onKeyUp="card_changed(this)"></TD></TR>!. % % qq!<TR><TD ALIGN="right" WIDTH="200">${r}Expiration </TD>!. % '<TD WIDTH="408">'. @@ -174,7 +180,7 @@ % % qq!(<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/cvv2.html', 480, 352, 'cvv2_popup' ), CAPTION, 'CVV2 Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;">help</A>)!. % qq!</TD>!. -% '<TD WIDTH="408"><INPUT TYPE="text" NAME="paycvv" VALUE="'. ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->paycvv : '' ). '" SIZE=4 MAXLENGTH=4>'. +% '<TD WIDTH="408"><INPUT TYPE="text" NAME="paycvv" VALUE="'. ( $payby =~ /^(CARD|DCRD)$/ && !$cust_main->is_encrypted($cust_main->paycvv) ? $cust_main->paycvv : '' ). '" SIZE=4 MAXLENGTH=4>'. % % % qq!<TR><TD ALIGN="right" WIDTH="200"><SPAN ID="paystart_label" $text_disabled>Start date </SPAN></TD>!. @@ -188,7 +194,7 @@ % 'end_year' => (localtime())[5] + 1900, % 'selected_date' => ( % ( $payby =~ /^(CARD|DCRD)$/ -% && cardtype($payinfo) =~ /^(Switch|Solo)$/ ) +% && cardtype($paymask) =~ /^(Switch|Solo)$/ ) #also % ? $cust_main->paystart_month. '-'. % $cust_main->paystart_year % : '' @@ -236,7 +242,7 @@ % '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'. % % qq!<TR><TD ALIGN="right" WIDTH="200">${r}Phone number </TD>!. -% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE="!. ( $payby eq 'LECB' ? $cust_main->payinfo : '' ). qq!" MAXLENGTH=15 SIZE=16></TD></TR>!. +% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE="!. ( $payby eq 'LECB' ? $cust_main->paymask : '' ). qq!" MAXLENGTH=15 SIZE=16></TD></TR>!. % % qq!<INPUT TYPE="hidden" NAME="exp_month" VALUE="12">!. % qq!<INPUT TYPE="hidden" NAME="exp_year" VALUE="2037">!. @@ -256,7 +262,7 @@ % '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'. % % qq!<TR><TD ALIGN="right" WIDTH="200">P.O. </TD>!. -% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE="!. ( $payby eq 'BILL' ? $cust_main->payinfo : '' ). qq!"></TD></TR>!. +% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE="!. ( $payby eq 'BILL' ? $cust_main->paymask : '' ). qq!"></TD></TR>!. % % qq!<INPUT TYPE="hidden" NAME="exp_month" VALUE="12">!. % qq!<INPUT TYPE="hidden" NAME="exp_year" VALUE="2037">!. diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi index 2b3e02614..aa825af94 100755 --- a/httemplate/edit/cust_refund.cgi +++ b/httemplate/edit/cust_refund.cgi @@ -1,4 +1,3 @@ -<!-- mason kludge --> % % %my $conf = new FS::Conf; @@ -26,70 +25,102 @@ % %my $p1 = popurl(1); % -%print header('Refund '. ucfirst(lc($payby)). ' payment', ''); -%print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'), -% "</FONT>" -% if $cgi->param('error'); -%print <<END, small_custview($custnum, $conf->config('countrydefault')); -% <FORM ACTION="${p1}process/cust_refund.cgi" METHOD=POST> -% <INPUT TYPE="hidden" NAME="refundnum" VALUE=""> -% <INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum"> -% <INPUT TYPE="hidden" NAME="paynum" VALUE="$paynum"> -% <INPUT TYPE="hidden" NAME="_date" VALUE="$_date"> -% <INPUT TYPE="hidden" NAME="payby" VALUE="$payby"> -% <INPUT TYPE="hidden" NAME="payinfo" VALUE=""> -% <INPUT TYPE="hidden" NAME="paybatch" VALUE=""> -% <INPUT TYPE="hidden" NAME="credited" VALUE=""> -% <BR> -%END % -%if ( $cust_pay ) { + + +<% include('/elements/header.html', 'Refund '. ucfirst(lc($payby)). ' payment', '') %> +% if ( $cgi->param('error') ) { + + <FONT SIZE="+1" COLOR="#ff0000">Error: <% $cgi->param('error') %></FONT> + <BR><BR> +% } + + +<% small_custview($custnum, $conf->config('countrydefault')) %> + +<FORM NAME="RefundForm" ACTION="<% $p1 %>process/cust_refund.cgi" METHOD=POST onSubmit="document.RefundForm.submit.disabled=true"> +<INPUT TYPE="hidden" NAME="refundnum" VALUE=""> +<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>"> +<INPUT TYPE="hidden" NAME="paynum" VALUE="<% $paynum %>"> +<INPUT TYPE="hidden" NAME="_date" VALUE="<% $_date %>"> +<INPUT TYPE="hidden" NAME="payby" VALUE="<% $payby %>"> +<INPUT TYPE="hidden" NAME="payinfo" VALUE=""> +<INPUT TYPE="hidden" NAME="paybatch" VALUE=""> +<INPUT TYPE="hidden" NAME="credited" VALUE=""> +<BR> +% if ( $cust_pay ) { % % #false laziness w/FS/FS/cust_pay.pm % my $payby = $cust_pay->payby; -% my $payinfo = $cust_pay->payinfo; -% $payby =~ s/^BILL$/Check/ if $payinfo; +% my $paymask = $cust_pay->paymask; +% $payby =~ s/^BILL$/Check/ if $paymask; % $payby =~ s/^CHEK$/Electronic check/; -% $payinfo = $cust_pay->payinfo_masked if $payby eq 'CARD'; % -% print '<BR>Payment'. ntable("#cccccc", 2). -% '<TR><TD ALIGN="right">Amount</TD><TD BGCOLOR="#ffffff">$'. -% $cust_pay->paid. '</TD></TR>'. -% '<TR><TD ALIGN="right">Date</TD><TD BGCOLOR="#ffffff">'. -% time2str("%D",$cust_pay->_date). '</TD></TR>'. -% '<TR><TD ALIGN="right">Method</TD><TD BGCOLOR="#ffffff">'. -% ucfirst(lc($payby)). ' # '. $payinfo. '</TD></TR>'; +% + + + <BR>Payment + <% ntable("#cccccc", 2) %> + + <TR> + <TD ALIGN="right">Amount</TD><TD BGCOLOR="#ffffff">$<% $cust_pay->paid %></TD> + </TR> + + <TR> + <TD ALIGN="right">Date</TD><TD BGCOLOR="#ffffff"><% time2str("%D",$cust_pay->_date) %></TD> + </TR> + + <TR> + <TD ALIGN="right">Method</TD><TD BGCOLOR="#ffffff"><% ucfirst(lc($payby)) %> # <% $paymask %></TD> + </TR> +% % #false laziness w/FS/FS/cust_main::realtime_refund_bop % if ( $cust_pay->paybatch =~ /^(\w+):(\w+)(:(\w+))?$/ ) { % my ( $processor, $auth, $order_number ) = ( $1, $2, $4 ); -% print '<TR><TD ALIGN="right">Processor</TD><TD BGCOLOR="#ffffff">'. -% $processor. '</TD></TR>'; -% print '<TR><TD ALIGN="right">Authorization</TD><TD BGCOLOR="#ffffff">'. -% $auth. '</TD></TR>' -% if length($auth); -% print '<TR><TD ALIGN="right">Order number</TD><TD BGCOLOR="#ffffff">'. -% $order_number. '</TD></TR>' -% if length($order_number); -% } -% print '</TABLE>'; -%} -% -%print '<BR>Refund'. ntable("#cccccc", 2). -% '<TR><TD ALIGN="right">Date</TD><TD BGCOLOR="#ffffff">'. -% time2str("%D",$_date). '</TD></TR>'; -% -%print qq!<TR><TD ALIGN="right">Amount</TD><TD BGCOLOR="#ffffff">\$<INPUT TYPE="text" NAME="refund" VALUE="$refund" SIZE=8 MAXLENGTH=8></TD></TR>!; -% -%print qq!<TR><TD ALIGN="right">Reason</TD><TD BGCOLOR="#ffffff"><INPUT TYPE="text" NAME="reason" VALUE="$reason"></TD></TR>!; -% -%print <<END; -%</TABLE> -%<BR> -%<INPUT TYPE="submit" VALUE="Post refund"> -% </FORM> -% </BODY> -%</HTML> -%END -% -% +% + + + <TR> + <TD ALIGN="right">Processor</TD><TD BGCOLOR="#ffffff"><% $processor %></TD> + </TR> +% if ( length($auth) ) { + + <TR> + <TD ALIGN="right">Authorization</TD><TD BGCOLOR="#ffffff"><% $auth %></TD> + </TR> +% } +% if ( length($order_number) ) { + + <TR> + <TD ALIGN="right">Order number</TD><TD BGCOLOR="#ffffff"><% $order_number %></TD> + </TR> +% } +% } + + </TABLE> +% } + + +<BR>Refund +<% ntable("#cccccc", 2) %> + + <TR> + <TD ALIGN="right">Date</TD><TD BGCOLOR="#ffffff"><% time2str("%D",$_date) %></TD> + </TR> + + <TR> + <TD ALIGN="right">Amount</TD><TD BGCOLOR="#ffffff">$<INPUT TYPE="text" NAME="refund" VALUE="<% $refund %>" SIZE=8 MAXLENGTH=8></TD> + </TR> + + <TR> + <TD ALIGN="right">Reason</TD><TD BGCOLOR="#ffffff"><INPUT TYPE="text" NAME="reason" VALUE="<% $reason %>"></TD> + </TR> +</TABLE> + +<BR> +<INPUT TYPE="submit" NAME="submit" VALUE="Post refund"> + +</FORM> + +<% include('/elements/footer.html') %> diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index d5d127b2d..789f29522 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -46,6 +46,9 @@ % } fields('cust_main') %} ); % +% delete( $new->hashref->{'agent_custid'} ) +% unless $new->hashref->{'agent_custid'}; +% %if ( defined($cgi->param('same')) && $cgi->param('same') eq "Y" ) { % $new->setfield("ship_$_", '') foreach qw( % last first company address1 address2 city county state zip @@ -151,6 +154,9 @@ % && $new->paycvv =~ /^\s*\*+\s*$/ ) { % $new->paycvv($old->paycvv); % } +% if ($new->payby =~ /CARD|DCRD|CHEK|DCHK/ && $new->payinfo =~ /xx/) { +% $new->payinfo($old->payinfo); +% } % $error ||= $new->replace($old, \@invoicing_list); % %} diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi index 4c6ae3349..081964e93 100644 --- a/httemplate/misc/payment.cgi +++ b/httemplate/misc/payment.cgi @@ -67,7 +67,7 @@ function OLiframeContent(src, width, height, name) { % my $state = $cust_main->state; % my $zip = $cust_main->zip; % if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) { -% $payinfo = $cust_main->payinfo; +% $payinfo = $cust_main->paymask; % $paycvv = $cust_main->paycvv; % ( $month, $year ) = $cust_main->paydate_monthyear; % $payname = $cust_main->payname if $cust_main->payname; @@ -153,7 +153,7 @@ function OLiframeContent(src, width, height, name) { % } elsif ( $payby eq 'CHEK' ) { % my( $payinfo1, $payinfo2, $payname, $ss ) = ( '', '', '', '' ); % if ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) { -% $cust_main->payinfo =~ /^(\d+)\@(\d+)$/ +% $cust_main->paymask =~ /^(\d+)\@(\d+)$/ % or die "unparsable payinfo ". $cust_main->payinfo; % ($payinfo1, $payinfo2) = ($1, $2); % $payname = $cust_main->payname; diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index 027cd502a..d591db1e8 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -44,17 +44,24 @@ %my $paycvv = ''; %if ( $payby eq 'CHEK' ) { % -% $cgi->param('payinfo1') =~ /^(\d+)$/ -% or eidiot "illegal account number ". $cgi->param('payinfo1'); -% my $payinfo1 = $1; -% $cgi->param('payinfo2') =~ /^(\d+)$/ -% or eidiot "illegal ABA/routing number ". $cgi->param('payinfo2'); -% my $payinfo2 = $1; -% $payinfo = $payinfo1. '@'. $payinfo2; +% if ($cgi->param('payinfo1') =~ /xx/ || $cgi->param('payinfo2') =~ /xx/ ) { +% $payinfo = $cust_main->payinfo; +% } else { +% $cgi->param('payinfo1') =~ /^(\d+)$/ +% or eidiot "illegal account number ". $cgi->param('payinfo1'); +% my $payinfo1 = $1; +% $cgi->param('payinfo2') =~ /^(\d+)$/ +% or eidiot "illegal ABA/routing number ". $cgi->param('payinfo2'); +% my $payinfo2 = $1; +% $payinfo = $payinfo1. '@'. $payinfo2; +% } % %} elsif ( $payby eq 'CARD' ) { % % $payinfo = $cgi->param('payinfo'); +% if ($payinfo eq $cust_main->paymask) { +% $payinfo = $cust_main->payinfo; +% } % $payinfo =~ s/\D//g; % $payinfo =~ /^(\d{13,16})$/ % or eidiot gettext('invalid_card'); # . ": ". $self->payinfo; diff --git a/httemplate/search/cust_pay.cgi b/httemplate/search/cust_pay.cgi index 87da1791b..98cc0e799 100755 --- a/httemplate/search/cust_pay.cgi +++ b/httemplate/search/cust_pay.cgi @@ -164,7 +164,7 @@ sub { my $cust_pay = shift; if ( $cust_pay->payby eq 'CARD' ) { - 'Card #'. $cust_pay->payinfo_masked; + 'Card #'. $cust_pay->paymask; } elsif ( $cust_pay->payby eq 'CHEK' ) { 'E-check acct#'. $cust_pay->payinfo; } elsif ( $cust_pay->payby eq 'BILL' ) { diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index d1be8936f..1f80dc5bc 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -7,7 +7,11 @@ Billing information -(<A HREF="<% $p %>misc/bill.cgi?<% $cust_main->custnum %>">Bill now</A>) +% # If we can't see the unencrypted card, then bill now is an exercise in frustration +%if ( ! $cust_main->is_encrypted($cust_main->payinfo) ) { + (<A HREF="<% $p %>misc/bill.cgi?<% $cust_main->custnum %>">Bill now</A>) +% } + <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %> % %( my $balance = $cust_main->balance ) @@ -31,7 +35,7 @@ Billing information </TR> <TR> <TD ALIGN="right">Card number</TD> - <TD BGCOLOR="#ffffff"><% $cust_main->payinfo_masked %></TD> + <TD BGCOLOR="#ffffff"><% $cust_main->paymask %></TD> </TR> % %#false laziness w/elements/select-month_year.html & edit/cust_main/billing.html diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 4f46ace6d..57d11b9e8 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -18,6 +18,7 @@ % if ( ( $payby{'CARD'} || $payby{'DCRD'} ) % && $curuser->access_right('Process payment') +% && ! $cust_main->is_encrypted($cust_main->payinfo) % ) { <% $s++ ? ' | ' : '' %> <A HREF="<% $p %>misc/payment.cgi?payby=CARD;custnum=<% $custnum %>">Process credit card payment</A> @@ -25,6 +26,7 @@ % if ( ( $payby{'CHEK'} || $payby{'DCHK'} ) % && $curuser->access_right('Process payment') +% && ! $cust_main->is_encrypted($cust_main->payinfo) % ) { <% $s++ ? ' | ' : '' %> <A HREF="<% $p %>misc/payment.cgi?payby=CHEK;custnum=<% $custnum %>">Process electronic check (ACH) payment</A> @@ -76,7 +78,7 @@ % % my $payinfo; % if ( $payby eq 'CARD' ) { -% $payinfo = $cust_pay->payinfo_masked; +% $payinfo = $cust_pay->paymask; % } elsif ( $payby eq 'CHEK' && $cust_pay->payinfo =~ /^(\d+)\@(\d+)$/ ) { % $payinfo = "ABA $2, Acct# $1"; % } else { |